fix: model token creation issue

This commit is contained in:
ckt1031 2023-07-14 23:29:11 +08:00
parent 1c7bad7b87
commit 455643e317

View File

@ -62,11 +62,13 @@ func SetApiRouter(router *gin.Engine) {
optionRoute.PUT("/", controller.UpdateOption)
}
channelRoute := apiRouter.Group("/channel")
channelRoute.Use(middleware.UserAuth()).GET("/models", controller.ListModels)
channelRoute.Use(middleware.AdminAuth())
{
channelRoute.GET("/", controller.GetAllChannels)
channelRoute.GET("/search", controller.SearchChannels)
channelRoute.GET("/models", controller.ListModels)
channelRoute.GET("/:id", controller.GetChannel)
channelRoute.GET("/test", controller.TestAllChannels)
channelRoute.GET("/test/:id", controller.TestChannel)
@ -76,6 +78,7 @@ func SetApiRouter(router *gin.Engine) {
channelRoute.PUT("/", controller.UpdateChannel)
channelRoute.DELETE("/:id", controller.DeleteChannel)
}
tokenRoute := apiRouter.Group("/token")
tokenRoute.Use(middleware.UserAuth())
{