This commit is contained in:
laodaming 2023-10-27 10:57:48 +08:00
parent 5b4ea9995b
commit 344eeebecb

View File

@ -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:"switch_info"`
CombineIsVisible bool `json:"combine_is_visible"` //合图总开关是否开启
}
type MaterialData struct {
type SwitchInfo struct {
QRcode QRcode `json:"QRcode"`
Website Website `json:"Website"`
Address Address `json:"Address"`
@ -64,7 +64,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",
},
@ -84,7 +84,7 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
return GetTemplateSwitchInfoRsp{
Id: templateId,
Material: templateMaterialImg,
MaterialData: MaterialData{
SwitchInfo: SwitchInfo{
Logo: Logo{
Material: "/image/logo/aHnT1_rzubdwax_scale.png",
},
@ -94,31 +94,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",