Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming 2023-11-22 15:37:08 +08:00
commit 9f412fe108
5 changed files with 41 additions and 28 deletions

View File

@ -104,7 +104,7 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
GuestId: guestId, GuestId: guestId,
TemplateTag: req.TemplateTag, TemplateTag: req.TemplateTag,
Website: req.Website, Website: req.Website,
Slogan: req.Slogan, Slogan: &req.Slogan,
Phone: req.Phone, Phone: req.Phone,
Address: req.Address, Address: req.Address,
Qrcode: req.Qrcode, Qrcode: req.Qrcode,

View File

@ -38,11 +38,11 @@ type LogoCombineReq struct {
TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"` TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"`
TemplateId int64 `json:"template_id"` // 合图参数 TemplateId int64 `json:"template_id"` // 合图参数
TemplateTag string `json:"template_tag"` // 合图参数 TemplateTag string `json:"template_tag"` // 合图参数
Website string `json:"website,optional"` // 合图参数
Slogan string `json:"slogan,optional"` // 合图参数 Slogan string `json:"slogan,optional"` // 合图参数
Address string `json:"address,optional"` // 合图参数 Website *string `json:"website,optional"` // 合图参数
Phone string `json:"phone,optional"` // 合图参数 Address *string `json:"address,optional"` // 合图参数
Qrcode string `json:"qrcode,optional"` // 合图参数 Phone *string `json:"phone,optional"` // 合图参数
Qrcode *string `json:"qrcode,optional"` // 合图参数
} }
type TemplateTagColor struct { type TemplateTagColor struct {

View File

@ -12,10 +12,11 @@ import (
"fusenapi/utils/curl" "fusenapi/utils/curl"
"fusenapi/utils/hash" "fusenapi/utils/hash"
"fusenapi/utils/websocket_data" "fusenapi/utils/websocket_data"
"github.com/zeromicro/go-zero/core/logx"
"gorm.io/gorm"
"strconv" "strconv"
"time" "time"
"github.com/zeromicro/go-zero/core/logx"
"gorm.io/gorm"
) )
var ( var (
@ -214,11 +215,11 @@ func (w *wsConnectItem) renderImage(renderImageData websocket_data.RenderImageRe
ProductTemplateV2Info: productTemplate, ProductTemplateV2Info: productTemplate,
ProductTemplateTagGroups: renderImageData.RenderData.TemplateTagGroups, ProductTemplateTagGroups: renderImageData.RenderData.TemplateTagGroups,
TemplateTag: renderImageData.RenderData.TemplateTag, TemplateTag: renderImageData.RenderData.TemplateTag,
Website: renderImageData.RenderData.Website, Slogan: &renderImageData.RenderData.Slogan,
Slogan: renderImageData.RenderData.Slogan, // Website: &renderImageData.RenderData.Website,
Address: renderImageData.RenderData.Address, // Address: &renderImageData.RenderData.Address,
Phone: renderImageData.RenderData.Phone, // Phone: &renderImageData.RenderData.Phone,
Qrcode: renderImageData.RenderData.Qrcode, // Qrcode: &renderImageData.RenderData.Qrcode,
LogoUrl: renderImageData.RenderData.Logo, LogoUrl: renderImageData.RenderData.Logo,
TemplateTagColor: repositories.TemplateTagColor{ TemplateTagColor: repositories.TemplateTagColor{
Color: renderImageData.RenderData.TemplateTagColor.Colors, Color: renderImageData.RenderData.TemplateTagColor.Colors,

View File

@ -70,11 +70,11 @@ type (
TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"` TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"`
TemplateId int64 `json:"template_id"` // 合图参数 TemplateId int64 `json:"template_id"` // 合图参数
TemplateTag string `json:"template_tag"` // 合图参数 TemplateTag string `json:"template_tag"` // 合图参数
Website string `json:"website,optional"` // 合图参数
Slogan string `json:"slogan,optional"` // 合图参数 Slogan string `json:"slogan,optional"` // 合图参数
Address string `json:"address,optional"` // 合图参数 Website *string `json:"website,optional"` // 合图参数
Phone string `json:"phone,optional"` // 合图参数 Address *string `json:"address,optional"` // 合图参数
Qrcode string `json:"qrcode,optional"` // 合图参数 Phone *string `json:"phone,optional"` // 合图参数
Qrcode *string `json:"qrcode,optional"` // 合图参数
} }
TemplateTagColor { TemplateTagColor {
Colors [][]string `json:"colors"` // 颜色组合 Colors [][]string `json:"colors"` // 颜色组合

View File

@ -127,15 +127,16 @@ type (
ProductTemplateV2Info *gmodel.FsProductTemplateV2 `json:"product_template_v2_info"` ProductTemplateV2Info *gmodel.FsProductTemplateV2 `json:"product_template_v2_info"`
ProductTemplateTagGroups interface{} `json:"product_template_tag_groups"` ProductTemplateTagGroups interface{} `json:"product_template_tag_groups"`
TemplateTag string `json:"template_tag"` TemplateTag string `json:"template_tag"`
Website string `json:"website"` // 合图参数
Slogan string `json:"slogan"` // 合图参数
Address string `json:"address"` // 合图参数
Phone string `json:"phone"` // 合图参数
Qrcode string `json:"qrcode"` // 合图参数
LogoUrl string `json:"logo_url"` // 合图参数 LogoUrl string `json:"logo_url"` // 合图参数
Resolution string `json:"resolution"` // 合图参数 Resolution string `json:"resolution"` // 合图参数
TemplateTagColor TemplateTagColor `json:"template_tag_color"` // 合图颜色 TemplateTagColor TemplateTagColor `json:"template_tag_color"` // 合图颜色
Debug *auth.Debug `json:"debug"` Debug *auth.Debug `json:"debug"`
Website *string `json:"website"` // 合图参数
Slogan *string `json:"slogan"` // 合图参数
Address *string `json:"address"` // 合图参数
Phone *string `json:"phone"` // 合图参数
Qrcode *string `json:"qrcode"` // 合图参数
} }
LogoCombineRes struct { LogoCombineRes struct {
ResourceId string `json:"resource_id"` ResourceId string `json:"resource_id"`
@ -226,11 +227,22 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
json.Unmarshal(*resLogoInfo.Metadata, &combineParam) json.Unmarshal(*resLogoInfo.Metadata, &combineParam)
combineParam["resolution"] = in.Resolution combineParam["resolution"] = in.Resolution
combineParam["template_tagid"] = in.TemplateTag combineParam["template_tagid"] = in.TemplateTag
combineParam["website"] = in.Website if in.Website != nil {
combineParam["slogan"] = in.Slogan combineParam["website"] = *in.Website
combineParam["phone"] = in.Phone }
combineParam["address"] = in.Address if in.Slogan != nil {
combineParam["qrcode"] = in.Qrcode combineParam["slogan"] = *in.Slogan
}
if in.Phone != nil {
combineParam["phone"] = *in.Phone
}
if in.Address != nil {
combineParam["address"] = *in.Address
}
if in.Qrcode != nil {
combineParam["qrcode"] = *in.Qrcode
}
combineParam["template_tag_selected"] = map[string]interface{}{ combineParam["template_tag_selected"] = map[string]interface{}{
"template_tag": in.TemplateTag, "template_tag": in.TemplateTag,
"color": in.TemplateTagColor.Color, "color": in.TemplateTagColor.Color,