11
This commit is contained in:
parent
6e42d9d218
commit
df73e8d5ce
|
@ -104,11 +104,7 @@ func (l *GetTemplateByPidLogic) GetTemplateByPid(req *types.GetTemplateByPidReq,
|
||||||
}
|
}
|
||||||
modelInfo := modelList[modelIndex]
|
modelInfo := modelList[modelIndex]
|
||||||
mapKey := fmt.Sprintf("_%d", *modelInfo.SizeId)
|
mapKey := fmt.Sprintf("_%d", *modelInfo.SizeId)
|
||||||
switchInfo, err := template_switch_info.GetTemplateSwitchInfo(templateInfo.Id, templateInfo.TemplateInfo, *templateInfo.MaterialImg)
|
rsp[mapKey] = 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)
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", rsp)
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,11 +74,7 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
|
||||||
logc.Errorf(l.ctx, "productTemplateV2Model.FindOne:%v", err)
|
logc.Errorf(l.ctx, "productTemplateV2Model.FindOne:%v", err)
|
||||||
return resp.SetStatus(basic.CodeServiceErr, "模版不存在")
|
return resp.SetStatus(basic.CodeServiceErr, "模版不存在")
|
||||||
}
|
}
|
||||||
templateSwitchInfo, err := template_switch_info.GetTemplateSwitchInfo(req.TemplateId, productTemplateV2Info.TemplateInfo, *productTemplateV2Info.MaterialImg)
|
templateSwitchInfo := template_switch_info.GetTemplateSwitchInfo(req.TemplateId, productTemplateV2Info.TemplateInfo, *productTemplateV2Info.MaterialImg)
|
||||||
if err != nil {
|
|
||||||
logc.Errorf(l.ctx, "template_switch_info.GetTemplateSwitchInfo,err:%v", err)
|
|
||||||
return resp.SetStatus(basic.CodeServiceErr, "默认模版不存在")
|
|
||||||
}
|
|
||||||
if req.Address == "" && templateSwitchInfo.MaterialData.Address.IfShow {
|
if req.Address == "" && templateSwitchInfo.MaterialData.Address.IfShow {
|
||||||
req.Address = templateSwitchInfo.MaterialData.Address.DefaultValue
|
req.Address = templateSwitchInfo.MaterialData.Address.DefaultValue
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,12 +163,7 @@ func (w *wsConnectItem) renderImage(data []byte) {
|
||||||
}
|
}
|
||||||
//获取模板开关信息并且对于没有默认值的给赋值默认值(但凡DIY有一个是空的就要请求默认数据)
|
//获取模板开关信息并且对于没有默认值的给赋值默认值(但凡DIY有一个是空的就要请求默认数据)
|
||||||
if renderImageData.RenderData.Website == "" || renderImageData.RenderData.Phone == "" || renderImageData.RenderData.Address == "" || renderImageData.RenderData.Qrcode == "" {
|
if renderImageData.RenderData.Website == "" || renderImageData.RenderData.Phone == "" || renderImageData.RenderData.Address == "" || renderImageData.RenderData.Qrcode == "" {
|
||||||
templateSwitchInfo, err := template_switch_info.GetTemplateSwitchInfo(productTemplate.Id, productTemplate.TemplateInfo, *productTemplate.MaterialImg)
|
templateSwitchInfo := 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 == "" && templateSwitchInfo.MaterialData.Website.IfShow {
|
if renderImageData.RenderData.Website == "" && templateSwitchInfo.MaterialData.Website.IfShow {
|
||||||
renderImageData.RenderData.Website = templateSwitchInfo.MaterialData.Website.DefaultValue
|
renderImageData.RenderData.Website = templateSwitchInfo.MaterialData.Website.DefaultValue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user