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:
+3
-4
@@ -124,7 +124,7 @@ API:
|
||||
展示:
|
||||
- smoke_time、smoke_at、remark、level、num
|
||||
编辑:
|
||||
- `PUT /api/v1/smoke/logs/:id`(支持清空 smoke_at/smoke_time 传空字符串)
|
||||
- `POST /api/v1/smoke/logs/:id`(支持清空 smoke_at/smoke_time 传空字符串)
|
||||
删除:
|
||||
- `DELETE /api/v1/smoke/logs/:id`
|
||||
|
||||
@@ -166,7 +166,7 @@ API:
|
||||
|
||||
API:
|
||||
- `GET /api/v1/smoke/profile`
|
||||
- `PUT /api/v1/smoke/profile`
|
||||
- `POST /api/v1/smoke/profile`
|
||||
|
||||
## 4. 关键交互与状态
|
||||
|
||||
@@ -190,7 +190,7 @@ API:
|
||||
## 5. API 映射速查表
|
||||
|
||||
- 登录:`POST /api/v1/auth/login`(返回 session_key)
|
||||
- Profile:`GET/PUT /api/v1/smoke/profile`
|
||||
- Profile:`GET/POST /api/v1/smoke/profile`
|
||||
- 新增抽烟:`POST /api/v1/smoke/logs`
|
||||
- 忍住:`POST /api/v1/smoke/logs/resisted`
|
||||
- 列表:`GET /api/v1/smoke/logs`、`GET /api/v1/smoke/logs/latest`
|
||||
@@ -198,4 +198,3 @@ API:
|
||||
- 下次时间:`GET /api/v1/smoke/next_smoke_time?date=&mode=`
|
||||
- 每日 AI 建议:`GET /api/v1/smoke/ai/advice?date=`
|
||||
- 广告解锁:`POST /api/v1/smoke/ai/advice_unlocks {date}`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user