fix
This commit is contained in:
parent
19958a80de
commit
93e95d1a15
|
@ -100,15 +100,6 @@ func (w *wsConnectItem) renderImage(data []byte) {
|
||||||
logx.Error("invalid format of websocket render image message", err)
|
logx.Error("invalid format of websocket render image message", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
lenColor := len(renderImageData.RenderData.TemplateTagColor.Color)
|
|
||||||
if lenColor == 0 {
|
|
||||||
w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "请传入模板标签选择的颜色", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if renderImageData.RenderData.TemplateTagColor.SelectedIndex >= lenColor || renderImageData.RenderData.TemplateTagColor.SelectedIndex < 0 {
|
|
||||||
w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "选择的模板标签颜色索引越界", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
//获取产品信息(部分字段)
|
//获取产品信息(部分字段)
|
||||||
productInfo, err := w.logic.svcCtx.AllModels.FsProduct.FindOne(w.logic.ctx, renderImageData.RenderData.ProductId, "id,is_customization")
|
productInfo, err := w.logic.svcCtx.AllModels.FsProduct.FindOne(w.logic.ctx, renderImageData.RenderData.ProductId, "id,is_customization")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -201,10 +192,6 @@ func (w *wsConnectItem) renderImage(data []byte) {
|
||||||
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{
|
|
||||||
Color: renderImageData.RenderData.TemplateTagColor.Color,
|
|
||||||
Index: renderImageData.RenderData.TemplateTagColor.SelectedIndex,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
res, err := w.logic.svcCtx.Repositories.ImageHandle.LogoCombine(w.logic.ctx, &combineReq)
|
res, err := w.logic.svcCtx.Repositories.ImageHandle.LogoCombine(w.logic.ctx, &combineReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -187,17 +187,16 @@ func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq
|
||||||
/* logo合图 */
|
/* logo合图 */
|
||||||
type (
|
type (
|
||||||
LogoCombineReq struct {
|
LogoCombineReq struct {
|
||||||
UserId int64 `json:"user_id"`
|
UserId int64 `json:"user_id"`
|
||||||
GuestId int64 `json:"guest_id"`
|
GuestId int64 `json:"guest_id"`
|
||||||
TemplateId int64 `json:"template_id"`
|
TemplateId int64 `json:"template_id"`
|
||||||
TemplateTag string `json:"template_tag"`
|
TemplateTag string `json:"template_tag"`
|
||||||
Website string `json:"website"` // 合图参数
|
Website string `json:"website"` // 合图参数
|
||||||
Slogan string `json:"slogan"` // 合图参数
|
Slogan string `json:"slogan"` // 合图参数
|
||||||
Address string `json:"address"` // 合图参数
|
Address string `json:"address"` // 合图参数
|
||||||
Phone string `json:"phone"` // 合图参数
|
Phone string `json:"phone"` // 合图参数
|
||||||
Qrcode string `json:"qrcode"` // 合图参数
|
Qrcode string `json:"qrcode"` // 合图参数
|
||||||
LogoUrl string `json:"logo_url"` // 合图参数
|
LogoUrl string `json:"logo_url"` // 合图参数
|
||||||
TemplateTagColor TemplateTagColor `json:"template_tag_color"`
|
|
||||||
}
|
}
|
||||||
LogoCombineRes struct {
|
LogoCombineRes struct {
|
||||||
ResourceId string
|
ResourceId string
|
||||||
|
@ -207,10 +206,6 @@ type (
|
||||||
DiffTimeUploadFile int64
|
DiffTimeUploadFile int64
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
type TemplateTagColor struct {
|
|
||||||
Color [][]string `json:"color"`
|
|
||||||
Index int `json:"index"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq) (*LogoCombineRes, error) {
|
func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq) (*LogoCombineRes, error) {
|
||||||
// 查询logo最新基础信息
|
// 查询logo最新基础信息
|
||||||
|
@ -313,10 +308,7 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
|
||||||
combineParam["phone"] = in.Phone
|
combineParam["phone"] = in.Phone
|
||||||
combineParam["address"] = in.Address
|
combineParam["address"] = in.Address
|
||||||
combineParam["qrcode"] = in.Qrcode
|
combineParam["qrcode"] = in.Qrcode
|
||||||
combineParam["template_tag_selected"] = map[string]interface{}{
|
//combineParam["template_tag_selected"] =
|
||||||
"template_tag": in.TemplateTag,
|
|
||||||
"color": in.TemplateTagColor,
|
|
||||||
}
|
|
||||||
|
|
||||||
var postMap = make(map[string]interface{}, 2)
|
var postMap = make(map[string]interface{}, 2)
|
||||||
postMap["module_data"] = moduleDataMap
|
postMap["module_data"] = moduleDataMap
|
||||||
|
|
|
@ -15,22 +15,17 @@ type RenderImageReqMsg struct {
|
||||||
RenderData RenderData `json:"render_data"`
|
RenderData RenderData `json:"render_data"`
|
||||||
}
|
}
|
||||||
type RenderData struct {
|
type RenderData struct {
|
||||||
TemplateTag string `json:"template_tag"` //模板标签(必须)
|
TemplateTag string `json:"template_tag"` //模板标签(必须)
|
||||||
TemplateTagColor TemplateTagColor `json:"template_tag_color"` //模板标签组合颜色
|
ProductId int64 `json:"product_id"` //产品id(必须)
|
||||||
ProductId int64 `json:"product_id"` //产品id(必须)
|
Website string `json:"website"` //网站(可选)
|
||||||
Website string `json:"website"` //网站(可选)
|
Slogan string `json:"slogan"` //slogan(可选)
|
||||||
Slogan string `json:"slogan"` //slogan(可选)
|
Address string `json:"address"` //地址(可选)
|
||||||
Address string `json:"address"` //地址(可选)
|
Phone string `json:"phone"` //电话(可选)
|
||||||
Phone string `json:"phone"` //电话(可选)
|
Qrcode string `json:"qrcode"` //二维码(可选)
|
||||||
Qrcode string `json:"qrcode"` //二维码(可选)
|
ProductSizeId int64 `json:"product_size_id"` //尺寸id(可选)
|
||||||
ProductSizeId int64 `json:"product_size_id"` //尺寸id(可选)
|
UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
|
||||||
UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
|
GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
|
||||||
GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
|
Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值)
|
||||||
Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值)
|
|
||||||
}
|
|
||||||
type TemplateTagColor struct {
|
|
||||||
Color [][]string `json:"color"` //颜色组合
|
|
||||||
SelectedIndex int `json:"selected_index"` //主色的下标索引
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// websocket发送渲染完的数据
|
// websocket发送渲染完的数据
|
||||||
|
|
Loading…
Reference in New Issue
Block a user