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
21 lines
740 B
package router
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"main/controller/api"
|
|
"main/middleware"
|
|
)
|
|
|
|
func InitApiRouter(Router *gin.Engine) {
|
|
ApiRouter := Router.Group("api").Use(middleware.JWTAuth())
|
|
{
|
|
ApiRouter.POST("createApi", api.CreateApi) //创建Api
|
|
ApiRouter.POST("deleteApi", api.DeleteApi) //删除Api
|
|
ApiRouter.POST("setAuthAndApi",api.SetAuthAndApi) // 设置api和角色关系
|
|
ApiRouter.POST("getApiList",api.GetApiList) //获取Api列表
|
|
ApiRouter.POST("getApiById",api.GetApiById) //获取单条Api消息
|
|
ApiRouter.POST("updataApi",api.UpdataApi) //更新api
|
|
ApiRouter.POST("getAllApis",api.GetAllApis) // 获取所有api
|
|
ApiRouter.POST("getAuthAndApi",api.GetAuthAndApi) // 获取api和auth关系
|
|
}
|
|
}
|