sys_menu.go 1.3 KB

1234567891011121314151617181920212223242526272829
  1. package system
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "lc-base-frame/api/v1"
  5. "lc-base-frame/middleware"
  6. )
  7. type MenuRouter struct{}
  8. func (s *MenuRouter) InitMenuRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
  9. menuRouter := Router.Group("menu").Use(middleware.OperationRecord())
  10. menuRouterWithoutRecord := Router.Group("menu")
  11. authorityMenuApi := v1.ApiGroupApp.SystemApiGroup.AuthorityMenuApi
  12. {
  13. menuRouter.POST("addBaseMenu", authorityMenuApi.AddBaseMenu) // 新增菜单
  14. menuRouter.POST("addMenuAuthority", authorityMenuApi.AddMenuAuthority) // 增加menu和角色关联关系
  15. menuRouter.POST("deleteBaseMenu", authorityMenuApi.DeleteBaseMenu) // 删除菜单
  16. menuRouter.POST("updateBaseMenu", authorityMenuApi.UpdateBaseMenu) // 更新菜单
  17. }
  18. {
  19. menuRouterWithoutRecord.POST("getMenu", authorityMenuApi.GetMenu) // 获取菜单树
  20. menuRouterWithoutRecord.POST("getMenuList", authorityMenuApi.GetMenuList) // 分页获取基础menu列表
  21. menuRouterWithoutRecord.POST("getBaseMenuTree", authorityMenuApi.GetBaseMenuTree) // 获取用户动态路由
  22. menuRouterWithoutRecord.POST("getMenuAuthority", authorityMenuApi.GetMenuAuthority) // 获取指定角色menu
  23. menuRouterWithoutRecord.POST("getBaseMenuById", authorityMenuApi.GetBaseMenuById) // 根据id获取菜单
  24. }
  25. return menuRouter
  26. }