2024-10-14 13:49:16 +08:00

26 lines
555 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package websocket
import (
serviceWs "catface/app/service/websocket"
"github.com/gin-gonic/gin"
)
/**
websocket 想要了解更多具体细节请参见以下文档
文档地址https://github.com/gorilla/websocket/tree/master/examples
*/
type Ws struct {
}
// OnOpen 主要解决握手+协议升级
func (w *Ws) OnOpen(context *gin.Context) (*serviceWs.Ws, bool) {
return (&serviceWs.Ws{}).OnOpen(context)
}
// OnMessage 处理业务消息
func (w *Ws) OnMessage(serviceWs *serviceWs.Ws, context *gin.Context) {
serviceWs.OnMessage(context)
}