Add motivation quote feature to smoking tracking API

- Introduced a new database model `SmokeMotivationQuote` for storing motivational quotes.
- Added a new API endpoint `GET /api/v1/smoke/motivation` to retrieve motivation quotes for users.
- Updated the main.go file to include the new model in the auto-migration process.
- Enhanced smoke_routes.go to register the new motivation route with the smoke handler.
This commit is contained in:
nepiedg
2026-01-25 09:53:18 +00:00
parent c9ebfd5873
commit 3154365ab2
5 changed files with 179 additions and 0 deletions
+1
View File
@@ -26,6 +26,7 @@ func registerSmokeRoutes(protected *gin.RouterGroup, smokeHandler *smokehandler.
smoke.GET("/logs/:id", smokeHandler.Get)
smoke.POST("/logs/:id", smokeHandler.Update)
smoke.DELETE("/logs/:id", smokeHandler.Delete)
smoke.GET("/motivation", smokeHandler.Motivation)
// AI 戒烟建议(会员优先;非会员需看广告解锁)
smoke.GET("/ai/advice", smokeHandler.GetAIAdvice)