This commit is contained in:
laodaming 2023-09-12 17:44:12 +08:00
parent ef946ed0e8
commit dd123cc446
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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 {