添加用户评论功能

This commit is contained in:
JACKYMYPERSON
2025-09-25 18:17:41 +08:00
parent 0006b61809
commit 5412122b48
4 changed files with 340 additions and 14 deletions

View File

@@ -1,17 +1,16 @@
package router
import (
"github.com/gin-gonic/gin"
"toutoukan/controllers/article"
"toutoukan/controllers/comments/getcomments"
"toutoukan/controllers/comments/publishComments"
"toutoukan/controllers/goods"
"toutoukan/controllers/kills"
"toutoukan/controllers/search"
"toutoukan/controllers/system"
"toutoukan/controllers/user"
"toutoukan/init/ratelimit"
"toutoukan/socket"
"toutoukan/utill/jwt"
"github.com/gin-gonic/gin"
)
func SetupRouter() *gin.Engine {
@@ -25,9 +24,9 @@ func SetupRouter() *gin.Engine {
apiGroup.POST("/getInfo", user.GetUserInfo)
}
r.GET("/socket", jwt.JWTAuthMiddleware(), func(c *gin.Context) {
socket.WebsocketHandler(c)
})
//r.GET("/socket", jwt.JWTAuthMiddleware(), func(c *gin.Context) {
// socket.WebsocketHandler(c)
//})
systemGroup := r.Group("/system")
{
systemGroup.POST("/sendMsg", system.SendMsg)
@@ -49,6 +48,11 @@ func SetupRouter() *gin.Engine {
{
goodsGroup.GET("/getgoodslist", goods.GetGoods)
}
commentGroup := r.Group("/comment")
{
commentGroup.POST("/get", getcomments.GetComments)
commentGroup.POST("/publish", publishComments.PublishComment)
}
return r
}