This commit is contained in:
laodaming 2023-08-07 13:17:23 +08:00
parent 7510b363d6
commit e9c5e96c52
3 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
Name: render Name: render
Host: 0.0.0.0 Host: 0.0.0.0
Port: 8888 Port: 9919
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth: Auth:
AccessSecret: fusen2023 AccessSecret: fusen2023

View File

@ -270,9 +270,10 @@ func (w *wsConnectItem) dealwithReciveData(data []byte) {
d, _ := json.Marshal(parseInfo.D) d, _ := json.Marshal(parseInfo.D)
//分消息类型给到不同逻辑处理,可扩展 //分消息类型给到不同逻辑处理,可扩展
switch parseInfo.T { switch parseInfo.T {
//图片渲染数据组装 //图片渲染
case constants.WEBSOCKET_RENDER_IMAGE_ASSEMBLE: case constants.WEBSOCKET_RENDER_IMAGE:
w.assembleRenderData(d) //数据组装
w.renderImage(d)
default: default:
} }

View File

@ -22,7 +22,7 @@ type renderImageControlChanItem struct {
} }
// 渲染发送到组装数据组装数据 // 渲染发送到组装数据组装数据
func (w *wsConnectItem) assembleRenderData(data []byte) { func (w *wsConnectItem) renderImage(data []byte) {
var renderImageData websocket_data.RenderImageReqMsg var renderImageData websocket_data.RenderImageReqMsg
if err := json.Unmarshal(data, &renderImageData); err != nil { if err := json.Unmarshal(data, &renderImageData); err != nil {
w.outChan <- w.respondDataFormat(constants.WEBSOCKET_ERR_DATA_FORMAT, "invalid format of websocket render image message:"+string(data)) w.outChan <- w.respondDataFormat(constants.WEBSOCKET_ERR_DATA_FORMAT, "invalid format of websocket render image message:"+string(data))