feat: channel email is done

This commit is contained in:
JustSong
2022-11-11 17:24:03 +08:00
parent f1d5d9c8d1
commit e1d09aa58f
15 changed files with 196 additions and 67 deletions

View File

@@ -28,7 +28,7 @@ func SetApiRouter(router *gin.Engine) {
userRoute.GET("/logout", controller.Logout)
selfRoute := userRoute.Group("/")
selfRoute.Use(middleware.UserAuth(), middleware.NoTokenAuth())
selfRoute.Use(middleware.UserAuth())
{
selfRoute.GET("/self", controller.GetSelf)
selfRoute.PUT("/self", controller.UpdateSelf)
@@ -37,7 +37,7 @@ func SetApiRouter(router *gin.Engine) {
}
adminRoute := userRoute.Group("/")
adminRoute.Use(middleware.AdminAuth(), middleware.NoTokenAuth())
adminRoute.Use(middleware.AdminAuth())
{
adminRoute.GET("/", controller.GetAllUsers)
adminRoute.GET("/search", controller.SearchUsers)
@@ -49,7 +49,7 @@ func SetApiRouter(router *gin.Engine) {
}
}
optionRoute := apiRouter.Group("/option")
optionRoute.Use(middleware.RootAuth(), middleware.NoTokenAuth())
optionRoute.Use(middleware.RootAuth())
{
optionRoute.GET("/", controller.GetOptions)
optionRoute.PUT("/", controller.UpdateOption)
@@ -61,4 +61,10 @@ func SetApiRouter(router *gin.Engine) {
fileRoute.DELETE("/:id", middleware.UserAuth(), controller.DeleteFile)
}
}
pushRouter := router.Group("/push")
pushRouter.Use(middleware.GlobalAPIRateLimit())
{
pushRouter.GET("/:username", controller.GetPushMessage)
pushRouter.POST("/:username", controller.PostPushMessage)
}
}