Update algorithm and API documentation for smoking tracking app

- Enhanced the algorithm documentation to clarify the calculation of smoking intervals, including default values and edge cases.
- Updated API documentation to reflect changes in response formats, including the addition of `exceeded_yesterday` and adjustments to time formatting to RFC3339.
- Improved descriptions of user profile management and AI suggestions in the product documentation, ensuring consistency across all related files.
- Removed outdated sequence diagram and UI documentation files to streamline project resources.
This commit is contained in:
nepiedg
2026-01-25 08:51:25 +00:00
parent b67dc32369
commit f80c3e8f45
9 changed files with 62 additions and 402 deletions
+11 -11
View File
@@ -28,10 +28,10 @@
|------|------|----------|
| 问候语 | 根据时段显示(早上好/下午好等) + 用户昵称 | 本地计算 + profile |
| AI 提示卡片 | 发现的抽烟规律/建议(可关闭) | `GET /ai/advice` 缓存 |
| 计时环 | 距上次抽烟时间(时:分:秒) | `dashboard.minutes_since_last` |
| 计时环 | 距上次抽烟时间(时:分:秒) | `GET /next_smoke_time``last_smoke_at`(前端计时) |
| 下次建议时间 | 显示建议的下次抽烟时间点 | `GET /next_smoke_time` |
| 今日已抽 | X / 目标数,较昨日 ±N | `dashboard.today_count` |
| 烟瘾发作已抵抗 | 忍住次数统计 | 筛选 `level=0,num=0` 记录 |
| 今日已抽 | X / 目标数,较昨日 ±N | `next_smoke_time.today_count` + `next_smoke_time.reduced_from_yesterday`(可为负) + `next_smoke_time.exceeded_yesterday`(标识“超出昨日”) |
| 烟瘾发作已抵抗 | 忍住次数统计 | `next_smoke_time.resisted_count` |
| 记录抽烟按钮 | 快速记录一次抽烟 | `POST /logs` |
| 想抽忍住了按钮 | 记录成功抵抗 | `POST /logs/resisted` |
@@ -81,7 +81,7 @@
| 筛选 Tabs | 全部 / 已抽烟 / 已忍住 | 前端筛选 |
| 时间线 | 按日期分组展示 | `GET /logs` |
| 记录卡片 | 类型、时间、原因标签、间隔时间 | logs 数据 |
| 左滑操作 | 编辑 / 删除 | `PUT/DELETE /logs/:id` |
| 左滑操作 | 编辑 / 删除 | `POST/DELETE /logs/:id` |
| 新增按钮 | 浮动按钮快速新增 | 跳转记录流程 |
### 2.5 个人中心 (profile_&_settings)
@@ -92,11 +92,11 @@
|------|------|----------|
| 用户信息 | 头像、昵称 | 微信授权 |
| 目标展示 | 目标戒烟日期、连续天数 | profile |
| 目标设定 | 调整每日限额与戒烟日期 | `PUT /profile` |
| 目标设定 | 调整每日限额与戒烟日期 | `POST /profile` |
| AI 计划调整 | 个性化辅导风格设置 | profile 扩展 |
| 通知设置 | 提醒时间、频率 | 本地存储 |
| 会员解锁 | PRO 功能 / 广告解锁 | 会员系统 |
| 基础设置 | 作息时间等 | `PUT /profile` |
| 基础设置 | 作息时间等 | `POST /profile` |
| 隐私与数据 | 数据导出、账号注销 | 待扩展 |
---
@@ -126,7 +126,7 @@ Step 5: 作息时间 (wake_up_time, sleep_time)
Step 6: 设置目标 (目标日期、每日限额)
提交 profile (PUT /profile)
提交 profile (POST /profile)
进入首页
```
@@ -186,8 +186,8 @@ Step 6: 设置目标 (目标日期、每日限额)
```
[并行请求]
├── GET /profile (用户信息,判断是否需引导)
├── GET /dashboard (今日统计,计时器数据)
└── GET /next_smoke_time (下次建议时间)
├── GET /next_smoke_time (首页汇总 + 下次建议时间)
└── GET /dashboard (看板数据,可延迟)
[延迟加载]
└── GET /ai/advice (AI提示卡片,非关键)
@@ -195,8 +195,8 @@ Step 6: 设置目标 (目标日期、每日限额)
**缓存策略**
- profile: 登录后缓存,变更时更新
- dashboard: 每次进入刷新,后台定时更
- next_smoke_time: 缓存至下次记录
- next_smoke_time: 每次进入刷新,下一次记录后刷
- dashboard: 进入看板时刷新
- ai/advice: 按天缓存
### 5.2 数据预加载