From dd123cc4465945f6a5f2f8e6f774da0d071285ed Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 12 Sep 2023 17:44:12 +0800 Subject: [PATCH] 11 --- server/product/internal/logic/gettemplatebypidlogic.go | 3 --- utils/template_switch_info/template_switch.go | 10 +++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/server/product/internal/logic/gettemplatebypidlogic.go b/server/product/internal/logic/gettemplatebypidlogic.go index 16e9fff8..6a2c654f 100644 --- a/server/product/internal/logic/gettemplatebypidlogic.go +++ b/server/product/internal/logic/gettemplatebypidlogic.go @@ -92,9 +92,6 @@ func (l *GetTemplateByPidLogic) GetTemplateByPid(req *types.GetTemplateByPidReq, rsp := make(map[string]interface{}) for _, templateInfo := range templateList { //没有设置模板据不要 - if templateInfo.TemplateInfo == nil || *templateInfo.TemplateInfo == "" { - continue - } modelIndex, ok := mapModel[*templateInfo.ModelId] if !ok { continue diff --git a/utils/template_switch_info/template_switch.go b/utils/template_switch_info/template_switch.go index 52274adb..77194517 100644 --- a/utils/template_switch_info/template_switch.go +++ b/utils/template_switch_info/template_switch.go @@ -62,7 +62,15 @@ type MaterialItem struct { // 获取模板开关信息(目前写死,以后后台做好了功能再更新变动) func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMaterialImg string) (resp GetTemplateSwitchInfoRsp, err error) { if templateJsonStr == nil || *templateJsonStr == "" { - return GetTemplateSwitchInfoRsp{}, nil + return GetTemplateSwitchInfoRsp{ + Id: templateId, + Material: templateMaterialImg, + MaterialData: MaterialData{ + Logo: Logo{ + Material: "/image/logo/aHnT1_rzubdwax_scale.png", + }, + }, + }, nil } var templateJsonInfo TemplateSimpleParseInfo if err = json.Unmarshal([]byte(*templateJsonStr), &templateJsonInfo); err != nil {