package service

import (
	"net/http"

	"be.ems/src/modules/ws/model"
	"github.com/gorilla/websocket"
)

// IWS WebSocket通信 服务层接口
type IWS interface {
	// UpgraderWs http升级ws请求
	UpgraderWs(w http.ResponseWriter, r *http.Request) *websocket.Conn

	// NewClient 新建客户端
	//
	// uid 登录用户ID
	// groupIDs 用户订阅组
	// conn ws连接实例
	// childConn 子连接实例
	NewClient(uid string, groupIDs []string, conn *websocket.Conn, childConn any) *model.WSClient

	// CloseClient 关闭客户端
	CloseClient(clientID string)
}
