🟢 P2 | GET /activity/trend 返回真实趋势数据 #67
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
iOS 分析页「掌握度趋势」折线图和「本周学习活跃」柱状图使用硬编码假数据。
需求
GET /activity/trend?days=7 返回近 7 天的学习趋势数据,确认 ActivityTrend 模型字段完整:
date: String // YYYY-MM-DD
value: Double // 掌握度或学习分钟数
label: String // 可选的标签
影响页面
优化 (2026-06-06)
问题 1: AI 超时无保护
getTrend()调用 AI workflow 无超时,AI 服务异常时接口挂死。修复: 加
Promise.race15 秒超时,超时后返回降级空结构,不阻塞请求。问题 2: buildDailySeries UTC 时区偏差
日期比较用
toISOString().split("T")[0]转为 UTC,东八区零点前后的活动可能被归到错误日期。修复: 改用
getFullYear()/getMonth()/getDate()本地时间构建日期字符串。状态
✅ 已修复。