添加websocket连接

This commit is contained in:
2025-08-10 05:57:51 +08:00
parent 313eb98cbc
commit f41a1a02d6
4 changed files with 65 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package router
import (
"github.com/gin-gonic/gin"
"toutoukan/controllers/user"
"toutoukan/socket"
)
func SetupRouter() *gin.Engine {
@@ -12,6 +13,9 @@ func SetupRouter() *gin.Engine {
{
apiGroup.POST("/login", user.UserLogin)
}
r.GET("/socket", func(c *gin.Context) {
socket.WebsocketHandler(c)
})
return r
}