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:
@@ -0,0 +1,17 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
membershiphandler "wx_service/internal/membership/handler"
|
||||
)
|
||||
|
||||
func registerMembershipRoutes(protected *gin.RouterGroup, redeemCodeHandler *membershiphandler.RedeemCodeHandler) {
|
||||
// 会员兑换码:生成(后台口令鉴权)+ 兑换(登录用户)
|
||||
membership := protected.Group("/membership")
|
||||
{
|
||||
membership.POST("/redeem_codes", redeemCodeHandler.Generate)
|
||||
membership.POST("/redeem", redeemCodeHandler.Redeem)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user