添加向特定用户发送信息功能

This commit is contained in:
2025-08-11 15:35:52 +08:00
parent ba655a6aba
commit 23592df471
4 changed files with 150 additions and 26 deletions

View File

@@ -2,6 +2,7 @@ package router
import (
"github.com/gin-gonic/gin"
"toutoukan/controllers/system"
"toutoukan/controllers/test"
"toutoukan/controllers/user"
"toutoukan/socket"
@@ -16,9 +17,13 @@ func SetupRouter() *gin.Engine {
apiGroup.POST("/login", user.UserLogin)
apiGroup.POST("/test", utill.JWTAuthMiddleware(), test.Testjwt)
}
r.GET("/socket", func(c *gin.Context) {
r.GET("/socket", utill.JWTAuthMiddleware(), func(c *gin.Context) {
socket.WebsocketHandler(c)
})
systemGroup := r.Group("/system")
{
systemGroup.POST("/sendMsg", system.SendMsg)
}
return r
}