package system

import (
	"kra/internal/server/middleware"

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

type MenuRouter struct{}

func (r *MenuRouter) InitMenuRouter(Router *gin.RouterGroup) {
	menuRouter := Router.Group("menu").Use(middleware.OperationRecordMiddleware())
	menuRouterWithoutRecord := Router.Group("menu")
	{
		menuRouter.POST("addBaseMenu", menuApi.AddBaseMenu)
		menuRouter.POST("addMenuAuthority", menuApi.AddMenuAuthority)
		menuRouter.POST("deleteBaseMenu", menuApi.DeleteBaseMenu)
		menuRouter.POST("updateBaseMenu", menuApi.UpdateBaseMenu)
	}
	{
		menuRouterWithoutRecord.POST("getMenu", menuApi.GetMenu)
		menuRouterWithoutRecord.POST("getMenuList", menuApi.GetMenuList)
		menuRouterWithoutRecord.POST("getBaseMenuTree", menuApi.GetBaseMenuTree)
		menuRouterWithoutRecord.POST("getMenuAuthority", menuApi.GetMenuAuthority)
		menuRouterWithoutRecord.POST("getBaseMenuById", menuApi.GetBaseMenuById)
	}
}
