fix:合图,默认参数

This commit is contained in:
momo 2023-09-11 15:18:10 +08:00
parent 74f25d23cf
commit 21f90f3dd1

View File

@ -61,7 +61,7 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
userId = userinfo.UserId userId = userinfo.UserId
} }
// 获取默认 // 获取默认
if req.Address == "" || req.Phone == "" || req.Website == "" || req.Qrcode == "" { if req.Address == "" || req.Phone == "" || req.Website == "" || req.Qrcode == "" || req.Slogan == "" {
// 没有查到先根据模版id 查询模版数据 请求算法数据 // 没有查到先根据模版id 查询模版数据 请求算法数据
productTemplateV2Model := gmodel.NewFsProductTemplateV2Model(l.svcCtx.MysqlConn) productTemplateV2Model := gmodel.NewFsProductTemplateV2Model(l.svcCtx.MysqlConn)
productTemplateV2Info, err := productTemplateV2Model.FindOne(l.ctx, req.TemplateId) productTemplateV2Info, err := productTemplateV2Model.FindOne(l.ctx, req.TemplateId)
@ -87,6 +87,9 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
if req.Qrcode == "" && templateSwitchInfo.MaterialData.QRcode.IfShow { if req.Qrcode == "" && templateSwitchInfo.MaterialData.QRcode.IfShow {
req.Qrcode = templateSwitchInfo.MaterialData.QRcode.DefaultValue req.Qrcode = templateSwitchInfo.MaterialData.QRcode.DefaultValue
} }
if req.Slogan == "" && templateSwitchInfo.MaterialData.Slogan.IfShow {
req.Slogan = templateSwitchInfo.MaterialData.Slogan.DefaultValue
}
} }
res, err := l.svcCtx.Repositories.ImageHandle.LogoCombine(l.ctx, &repositories.LogoCombineReq{ res, err := l.svcCtx.Repositories.ImageHandle.LogoCombine(l.ctx, &repositories.LogoCombineReq{