This commit is contained in:
laodaming
2023-09-06 10:48:45 +08:00
parent a39076d739
commit 4d0081b19c
4 changed files with 95 additions and 35 deletions

View File

@@ -7,6 +7,7 @@ import (
"fusenapi/constants"
"fusenapi/utils/auth"
"fusenapi/utils/basic"
"fusenapi/utils/template_switch_info"
"gorm.io/gorm"
"strings"
@@ -111,36 +112,7 @@ func (l *GetTemplateByPidLogic) GetTemplateByPid(req *types.GetTemplateByPidReq,
}*/
modelInfo := modelList[modelIndex]
mapKey := fmt.Sprintf("_%d", *modelInfo.SizeId)
rsp[mapKey] = map[string]interface{}{
"id": templateInfo.Id,
"material": *templateInfo.MaterialImg,
//写死的数据
"material_data": map[string]interface{}{
"QRcode": map[string]interface{}{
"if_show": true,
"text": "qrcode",
"default_value": "default qrcode",
},
"Website": map[string]interface{}{
"if_show": true,
"text": "website",
"default_value": "default website",
},
"Address": map[string]interface{}{
"if_show": true,
"text": "address",
"default_value": "default address",
},
"Phone": map[string]interface{}{
"if_show": true,
"text": "phone",
"default_value": "17557283679",
},
"Logo": map[string]interface{}{
"material": "/image/logo/aHnT1_rzubdwax_scale.png",
},
},
}
rsp[mapKey] = template_switch_info.GetTemplateSwitchInfo(templateInfo.Id, *templateInfo.MaterialImg)
}
return resp.SetStatusWithMessage(basic.CodeOK, "success", rsp)
}