package router

import (
	"github.com/gin-gonic/gin"
	"kra/internal/server/handler"
)

func RegisterUser(group *gin.RouterGroup, h *handler.User) {
	user := group.Group("/user")
	user.POST("/getUserList", h.List)
	user.POST("/admin_register", h.Create)
	user.PUT("/setUserInfo", h.Update)
	user.PUT("/setSelfInfo", h.UpdateSelf)
	user.DELETE("/deleteUser", h.Delete)
	user.POST("/resetPassword", h.ResetPassword)
	user.POST("/changePassword", h.ChangePassword)
	user.PUT("/setSelfSetting", h.SetSelfSetting)
	user.POST("/setUserAuthorities", h.SetAuthorities)
	user.POST("/setUserAuthority", h.SwitchAuthority)
	user.GET("/getUserInfo", h.Get)
}

func RegisterNavigation(group *gin.RouterGroup, h *handler.Navigation) {
	group.Group("/menu").POST("/getMenu", h.Menu)
}

func RegisterSession(group *gin.RouterGroup, h *handler.Session) {
	group.Group("/jwt").POST("/jsonInBlacklist", h.Logout)
}
