feat: now server part supports multiple channels for the same type (#50)

This commit is contained in:
JustSong
2023-05-05 10:43:56 +08:00
parent b291ed43ca
commit 3a8d625201
21 changed files with 601 additions and 298 deletions
+10
View File
@@ -64,6 +64,16 @@ func SetApiRouter(router *gin.Engine) {
messageRoute.DELETE("/", middleware.RootAuth(), controller.DeleteAllMessages)
messageRoute.DELETE("/:id", middleware.UserAuth(), controller.DeleteMessage)
}
channelRoute := apiRouter.Group("/token")
channelRoute.Use(middleware.UserAuth())
{
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)
}
}
pushRouter := router.Group("/push")
pushRouter.Use(middleware.GlobalAPIRateLimit())