mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-04-22 19:14:29 +08:00
重构路由注册功能
This commit is contained in:
@@ -39,6 +39,12 @@ func NewRealtimeHandler(server *core.AppServer, db *gorm.DB, userService *servic
|
||||
return &RealtimeHandler{BaseHandler: BaseHandler{App: server, DB: db}, userService: userService}
|
||||
}
|
||||
|
||||
// RegisterRoutes 注册路由
|
||||
func (h *RealtimeHandler) RegisterRoutes() {
|
||||
h.App.Engine.Any("/api/realtime", h.Connection)
|
||||
h.App.Engine.POST("/api/realtime/voice", h.VoiceChat)
|
||||
}
|
||||
|
||||
func (h *RealtimeHandler) Connection(c *gin.Context) {
|
||||
// 获取客户端请求中指定的子协议
|
||||
clientProtocols := c.GetHeader("Sec-WebSocket-Protocol")
|
||||
|
||||
Reference in New Issue
Block a user