123456789101112131415161718192021222324252627282930 |
- package system
- import (
- "github.com/gin-gonic/gin"
- v1 "lc-fangdaosha/api/v1"
- "lc-fangdaosha/middleware"
- )
- type ApiRouter struct{}
- func (s *ApiRouter) InitApiRouter(Router, PubPouter *gin.RouterGroup) {
- apiRouter := Router.Group("api").Use(middleware.OperationRecord())
- apiRouterWithoutRecord := Router.Group("api")
- apiPubRouterWithoutRecord := PubPouter.Group("api")
- apiRouterApi := v1.ApiGroupApp.SystemApiGroup.SystemApiApi
- {
- apiRouter.POST("createApi", apiRouterApi.CreateApi) // 创建Api
- apiRouter.POST("deleteApi", apiRouterApi.DeleteApi) // 删除Api
- apiRouter.POST("getApiById", apiRouterApi.GetApiById) // 获取单条Api消息
- apiRouter.POST("updateApi", apiRouterApi.UpdateApi) // 更新api
- apiRouter.DELETE("deleteApisByIds", apiRouterApi.DeleteApisByIds) // 删除选中api
- }
- {
- apiRouterWithoutRecord.POST("getAllApis", apiRouterApi.GetAllApis) // 获取所有api
- apiRouterWithoutRecord.POST("getApiList", apiRouterApi.GetApiList) // 获取Api列表
- }
- {
- apiPubRouterWithoutRecord.GET("freshCasbin", apiRouterApi.FreshCasbin)
- }
- }
|