feat: 完善后端脚手架基础能力
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package rest
|
||||
|
||||
import (
|
||||
"skeleton/modules/auth"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func init() {
|
||||
RegisterPublic(registerAuthPublicRoutes)
|
||||
RegisterPrivate(registerAuthPrivateRoutes)
|
||||
}
|
||||
|
||||
func registerAuthPublicRoutes(r *gin.RouterGroup) {
|
||||
ctrl := auth.NewController()
|
||||
group := r.Group("/auth")
|
||||
group.POST("/register", ctrl.Register)
|
||||
group.POST("/login", ctrl.Login)
|
||||
group.POST("/refresh", ctrl.Refresh)
|
||||
}
|
||||
|
||||
func registerAuthPrivateRoutes(r *gin.RouterGroup) {
|
||||
ctrl := auth.NewController()
|
||||
r.POST("/auth/logout", ctrl.Logout)
|
||||
}
|
||||
Reference in New Issue
Block a user