heritage-api/gin/router-gin.go

20 lines
450 B
Go
Raw Normal View History

2026-03-12 09:28:19 +00:00
package gin
import (
"github.com/gin-gonic/gin"
"myschools.me/heritage/heritage-api/handler"
)
// 路由配置
func routerSetup(router *gin.Engine) {
router.Use(gin.Recovery())
api := router.Group("/api")
api.POST("/login", handler.Login)
protected := router.Group("/api")
protected.Use(auth(), authorize())
protected.POST("/logout", handler.Logout)
protected.GET("/me", handler.Me)
protected.POST("/password", handler.ChangePassword)
}