sys_casbin.go 561 B

12345678910111213141516171819
  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 CasbinRouter struct {
  8. }
  9. func (s *CasbinRouter) InitCasbinRouter(Router *gin.RouterGroup) {
  10. casbinRouter := Router.Group("casbin").Use(middleware.OperationRecord())
  11. var casbinApi = v1.ApiGroupApp.SystemApiGroup.CasbinApi
  12. {
  13. casbinRouter.POST("updateCasbin", casbinApi.UpdateCasbin)
  14. casbinRouter.POST("getPolicyPathByAuthorityId", casbinApi.GetPolicyPathByAuthorityId)
  15. }
  16. }