From dc4c87b3234224600943710a7777073ce8c32697 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 16 Aug 2023 15:38:17 +0800 Subject: [PATCH 1/4] fix --- server/websocket/internal/logic/ws_render_image_logic.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index f5e592c5..44bc15ab 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -123,7 +123,7 @@ func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data.Re } }() //根据templateTag获取templateTagId(后续模板表的tag改成template_tag后可能就不需要这个步骤了) - templateTag, err := w.logic.svcCtx.AllModels.FsProductTemplateTags.FindOneByTagName(w.logic.ctx, info.RenderData.TemplateTag) + /*templateTag, err := w.logic.svcCtx.AllModels.FsProductTemplateTags.FindOneByTagName(w.logic.ctx, info.RenderData.TemplateTag) if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { logx.Error("can`t find template tag info by template tag:", info.RenderData.TemplateTag) @@ -131,9 +131,9 @@ func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data.Re } logx.Error("failed to get template tag info") return - } + }*/ //获取模板(模板标签下的对一个物料的的模板) - productTemplate, err := w.logic.svcCtx.AllModels.FsProductTemplateV2.FindOneByProductIdTagIdWithSizeTable(w.logic.ctx, info.RenderData.ProductId, fmt.Sprintf("%d", templateTag.Id)) + productTemplate, err := w.logic.svcCtx.AllModels.FsProductTemplateV2.FindOneByProductIdTagIdWithSizeTable(w.logic.ctx, info.RenderData.ProductId, "8" /*fmt.Sprintf("%d", templateTag.Id)*/) if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { logx.Error("template info is not found") From ca1faa7acea41919ddce419d36f1512b31bc7982 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 16 Aug 2023 15:39:14 +0800 Subject: [PATCH 2/4] fix --- server/websocket/internal/logic/ws_render_image_logic.go | 1 - 1 file changed, 1 deletion(-) diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index 44bc15ab..3589d74b 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -4,7 +4,6 @@ import ( "bytes" "encoding/json" "errors" - "fmt" "fusenapi/constants" "fusenapi/service/repositories" "fusenapi/utils/curl" From 2b05154fc4340c4ba2f4862b89a71a7c4c005ba6 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 16 Aug 2023 15:42:46 +0800 Subject: [PATCH 3/4] fix --- .../internal/logic/ws_render_image_logic.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index 3589d74b..244a81d8 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -121,18 +121,8 @@ func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data.Re logx.Error("assembleRenderData panic:", err) } }() - //根据templateTag获取templateTagId(后续模板表的tag改成template_tag后可能就不需要这个步骤了) - /*templateTag, err := w.logic.svcCtx.AllModels.FsProductTemplateTags.FindOneByTagName(w.logic.ctx, info.RenderData.TemplateTag) - if err != nil { - if errors.Is(err, gorm.ErrRecordNotFound) { - logx.Error("can`t find template tag info by template tag:", info.RenderData.TemplateTag) - return - } - logx.Error("failed to get template tag info") - return - }*/ - //获取模板(模板标签下的对一个物料的的模板) - productTemplate, err := w.logic.svcCtx.AllModels.FsProductTemplateV2.FindOneByProductIdTagIdWithSizeTable(w.logic.ctx, info.RenderData.ProductId, "8" /*fmt.Sprintf("%d", templateTag.Id)*/) + // todo 获取模板(模板标签下的对一个物料的的模板)目前写死参数 + productTemplate, err := w.logic.svcCtx.AllModels.FsProductTemplateV2.FindOneByProductIdTagIdWithSizeTable(w.logic.ctx, 18, "8" /*fmt.Sprintf("%d", templateTag.Id)*/) if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { logx.Error("template info is not found") From c5dd4866b9a982fed58eff3bafdaa6b468fca3ef Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 16 Aug 2023 15:46:10 +0800 Subject: [PATCH 4/4] fix --- server/websocket/internal/logic/ws_render_image_logic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index 244a81d8..8d658bc6 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -122,7 +122,7 @@ func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data.Re } }() // todo 获取模板(模板标签下的对一个物料的的模板)目前写死参数 - productTemplate, err := w.logic.svcCtx.AllModels.FsProductTemplateV2.FindOneByProductIdTagIdWithSizeTable(w.logic.ctx, 18, "8" /*fmt.Sprintf("%d", templateTag.Id)*/) + productTemplate, err := w.logic.svcCtx.AllModels.FsProductTemplateV2.FindOneByProductIdTagIdWithSizeTable(w.logic.ctx, 31, "11" /*fmt.Sprintf("%d", templateTag.Id)*/) if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { logx.Error("template info is not found")