Enhance AI and Redis integration for smoke logging features
- Added AI configuration options to .env.example and config.go for OpenAI integration. - Implemented Redis caching for session management in main.go and auth middleware. - Updated smoke logging service to support real smoking time (`smoke_at`) and AI advice retrieval. - Enhanced API routes to include endpoints for AI advice and unlock functionality for non-members. - Improved database schema with new tables for AI advice and unlock records. - Expanded documentation to cover new AI features and Redis caching implementation.
This commit is contained in:
@@ -15,5 +15,9 @@ func registerSmokeRoutes(protected *gin.RouterGroup, smokeHandler *smokehandler.
|
||||
smoke.GET("/logs/:id", smokeHandler.Get)
|
||||
smoke.PUT("/logs/:id", smokeHandler.Update)
|
||||
smoke.DELETE("/logs/:id", smokeHandler.Delete)
|
||||
|
||||
// AI 戒烟建议(会员优先;非会员需看广告解锁)
|
||||
smoke.GET("/ai/advice", smokeHandler.GetAIAdvice)
|
||||
smoke.POST("/ai/advice_unlocks", smokeHandler.UnlockAIAdvice)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user