sys_api.go 1.1 KB

123456789101112131415161718192021222324252627282930
  1. package system
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "lc-fangdaosha/api/v1"
  5. "lc-fangdaosha/middleware"
  6. )
  7. type ApiRouter struct{}
  8. func (s *ApiRouter) InitApiRouter(Router, PubPouter *gin.RouterGroup) {
  9. apiRouter := Router.Group("api").Use(middleware.OperationRecord())
  10. apiRouterWithoutRecord := Router.Group("api")
  11. apiPubRouterWithoutRecord := PubPouter.Group("api")
  12. apiRouterApi := v1.ApiGroupApp.SystemApiGroup.SystemApiApi
  13. {
  14. apiRouter.POST("createApi", apiRouterApi.CreateApi) // 创建Api
  15. apiRouter.POST("deleteApi", apiRouterApi.DeleteApi) // 删除Api
  16. apiRouter.POST("getApiById", apiRouterApi.GetApiById) // 获取单条Api消息
  17. apiRouter.POST("updateApi", apiRouterApi.UpdateApi) // 更新api
  18. apiRouter.DELETE("deleteApisByIds", apiRouterApi.DeleteApisByIds) // 删除选中api
  19. }
  20. {
  21. apiRouterWithoutRecord.POST("getAllApis", apiRouterApi.GetAllApis) // 获取所有api
  22. apiRouterWithoutRecord.POST("getApiList", apiRouterApi.GetApiList) // 获取Api列表
  23. }
  24. {
  25. apiPubRouterWithoutRecord.GET("freshCasbin", apiRouterApi.FreshCasbin)
  26. }
  27. }