整合目前新的详情接口
This commit is contained in:
parent
ea1335607a
commit
68a31236b3
|
@ -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),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"`
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user