You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.0 KiB

3 years ago
3 years ago
3 years ago
  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 ApiRouter struct{}
  8. func (s *ApiRouter) InitApiRouter(Router *gin.RouterGroup) {
  9. apiRouter := Router.Group("api").Use(middleware.OperationRecord())
  10. apiRouterWithoutRecord := Router.Group("api")
  11. apiRouterApi := v1.ApiGroupApp.SystemApiGroup.SystemApiApi
  12. {
  13. apiRouter.POST("createApi", apiRouterApi.CreateApi) // 创建Api
  14. apiRouter.POST("deleteApi", apiRouterApi.DeleteApi) // 删除Api
  15. apiRouter.POST("getApiById", apiRouterApi.GetApiById) // 获取单条Api消息
  16. apiRouter.POST("updateApi", apiRouterApi.UpdateApi) // 更新api
  17. apiRouter.DELETE("deleteApisByIds", apiRouterApi.DeleteApisByIds) // 删除选中api
  18. }
  19. {
  20. apiRouterWithoutRecord.POST("getAllApis", apiRouterApi.GetAllApis) // 获取所有api
  21. apiRouterWithoutRecord.POST("getApiList", apiRouterApi.GetApiList) // 获取Api列表
  22. }
  23. }