feat: user & article: dev complete
This commit is contained in:
@@ -8,15 +8,16 @@ import (
|
||||
func articlePrivateRouter(router *gin.RouterGroup) {
|
||||
articleRouter := router.Group("/article")
|
||||
{
|
||||
articleRouter.POST("/:id", handler.SaveArticleHandler)
|
||||
articleRouter.DELETE("/:id", handler.DeleteArticleHandler)
|
||||
articleRouter.POST("/:id/publish", handler.PublishArticleHandler)
|
||||
}
|
||||
}
|
||||
|
||||
func articlePublicRouter(router *gin.RouterGroup) {
|
||||
articleRouter := router.Group("/article")
|
||||
{
|
||||
articleRouter.POST("", handler.SaveArticleHandler)
|
||||
articleRouter.GET("/list", handler.GetAllArticlesHandler)
|
||||
articleRouter.DELETE("/:id", handler.DeleteArticleHandler)
|
||||
articleRouter.GET("/:id", handler.GetArticleHandler)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,10 +14,12 @@ func BusiRouter() {
|
||||
{
|
||||
statisticRouter(publicRouter)
|
||||
articlePublicRouter(publicRouter)
|
||||
userPublicRouter(publicRouter)
|
||||
}
|
||||
|
||||
// Private
|
||||
{
|
||||
articlePrivateRouter(privateRouter)
|
||||
userPrivateRouter(privateRouter)
|
||||
}
|
||||
}
|
||||
|
||||
24
router/user.go
Normal file
24
router/user.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"nCovTrack-Backend/handler"
|
||||
)
|
||||
|
||||
func userPublicRouter(router *gin.RouterGroup) {
|
||||
userRouter := router.Group("/user")
|
||||
{
|
||||
userRouter.POST("/register", handler.UserRegisterHandler)
|
||||
userRouter.POST("/login", handler.UserLoginHandler)
|
||||
userRouter.GET("/code/:email", handler.SendEmailCodeHandler)
|
||||
userRouter.GET("/code/:email/:code", handler.VerifyEmailCodeHandler)
|
||||
userRouter.POST("/chpwd", handler.ChangePasswordHandler)
|
||||
}
|
||||
}
|
||||
func userPrivateRouter(router *gin.RouterGroup) {
|
||||
userRouter := router.Group("/user")
|
||||
{
|
||||
userRouter.POST("/approve", handler.UserApproveHandler)
|
||||
userRouter.GET("/registers", handler.ListRegisterUserHandler)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user