package system

import (
	"kra/internal/server/middleware"

	"github.com/gin-gonic/gin"
)

type UserRouter struct{}

func (r *UserRouter) InitUserRouter(Router *gin.RouterGroup) {
	userRouter := Router.Group("user").Use(middleware.OperationRecordMiddleware())
	userRouterWithoutRecord := Router.Group("user")
	{
		userRouter.POST("admin_register", userApi.Register)
		userRouter.POST("changePassword", userApi.ChangePassword)
		userRouter.POST("setUserAuthority", userApi.SetUserAuthority)
		userRouter.DELETE("deleteUser", userApi.DeleteUser)
		userRouter.PUT("setUserInfo", userApi.SetUserInfo)
		userRouter.PUT("setSelfInfo", userApi.SetSelfInfo)
		userRouter.POST("setUserAuthorities", userApi.SetUserAuthorities)
		userRouter.POST("resetPassword", userApi.ResetPassword)
		userRouter.PUT("setSelfSetting", userApi.SetSelfSetting)
	}
	{
		userRouterWithoutRecord.POST("getUserList", userApi.GetUserList)
		userRouterWithoutRecord.GET("getUserInfo", userApi.GetUserInfo)
	}
}
