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
+7
View File
@@ -14,8 +14,12 @@ func registerSmokeRoutes(protected *gin.RouterGroup, smokeHandler *smokehandler.
smoke.GET("/profile", smokeHandler.GetProfile)
smoke.PUT("/profile", smokeHandler.UpsertProfile)
// 不使用 AI 时的默认“下次抽烟时间”建议(阶梯式延时)
smoke.GET("/next_smoke_time", smokeHandler.GetNextSmokeTime)
smoke.GET("/dashboard", smokeHandler.Dashboard)
smoke.POST("/logs", smokeHandler.Create)
smoke.POST("/logs/resisted", smokeHandler.Resist)
smoke.GET("/logs", smokeHandler.List)
smoke.GET("/logs/latest", smokeHandler.LatestLogs)
smoke.GET("/logs/:id", smokeHandler.Get)
@@ -25,5 +29,8 @@ func registerSmokeRoutes(protected *gin.RouterGroup, smokeHandler *smokehandler.
// AI 戒烟建议(会员优先;非会员需看广告解锁)
smoke.GET("/ai/advice", smokeHandler.GetAIAdvice)
smoke.POST("/ai/advice_unlocks", smokeHandler.UnlockAIAdvice)
// AI 下次抽烟时间建议(结构化时间节点)
smoke.GET("/ai/next_smoke_time", smokeHandler.GetAINextSmokeTime)
}
}