1Panel/backend/router/ro_user.go
2022-08-17 09:37:30 +08:00

25 lines
684 B
Go

package router
import (
v1 "github.com/1Panel-dev/1Panel/app/api/v1"
"github.com/1Panel-dev/1Panel/middleware"
"github.com/gin-gonic/gin"
)
type UserRouter struct{}
func (s *UserRouter) InitUserRouter(Router *gin.RouterGroup) {
userRouter := Router.Group("users")
userRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
withRecordRouter := userRouter.Use(middleware.OperationRecord())
baseApi := v1.ApiGroupApp.BaseApi
{
withRecordRouter.POST("", baseApi.Register)
withRecordRouter.POST("/del", baseApi.DeleteUser)
userRouter.POST("/search", baseApi.PageUsers)
userRouter.GET(":id", baseApi.GetUserInfo)
userRouter.PUT(":id", baseApi.UpdateUser)
}
}