feat: account.

This commit is contained in:
2026-02-03 15:43:42 +08:00
parent 1c38601fe0
commit 85ec3cba4a
8 changed files with 276 additions and 3 deletions

View File

@ -23,7 +23,7 @@ func SetupRouter() *gin.Engine {
records.POST("/analysis-by-ai", trainingController.AnalyzeByAI)
// 可扩展其他路由GET, PUT, DELETE等
}
steps := v1.Group("/step") //.Use(middleware.AuthMiddleware())
steps := v1.Group("/step").Use(middleware.JWTAuth())
{
steps.POST("", stepTrainController.CreateTrainingRecord)
steps.GET("train-records", stepTrainController.GetTrainingRecords)
@ -31,6 +31,11 @@ func SetupRouter() *gin.Engine {
steps.GET("train-rank/:trainId", stepTrainController.GetTrainingRank)
// 可扩展其他路由GET, PUT, DELETE等
}
public := v1.Group("")
{
public.POST("/register", controllers.Register)
public.POST("/login", controllers.Login)
}
auth := v1.Group("/auth")
{
auth.GET("/token", func(c *gin.Context) {