整合目前新的详情接口

This commit is contained in:
laodaming 2023-10-17 15:40:44 +08:00
parent ea1335607a
commit 68a31236b3
3 changed files with 16 additions and 0 deletions

View File

@ -27,6 +27,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/api/websocket/common_notify", Path: "/api/websocket/common_notify",
Handler: CommonNotifyHandler(serverCtx), Handler: CommonNotifyHandler(serverCtx),
}, },
{
Method: http.MethodPost,
Path: "/api/websocket/close_websocket",
Handler: CloseWebsocketHandler(serverCtx),
},
}, },
) )
} }

View File

@ -25,6 +25,10 @@ type CommonNotifyReq struct {
Data map[string]interface{} `json:"data"` //后端与前端约定好的数据 Data map[string]interface{} `json:"data"` //后端与前端约定好的数据
} }
type CloseWebsocketReq struct {
Wid string `json:"wid"`
}
type Request struct { type Request struct {
} }

View File

@ -18,6 +18,9 @@ service websocket {
//通用回调接口 //通用回调接口
@handler CommonNotifyHandler @handler CommonNotifyHandler
post /api/websocket/common_notify(CommonNotifyReq) returns (response); post /api/websocket/common_notify(CommonNotifyReq) returns (response);
//关闭某个连接
@handler CloseWebsocketHandler
post /api/websocket/close_websocket(CloseWebsocketReq) returns (response);
} }
//websocket数据交互[ //websocket数据交互[
@ -40,3 +43,7 @@ type CommonNotifyReq {
GuestId int64 `json:"guest_id,optional"` //游客id GuestId int64 `json:"guest_id,optional"` //游客id
Data map[string]interface{} `json:"data"` //后端与前端约定好的数据 Data map[string]interface{} `json:"data"` //后端与前端约定好的数据
} }
//关闭连接
type CloseWebsocketReq {
Wid string `json:"wid"`
}