Enhance smoking tracking API and documentation
- Updated the main.go file to set the local time zone to Asia/Shanghai. - Changed API endpoints from `PUT` to `POST` for user profile and logs management in multiple documentation files to reflect the correct usage. - Added new fields in the API response for home summary, including `last_smoke_at`, `today_count`, `resisted_count`, and `reduced_from_yesterday`. - Enhanced documentation across various files to accurately describe the updated API endpoints and their expected behaviors.
This commit is contained in:
@@ -57,14 +57,14 @@
|
||||
### 4.1 首次进入(Onboarding)
|
||||
1) 登录:`POST /api/v1/auth/login` 获取 `session_key`(Bearer)。
|
||||
2) 拉取基础信息:`GET /api/v1/smoke/profile`
|
||||
3) 若未补全:进入补全页,提交:`PUT /api/v1/smoke/profile`
|
||||
3) 若未补全:进入补全页,提交:`POST /api/v1/smoke/profile`
|
||||
4) 进入首页:展示下次时间/今日累计/最近记录。
|
||||
|
||||
### 4.2 日常记录
|
||||
- 实际抽烟:`POST /api/v1/smoke/logs`
|
||||
- 忍住:`POST /api/v1/smoke/logs/resisted`
|
||||
- 列表:`GET /api/v1/smoke/logs`、`GET /api/v1/smoke/logs/latest`
|
||||
- 编辑/删除:`PUT /api/v1/smoke/logs/:id`、`DELETE /api/v1/smoke/logs/:id`
|
||||
- 编辑/删除:`POST /api/v1/smoke/logs/:id`、`DELETE /api/v1/smoke/logs/:id`
|
||||
|
||||
### 4.3 首页“下次时间”
|
||||
- 默认展示:`GET /api/v1/smoke/next_smoke_time?date=today&mode=auto`
|
||||
@@ -106,4 +106,3 @@
|
||||
- D1/D7 留存:进入首页、完成补全、记录次数(抽烟/忍住)、打开看板、生成 AI 建议。
|
||||
- “忍住记录”转化:忍住按钮点击 -> 成功落库。
|
||||
- AI 付费/广告:解锁按钮曝光 -> 广告完成 -> 生成成功率。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user