Enhance smoking tracking features with AI next smoke time suggestions

- Added new API endpoint `GET /api/v1/smoke/next_smoke_time` to provide AI-generated suggestions for the next smoking time based on user data.
- Introduced a new database table `fa_smoke_ai_next_smoke` to store structured AI time node suggestions.
- Updated smoke handler and service to integrate the new AI next smoke time functionality.
- Enhanced documentation to reflect the new API endpoint and its usage, including details on how to generate AI time nodes.
This commit is contained in:
nepiedg
2026-01-20 07:08:52 +00:00
parent dc54c4e934
commit 6cf7eb2294
15 changed files with 1394 additions and 27 deletions
+1
View File
@@ -41,6 +41,7 @@
涉及表(DDL 见:`docs/sql/smoke.sql`):
- `fa_smoke_ai_advice`:按 `uid + advice_date + prompt_version` 缓存建议结果,避免重复调用 AI。
- `fa_smoke_ai_advice_unlocks`:非会员用户的“每日解锁”记录(按 `uid + unlock_date` 唯一)。
- `fa_smoke_ai_next_smoke`:保存“AI 下次抽烟时间节点”(每个时间点一条记录),AI 元信息复用 `fa_smoke_ai_advice``type=next_smoke_time`)。
建议的权限判断顺序:
1) 若用户是会员:直接允许生成/获取建议。