Channel API done without verification

This commit is contained in:
JustSong
2023-04-22 22:02:59 +08:00
parent af96007025
commit 6164829239
5 changed files with 115 additions and 124 deletions

View File

@@ -54,13 +54,15 @@ func SetApiRouter(router *gin.Engine) {
optionRoute.GET("/", controller.GetOptions)
optionRoute.PUT("/", controller.UpdateOption)
}
fileRoute := apiRouter.Group("/file")
fileRoute.Use(middleware.AdminAuth())
channelRoute := apiRouter.Group("/channel")
channelRoute.Use(middleware.AdminAuth())
{
fileRoute.GET("/", controller.GetAllChannels)
fileRoute.GET("/search", controller.SearchChannels)
fileRoute.POST("/", middleware.UploadRateLimit(), controller.UploadFile)
fileRoute.DELETE("/:id", controller.DeleteFile)
channelRoute.GET("/", controller.GetAllChannels)
channelRoute.GET("/search", controller.SearchChannels)
channelRoute.GET("/:id", controller.GetChannel)
channelRoute.POST("/", controller.AddChannel)
channelRoute.PUT("/", controller.UpdateChannel)
channelRoute.DELETE("/:id", controller.DeleteChannel)
}
}
}