From 72a26c07f28163b483da31b120b005cb7a590af8 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Mon, 28 Aug 2023 19:00:08 +0800 Subject: [PATCH] fix --- .../internal/logic/ws_render_image.go | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index f1a9e67d..d211228a 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -29,7 +29,6 @@ type extendRenderProperty struct { type renderImageControlChanItem struct { option int // 0删除 1添加 2修改耗时属性 taskId string //map的key(必须传) - combineImage string //刀版图地址(增加任务时候传) renderId string // map的val(增加任务时候传) renderNotifyImageUrl string //渲染回调数据(删除任务时候传) taskProperty renderTask //渲染任务的属性 @@ -37,7 +36,8 @@ type renderImageControlChanItem struct { // 渲染任务属性 type renderTask struct { - renderId string //渲染id(前端传的) + renderId string //渲染id(新增任务传) + combineImage string //刀版图(新增任务传) combineTakesTime int64 //合刀版图耗时 uploadCombineImageTakesTime int64 //上传刀版图耗时 unityRenderBeginTime int64 //发送给unity时间 @@ -218,10 +218,12 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) { //########################################### //把需要渲染的图片任务加进去 w.createRenderTask(renderImageControlChanItem{ - option: 1, //0删除 1添加 2修改耗时属性 - taskId: taskId, - renderId: renderImageData.RenderId, - combineImage: combineImage, + option: 1, //0删除 1添加 2修改耗时属性 + taskId: taskId, + renderId: renderImageData.RenderId, + taskProperty: renderTask{ + combineImage: combineImage, + }, }) //组装数据 if err = w.assembleRenderData(taskId, combineImage, renderImageData, productTemplate, model3dInfo, element, productFirstSize); err != nil { @@ -448,7 +450,7 @@ func (w *wsConnectItem) operationRenderTask() { w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{ RenderId: taskData.renderId, Image: data.renderNotifyImageUrl, - CombineImage: data.combineImage, + CombineImage: data.taskProperty.combineImage, RenderProcessTime: websocket_data.RenderProcessTime{ CombineTakesTime: CombineTakesTime, UnityRenderTakesTime: UnityRenderTakesTime, @@ -461,8 +463,10 @@ func (w *wsConnectItem) operationRenderTask() { delete(w.extendRenderProperty.renderImageTask, data.taskId) case 1: //新增任务 w.extendRenderProperty.renderImageTask[data.taskId] = &renderTask{ - renderId: data.renderId, + renderId: data.renderId, + combineImage: data.taskProperty.combineImage, } + case 2: //修改(耗时)属性 if taskData, ok := w.extendRenderProperty.renderImageTask[data.taskId]; ok { //合图耗时