This commit is contained in:
laodaming
2023-09-11 12:17:07 +08:00
parent 00be036e59
commit ac11753274
3 changed files with 76 additions and 30 deletions

View File

@@ -105,14 +105,13 @@ func (l *GetTemplateByPidLogic) GetTemplateByPid(req *types.GetTemplateByPidReq,
logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeJsonErr, fmt.Sprintf("failed to parse json product template info(may be old data):%d", templateInfo.Id))
}
//后台隐藏/显示信息(现在下面是写死了)
/*var switchInfo interface{}
if templateInfo.SwitchInfo != nil && *templateInfo.SwitchInfo != "" {
_ = json.Unmarshal([]byte(*templateInfo.SwitchInfo), &switchInfo)
}*/
modelInfo := modelList[modelIndex]
mapKey := fmt.Sprintf("_%d", *modelInfo.SizeId)
rsp[mapKey] = template_switch_info.GetTemplateSwitchInfo(templateInfo.Id, *templateInfo.MaterialImg)
switchInfo, err := template_switch_info.GetTemplateSwitchInfo(templateInfo.Id, templateInfo.TemplateInfo, *templateInfo.MaterialImg)
if err != nil {
return resp.SetStatusWithMessage(basic.CodeServiceErr, err.Error())
}
rsp[mapKey] = switchInfo
}
return resp.SetStatusWithMessage(basic.CodeOK, "success", rsp)
}