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.

21 lines
740 B

  1. package router
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "main/controller/api"
  5. "main/middleware"
  6. )
  7. func InitApiRouter(Router *gin.Engine) {
  8. ApiRouter := Router.Group("api").Use(middleware.JWTAuth())
  9. {
  10. ApiRouter.POST("createApi", api.CreateApi) //创建Api
  11. ApiRouter.POST("deleteApi", api.DeleteApi) //删除Api
  12. ApiRouter.POST("setAuthAndApi",api.SetAuthAndApi) // 设置api和角色关系
  13. ApiRouter.POST("getApiList",api.GetApiList) //获取Api列表
  14. ApiRouter.POST("getApiById",api.GetApiById) //获取单条Api消息
  15. ApiRouter.POST("updataApi",api.UpdataApi) //更新api
  16. ApiRouter.POST("getAllApis",api.GetAllApis) // 获取所有api
  17. ApiRouter.POST("getAuthAndApi",api.GetAuthAndApi) // 获取api和auth关系
  18. }
  19. }