This commit is contained in:
laodaming 2023-09-11 12:19:24 +08:00
parent ce394848fd
commit e6f2651704

View File

@ -54,12 +54,12 @@ type MaterialItem struct {
}
// 获取模板开关信息(目前写死,以后后台做好了功能再更新变动)
func GetTemplateSwitchInfo(templateId int64, templateInfo *string, templateMaterialImg string) (resp GetTemplateSwitchInfoRsp, err error) {
if templateInfo == nil || *templateInfo == "" {
func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMaterialImg string) (resp GetTemplateSwitchInfoRsp, err error) {
if templateJsonStr == nil || *templateJsonStr == "" {
return GetTemplateSwitchInfoRsp{}, nil
}
var templateJsonInfo TemplateSimpleParseInfo
if err = json.Unmarshal([]byte(*templateInfo), &templateJsonInfo); err != nil {
if err = json.Unmarshal([]byte(*templateJsonStr), &templateJsonInfo); err != nil {
logx.Error(err)
return GetTemplateSwitchInfoRsp{}, errors.New("解析模板json获取DIY开关设置失败")
}