mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-05 16:56:22 +00:00
✨ feat: 添加评论功能,包括评论输入、评论列表和评论项组件,支持层级深度和私密评论
This commit is contained in:
@ -8,14 +8,14 @@ import (
|
||||
|
||||
func registerCommentRoutes(group *route.RouterGroup) {
|
||||
commentController := v1.NewCommentController()
|
||||
commentGroup := group.Group("/comments").Use(middleware.UseAuth(true))
|
||||
commentGroupWithoutAuth := group.Group("/comments").Use(middleware.UseAuth(false))
|
||||
commentGroup := group.Group("/comment").Use(middleware.UseAuth(true))
|
||||
commentGroupWithoutAuth := group.Group("/comment").Use(middleware.UseAuth(false))
|
||||
{
|
||||
commentGroup.POST("/c", commentController.CreateComment)
|
||||
commentGroup.PUT("/c/:id", commentController.UpdateComment)
|
||||
commentGroup.DELETE("/c/:id", commentController.DeleteComment)
|
||||
commentGroup.PUT("/c/:id/react", commentController.ReactComment) // 暂时先不写
|
||||
commentGroupWithoutAuth.GET("/c/:id", commentController.GetComment)
|
||||
commentGroupWithoutAuth.GET("/c/list", commentController.GetCommentList)
|
||||
commentGroupWithoutAuth.GET("/list", commentController.GetCommentList)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user