sys_authority.go 983 B

12345678910111213141516171819202122232425
  1. package system
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "lcfns/api/v1"
  5. "lcfns/middleware"
  6. )
  7. type AuthorityRouter struct{}
  8. func (s *AuthorityRouter) InitAuthorityRouter(Router *gin.RouterGroup) {
  9. authorityRouter := Router.Group("authority").Use(middleware.OperationRecord())
  10. authorityRouterWithoutRecord := Router.Group("authority")
  11. authorityApi := v1.ApiGroupApp.SystemApiGroup.AuthorityApi
  12. {
  13. authorityRouter.POST("createAuthority", authorityApi.CreateAuthority) // 创建角色
  14. authorityRouter.POST("deleteAuthority", authorityApi.DeleteAuthority) // 删除角色
  15. authorityRouter.PUT("updateAuthority", authorityApi.UpdateAuthority) // 更新角色
  16. authorityRouter.POST("copyAuthority", authorityApi.CopyAuthority) // 拷贝角色
  17. authorityRouter.POST("setDataAuthority", authorityApi.SetDataAuthority) // 设置角色资源权限
  18. }
  19. {
  20. authorityRouterWithoutRecord.POST("getAuthorityList", authorityApi.GetAuthorityList) // 获取角色列表
  21. }
  22. }