29 lines
883 B
Go
29 lines
883 B
Go
package router
|
|
|
|
import (
|
|
"kra/app/system/internal/transport/handler"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func RegisterAPI(group, public *gin.RouterGroup, engine *gin.Engine, h *handler.API) {
|
|
api := group.Group("/api")
|
|
api.POST("/getApiList", h.List)
|
|
api.POST("/getAllApis", h.All)
|
|
api.POST("/createApi", h.Create)
|
|
api.POST("/updateApi", h.Update)
|
|
api.POST("/deleteApi", h.Delete)
|
|
api.DELETE("/deleteApisByIds", h.DeleteByIDs)
|
|
api.POST("/getApiById", h.Find)
|
|
api.GET("/getApiGroups", h.Groups)
|
|
api.GET("/getApiRoles", h.Roles)
|
|
api.POST("/setApiRoles", h.SetRoles)
|
|
api.GET("/syncApi", h.Sync(engine))
|
|
api.POST("/ignoreApi", h.Ignore)
|
|
api.POST("/enterSyncApi", h.ApplySync)
|
|
public.Group("/api").GET("/freshCasbin", h.FreshCasbin)
|
|
casbin := group.Group("/casbin")
|
|
casbin.POST("/updateCasbin", h.SetPolicyPaths)
|
|
casbin.POST("/getPolicyPathByAuthorityId", h.PolicyPaths)
|
|
}
|