feat: add quit-checkin v2 backend APIs

This commit is contained in:
你çšnepiedg
2026-03-17 00:47:33 +08:00
parent 12619aa4ab
commit 9278260681
11 changed files with 2212 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package routes
import (
"github.com/gin-gonic/gin"
quitcheckinhandler "wx_service/internal/quitcheckin/handler"
)
// registerQuitCheckinRoutes 用于注册 V2 无烟打卡相关接口。
func registerQuitCheckinRoutes(protected *gin.RouterGroup, handler *quitcheckinhandler.Handler) {
v2 := protected.Group("")
{
v2.GET("/profile", handler.GetProfile)
v2.POST("/profile", handler.UpsertProfile)
v2.GET("/checkin/home", handler.Home)
v2.POST("/checkin/check", handler.Checkin)
v2.POST("/checkin/relapse", handler.Relapse)
v2.GET("/stats/overview", handler.StatsOverview)
v2.GET("/badges", handler.ListBadges)
v2.GET("/relapses", handler.ListRelapses)
v2.GET("/reward-goals", handler.ListRewardGoals)
v2.POST("/reward-goals", handler.CreateRewardGoal)
v2.PUT("/reward-goals/:id", handler.UpdateRewardGoal)
v2.GET("/poster/data", handler.PosterData)
v2.POST("/poster/generate", handler.GeneratePoster)
}
}