diff --git a/utils/template_switch_info/template_switch.go b/utils/template_switch_info/template_switch.go index 55b21346..5660c234 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"` - SwitchInfo SwitchInfo `json:"switch_info"` - CombineIsVisible bool `json:"combine_is_visible"` //合图总开关是否开启 + Id int64 `json:"id"` + Material string `json:"material"` + MaterialData MaterialData `json:"material_data"` + CombineIsVisible bool `json:"combine_is_visible"` //合图总开关是否开启 } -type SwitchInfo struct { +type MaterialData 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, - SwitchInfo: SwitchInfo{ + MaterialData: MaterialData{ Logo: Logo{ Material: "/image/logo/aHnT1_rzubdwax_scale.png", }, @@ -89,7 +89,7 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa return GetTemplateSwitchInfoRsp{ Id: templateId, Material: templateMaterialImg, - SwitchInfo: SwitchInfo{ + MaterialData: MaterialData{ Logo: Logo{ Material: "/image/logo/aHnT1_rzubdwax_scale.png", }, @@ -99,31 +99,31 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa } switch v.Tag { case "Phone": //电话 - returnData.SwitchInfo.Phone = Phone{ + returnData.MaterialData.Phone = Phone{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your phone", } case "Address": //地址 - returnData.SwitchInfo.Address = Address{ + returnData.MaterialData.Address = Address{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your address", } case "Website": - returnData.SwitchInfo.Website = Website{ + returnData.MaterialData.Website = Website{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your website", } case "QRcode": - returnData.SwitchInfo.QRcode = QRcode{ + returnData.MaterialData.QRcode = QRcode{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your qrcode content", } case "Slogan": - returnData.SwitchInfo.Slogan = Slogan{ + returnData.MaterialData.Slogan = Slogan{ IfShow: v.Visible, Text: v.Text, DefaultValue: "your slogan",