From e9523e29e7f30ebd3a9bf1c9b24c0011bbcde3c0 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 27 Oct 2023 11:28:09 +0800 Subject: [PATCH] fix --- utils/template_switch_info/template_switch.go | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/utils/template_switch_info/template_switch.go b/utils/template_switch_info/template_switch.go index ff19eb14..13cb60c6 100644 --- a/utils/template_switch_info/template_switch.go +++ b/utils/template_switch_info/template_switch.go @@ -6,12 +6,12 @@ import ( ) type GetTemplateSwitchInfoRsp struct { - Id int64 `json:"id"` - Material string `json:"material"` - MaterialData MaterialData `json:"material_data"` - CombineIsVisible bool `json:"combine_is_visible"` //合图总开关是否开启 + Id int64 `json:"id"` + Material string `json:"material"` + SwitchInfo SwitchInfo `json:"material_data"` + CombineIsVisible bool `json:"combine_is_visible"` //合图总开关是否开启 } -type MaterialData struct { +type SwitchInfo struct { QRcode QRcode `json:"QRcode"` Website Website `json:"Website"` Address Address `json:"Address"` @@ -69,7 +69,7 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa returnData := GetTemplateSwitchInfoRsp{ Id: templateId, Material: templateMaterialImg, - MaterialData: MaterialData{ + SwitchInfo: SwitchInfo{ Logo: Logo{ Material: "/image/logo/aHnT1_rzubdwax_scale.png", }, @@ -77,11 +77,11 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa CombineIsVisible: false, } defer func() { - returnData.MaterialData.QRcode.UserDisabled = true - returnData.MaterialData.Website.UserDisabled = true - returnData.MaterialData.Address.UserDisabled = true - returnData.MaterialData.Phone.UserDisabled = true - returnData.MaterialData.Slogan.UserDisabled = true + returnData.SwitchInfo.QRcode.UserDisabled = true + returnData.SwitchInfo.Website.UserDisabled = true + returnData.SwitchInfo.Address.UserDisabled = true + returnData.SwitchInfo.Phone.UserDisabled = true + returnData.SwitchInfo.Slogan.UserDisabled = true }() if templateJsonStr == nil || *templateJsonStr == "" { return returnData @@ -98,31 +98,31 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa } switch v.Tag { case "Phone": //电话 - returnData.MaterialData.Phone = Phone{ + returnData.SwitchInfo.Phone = Phone{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your phone", } case "Address": //地址 - returnData.MaterialData.Address = Address{ + returnData.SwitchInfo.Address = Address{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your address", } case "Website": - returnData.MaterialData.Website = Website{ + returnData.SwitchInfo.Website = Website{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your website", } case "QRcode": - returnData.MaterialData.QRcode = QRcode{ + returnData.SwitchInfo.QRcode = QRcode{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your qrcode content", } case "Slogan": - returnData.MaterialData.Slogan = Slogan{ + returnData.SwitchInfo.Slogan = Slogan{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your slogan",