fix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -153,7 +153,12 @@ func (w *wsConnectItem) renderImage(data []byte) {
|
||||
return
|
||||
}
|
||||
//获取模板开关信息并且对于没有默认值的给赋值默认值
|
||||
templateSwitchInfo := template_switch_info.GetTemplateSwitchInfo(productTemplate.Id, *productTemplate.MaterialImg)
|
||||
templateSwitchInfo, err := template_switch_info.GetTemplateSwitchInfo(productTemplate.Id, productTemplate.TemplateInfo, *productTemplate.MaterialImg)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", err.Error(), renderImageData.RenderData.ProductId, w.userId, w.guestId, productTemplate.Id, model3dInfo.Id, productSize.Id, *productTemplate.ElementModelId)
|
||||
return
|
||||
}
|
||||
if renderImageData.RenderData.Website == "" {
|
||||
renderImageData.RenderData.Website = templateSwitchInfo.MaterialData.Website.DefaultValue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user