mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
25 lines
684 B
Go
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)
|
|
}
|
|
}
|