From f3b8d1e0576b095894f54d1361443a5f605a0e69 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 29 Aug 2023 15:13:25 +0800 Subject: [PATCH] fix --- .../internal/logic/ws_render_image.go | 27 +++++++------------ utils/websocket_data/render_data.go | 1 - 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index 1b00ded8..a4c4c3ee 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -37,7 +37,6 @@ type renderImageControlChanItem struct { // 渲染任务属性 type renderTask struct { renderId string //渲染id(新增任务传) - combineImage string //刀版图(新增任务传) combineTakesTime int64 //合刀版图耗时 uploadCombineImageTakesTime int64 //上传刀版图耗时 unityRenderBeginTime int64 //发送给unity时间 @@ -188,13 +187,13 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) { logx.Error("合成刀版图失败,合成的刀版图是空指针:", err) return } - logx.Info("合成刀版图成功,合成刀版图数据:", combineReq, ",logo图片:", renderImageData.RenderData.Logo, " 刀版图:", *res.ResourceUrl) - //如果是传入了指定尺寸,则直接返回刀版图 + //发送合图结果消息 + w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_COMBINE_IMAGE, websocket_data.CombineImageRspMsg{ + RenderId: renderImageData.RenderId, + CombineImage: combineImage, + })) + //如果是传入了指定尺寸,则不走unity if renderImageData.RenderData.SizeId > 0 { - w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_COMBINE_IMAGE, websocket_data.CombineImageRspMsg{ - RenderId: renderImageData.RenderId, - CombineImage: combineImage, - })) return } //获取唯一id @@ -210,9 +209,8 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) { } else { //返回给客户端 b := w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{ - RenderId: renderImageData.RenderId, - Image: *resource.ResourceUrl, - CombineImage: combineImage, + RenderId: renderImageData.RenderId, + Image: *resource.ResourceUrl, RenderProcessTime: websocket_data.RenderProcessTime{ CombineTakesTime: "cache", UnityRenderTakesTime: "cache", @@ -238,7 +236,6 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) { taskProperty: renderTask{ combineTakesTime: res.DiffTimeLogoCombine, uploadCombineImageTakesTime: res.DiffTimeUploadFile, - combineImage: combineImage, }, }) //组装数据 @@ -464,9 +461,8 @@ func (w *wsConnectItem) operationRenderTask() { } //发送到出口 w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{ - RenderId: taskData.renderId, - Image: data.renderNotifyImageUrl, - CombineImage: taskData.combineImage, + RenderId: taskData.renderId, + Image: data.renderNotifyImageUrl, RenderProcessTime: websocket_data.RenderProcessTime{ CombineTakesTime: CombineTakesTime, UnityRenderTakesTime: UnityRenderTakesTime, @@ -504,9 +500,6 @@ func (w *wsConnectItem) operationRenderTask() { if data.taskProperty.unityRenderEndTime != 0 { taskData.unityRenderEndTime = data.taskProperty.unityRenderEndTime } - if data.taskProperty.combineImage != "" { - taskData.combineImage = data.taskProperty.combineImage - } } } } diff --git a/utils/websocket_data/render_data.go b/utils/websocket_data/render_data.go index 11d6b2f2..3b2f7065 100644 --- a/utils/websocket_data/render_data.go +++ b/utils/websocket_data/render_data.go @@ -30,7 +30,6 @@ type RenderData struct { type RenderImageRspMsg struct { RenderId string `json:"render_id"` //渲染id Image string `json:"image"` //渲染结果图片 - CombineImage string `json:"combine_image"` //刀版图 RenderProcessTime RenderProcessTime `json:"render_process_time"` //流程耗时 } type RenderProcessTime struct {