sys_menu.go 1.3 KB

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