fix
This commit is contained in:
parent
813e315ae3
commit
e9523e29e7
@ -8,10 +8,10 @@ import (
|
|||||||
type GetTemplateSwitchInfoRsp struct {
|
type GetTemplateSwitchInfoRsp struct {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
Material string `json:"material"`
|
Material string `json:"material"`
|
||||||
MaterialData MaterialData `json:"material_data"`
|
SwitchInfo SwitchInfo `json:"material_data"`
|
||||||
CombineIsVisible bool `json:"combine_is_visible"` //合图总开关是否开启
|
CombineIsVisible bool `json:"combine_is_visible"` //合图总开关是否开启
|
||||||
}
|
}
|
||||||
type MaterialData struct {
|
type SwitchInfo struct {
|
||||||
QRcode QRcode `json:"QRcode"`
|
QRcode QRcode `json:"QRcode"`
|
||||||
Website Website `json:"Website"`
|
Website Website `json:"Website"`
|
||||||
Address Address `json:"Address"`
|
Address Address `json:"Address"`
|
||||||
@ -69,7 +69,7 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
|
|||||||
returnData := GetTemplateSwitchInfoRsp{
|
returnData := GetTemplateSwitchInfoRsp{
|
||||||
Id: templateId,
|
Id: templateId,
|
||||||
Material: templateMaterialImg,
|
Material: templateMaterialImg,
|
||||||
MaterialData: MaterialData{
|
SwitchInfo: SwitchInfo{
|
||||||
Logo: Logo{
|
Logo: Logo{
|
||||||
Material: "/image/logo/aHnT1_rzubdwax_scale.png",
|
Material: "/image/logo/aHnT1_rzubdwax_scale.png",
|
||||||
},
|
},
|
||||||
@ -77,11 +77,11 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
|
|||||||
CombineIsVisible: false,
|
CombineIsVisible: false,
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
returnData.MaterialData.QRcode.UserDisabled = true
|
returnData.SwitchInfo.QRcode.UserDisabled = true
|
||||||
returnData.MaterialData.Website.UserDisabled = true
|
returnData.SwitchInfo.Website.UserDisabled = true
|
||||||
returnData.MaterialData.Address.UserDisabled = true
|
returnData.SwitchInfo.Address.UserDisabled = true
|
||||||
returnData.MaterialData.Phone.UserDisabled = true
|
returnData.SwitchInfo.Phone.UserDisabled = true
|
||||||
returnData.MaterialData.Slogan.UserDisabled = true
|
returnData.SwitchInfo.Slogan.UserDisabled = true
|
||||||
}()
|
}()
|
||||||
if templateJsonStr == nil || *templateJsonStr == "" {
|
if templateJsonStr == nil || *templateJsonStr == "" {
|
||||||
return returnData
|
return returnData
|
||||||
@ -98,31 +98,31 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa
|
|||||||
}
|
}
|
||||||
switch v.Tag {
|
switch v.Tag {
|
||||||
case "Phone": //电话
|
case "Phone": //电话
|
||||||
returnData.MaterialData.Phone = Phone{
|
returnData.SwitchInfo.Phone = Phone{
|
||||||
IfShow: v.Visible,
|
IfShow: v.Visible,
|
||||||
Text: v.Text,
|
Text: v.Text,
|
||||||
DefaultValue: "your phone",
|
DefaultValue: "your phone",
|
||||||
}
|
}
|
||||||
case "Address": //地址
|
case "Address": //地址
|
||||||
returnData.MaterialData.Address = Address{
|
returnData.SwitchInfo.Address = Address{
|
||||||
IfShow: v.Visible,
|
IfShow: v.Visible,
|
||||||
Text: v.Text,
|
Text: v.Text,
|
||||||
DefaultValue: "your address",
|
DefaultValue: "your address",
|
||||||
}
|
}
|
||||||
case "Website":
|
case "Website":
|
||||||
returnData.MaterialData.Website = Website{
|
returnData.SwitchInfo.Website = Website{
|
||||||
IfShow: v.Visible,
|
IfShow: v.Visible,
|
||||||
Text: v.Text,
|
Text: v.Text,
|
||||||
DefaultValue: "your website",
|
DefaultValue: "your website",
|
||||||
}
|
}
|
||||||
case "QRcode":
|
case "QRcode":
|
||||||
returnData.MaterialData.QRcode = QRcode{
|
returnData.SwitchInfo.QRcode = QRcode{
|
||||||
IfShow: v.Visible,
|
IfShow: v.Visible,
|
||||||
Text: v.Text,
|
Text: v.Text,
|
||||||
DefaultValue: "your qrcode content",
|
DefaultValue: "your qrcode content",
|
||||||
}
|
}
|
||||||
case "Slogan":
|
case "Slogan":
|
||||||
returnData.MaterialData.Slogan = Slogan{
|
returnData.SwitchInfo.Slogan = Slogan{
|
||||||
IfShow: v.Visible,
|
IfShow: v.Visible,
|
||||||
Text: v.Text,
|
Text: v.Text,
|
||||||
DefaultValue: "your slogan",
|
DefaultValue: "your slogan",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user