From 164c737dd35c5520651f2370b9a46d4241c50756 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 28 Jul 2023 10:20:35 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/datatransferlogic.go | 4 ++-- server/websocket/internal/logic/ws_render_image_logic.go | 2 +- server/websocket/internal/types/types.go | 3 +++ server_api/websocket.api | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/server/websocket/internal/logic/datatransferlogic.go b/server/websocket/internal/logic/datatransferlogic.go index e14a687a..44ba0abb 100644 --- a/server/websocket/internal/logic/datatransferlogic.go +++ b/server/websocket/internal/logic/datatransferlogic.go @@ -245,8 +245,8 @@ func (w *wsConnectItem) sendToOutChan(data []byte) { } // 获取需要渲染图片的map key -func (w *wsConnectItem) getRenderImageMapKey(productId, templateTagId int64, algorithmVersion string) string { - return fmt.Sprintf("%d-%d-%s", productId, templateTagId, algorithmVersion) +func (w *wsConnectItem) getRenderImageMapKey(productId, templateTagId, logoId int64, algorithmVersion string) string { + return fmt.Sprintf("%d-%d-%d-%s", productId, templateTagId, logoId, algorithmVersion) } // 格式化返回数据 diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index 1f1c6557..d58def77 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -54,7 +54,7 @@ func (w *wsConnectItem) SendToCloudRender(data []byte) { return default: //加入渲染任务 - key := w.getRenderImageMapKey(productId, renderImageData.TemplateTagId, renderImageData.AlgorithmVersion) + key := w.getRenderImageMapKey(productId, renderImageData.TemplateTagId, renderImageData.LogoId, renderImageData.AlgorithmVersion) w.renderProperty.renderImageTaskCtlChan <- renderImageControlChanItem{ Option: 1, //0删除 1添加 Key: key, diff --git a/server/websocket/internal/types/types.go b/server/websocket/internal/types/types.go index dbeff4db..901b8123 100644 --- a/server/websocket/internal/types/types.go +++ b/server/websocket/internal/types/types.go @@ -13,6 +13,7 @@ type DataTransferData struct { type RenderImageReqMsg struct { ProductIds []int64 `json:"product_ids"` //产品 id TemplateTagId int64 `json:"template_tag_id"` //模板标签id + LogoId int64 `json:"logo_id"` //logoid AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本 } @@ -20,6 +21,7 @@ type RenderImageRspMsg struct { ProductId int64 `json:"product_id"` //产品 id TemplateTagId int64 `json:"template_tag_id"` //模板标签id AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本 + LogoId int64 `json:"logo_id"` //logoid Image string `json:"image"` //渲染后的图片 } @@ -37,6 +39,7 @@ type NotifyInfo struct { ProductId int64 `json:"product_id"` //产品id TemplateTagId int64 `json:"template_tag_id"` //模板标签id AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本 + LogoId int64 `json:"logo_id"` //logoid Image string `json:"image"` } diff --git a/server_api/websocket.api b/server_api/websocket.api index 379f3e45..e24e2874 100644 --- a/server_api/websocket.api +++ b/server_api/websocket.api @@ -28,12 +28,14 @@ type DataTransferData { type RenderImageReqMsg { //websocket接受要云渲染处理的数据 ProductIds []int64 `json:"product_ids"` //产品 id TemplateTagId int64 `json:"template_tag_id"` //模板标签id + LogoId int64 `json:"logo_id"` //logoid AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本 } type RenderImageRspMsg { //websocket发送渲染完的数据 ProductId int64 `json:"product_id"` //产品 id TemplateTagId int64 `json:"template_tag_id"` //模板标签id AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本 + LogoId int64 `json:"logo_id"` //logoid Image string `json:"image"` //渲染后的图片 } type ThirdPartyLoginRspMsg { //websocket三方登录的通知数据 @@ -49,6 +51,7 @@ type NotifyInfo { ProductId int64 `json:"product_id"` //产品id TemplateTagId int64 `json:"template_tag_id"` //模板标签id AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本 + LogoId int64 `json:"logo_id"` //logoid Image string `json:"image"` } //第三方登录通知接口