sys_casbin.go 546 B

123456789101112131415161718192021
  1. package system
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "lcfns/api/v1"
  5. "lcfns/middleware"
  6. )
  7. type CasbinRouter struct{}
  8. func (s *CasbinRouter) InitCasbinRouter(Router *gin.RouterGroup) {
  9. casbinRouter := Router.Group("casbin").Use(middleware.OperationRecord())
  10. casbinRouterWithoutRecord := Router.Group("casbin")
  11. casbinApi := v1.ApiGroupApp.SystemApiGroup.CasbinApi
  12. {
  13. casbinRouter.POST("updateCasbin", casbinApi.UpdateCasbin)
  14. }
  15. {
  16. casbinRouterWithoutRecord.POST("getPolicyPathByAuthorityId", casbinApi.GetPolicyPathByAuthorityId)
  17. }
  18. }