fix
This commit is contained in:
parent
cf83bd068b
commit
aafcbfcf50
@ -94,6 +94,7 @@ func (l *AddToCartLogic) AddToCart(req *types.AddToCartReq, userinfo *auth.UserI
|
|||||||
fittingName string //配件名
|
fittingName string //配件名
|
||||||
lightJson interface{} //灯光设计数据
|
lightJson interface{} //灯光设计数据
|
||||||
lightName string //灯光名字
|
lightName string //灯光名字
|
||||||
|
modelJson interface{} //模型json
|
||||||
)
|
)
|
||||||
//有模板
|
//有模板
|
||||||
if req.TemplateId > 0 {
|
if req.TemplateId > 0 {
|
||||||
@ -174,6 +175,10 @@ func (l *AddToCartLogic) AddToCart(req *types.AddToCartReq, userinfo *auth.UserI
|
|||||||
if modelInfo.ModelInfo == nil || *modelInfo.ModelInfo == "" {
|
if modelInfo.ModelInfo == nil || *modelInfo.ModelInfo == "" {
|
||||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "the model`s design info is empty")
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "the model`s design info is empty")
|
||||||
}
|
}
|
||||||
|
if err = json.Unmarshal([]byte(*modelInfo.ModelInfo), &modelJson); err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeJsonErr, "failed to parse model design info")
|
||||||
|
}
|
||||||
//获取灯光信息
|
//获取灯光信息
|
||||||
if *modelInfo.Light > 0 {
|
if *modelInfo.Light > 0 {
|
||||||
lightInfo, err := l.svcCtx.AllModels.FsProductModel3dLight.FindOne(l.ctx, *modelInfo.Light)
|
lightInfo, err := l.svcCtx.AllModels.FsProductModel3dLight.FindOne(l.ctx, *modelInfo.Light)
|
||||||
@ -208,7 +213,7 @@ func (l *AddToCartLogic) AddToCart(req *types.AddToCartReq, userinfo *auth.UserI
|
|||||||
TemplateTag: templateTag,
|
TemplateTag: templateTag,
|
||||||
},
|
},
|
||||||
ModelInfo: gmodel.ModelInfo{
|
ModelInfo: gmodel.ModelInfo{
|
||||||
ModelJson: *modelInfo.ModelInfo,
|
ModelJson: modelJson,
|
||||||
},
|
},
|
||||||
FittingInfo: gmodel.FittingInfo{
|
FittingInfo: gmodel.FittingInfo{
|
||||||
FittingJson: fittingJson,
|
FittingJson: fittingJson,
|
||||||
|
@ -196,6 +196,7 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
|||||||
IsSelected: *cart.IsSelected > 0,
|
IsSelected: *cart.IsSelected > 0,
|
||||||
TemplateTag: templateTag,
|
TemplateTag: templateTag,
|
||||||
Logo: snapShot.Logo,
|
Logo: snapShot.Logo,
|
||||||
|
RenderImage: snapShot.RenderImage,
|
||||||
}
|
}
|
||||||
//是否有失效的
|
//是否有失效的
|
||||||
if description, ok := mapCartChange[cart.Id]; ok {
|
if description, ok := mapCartChange[cart.Id]; ok {
|
||||||
|
@ -55,6 +55,7 @@ type CartItem struct {
|
|||||||
IsSelected bool `json:"is_selected"` //是否选中
|
IsSelected bool `json:"is_selected"` //是否选中
|
||||||
TemplateTag string `json:"template_tag"` //模板标签
|
TemplateTag string `json:"template_tag"` //模板标签
|
||||||
Logo string `json:"logo"`
|
Logo string `json:"logo"`
|
||||||
|
RenderImage string `json:"render_image"` //渲染结果图
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProductInfo struct {
|
type ProductInfo struct {
|
||||||
|
@ -72,6 +72,7 @@ type CartItem {
|
|||||||
IsSelected bool `json:"is_selected"` //是否选中
|
IsSelected bool `json:"is_selected"` //是否选中
|
||||||
TemplateTag string `json:"template_tag"` //模板标签
|
TemplateTag string `json:"template_tag"` //模板标签
|
||||||
Logo string `json:"logo"`
|
Logo string `json:"logo"`
|
||||||
|
RenderImage string `json:"render_image"` //渲染结果图
|
||||||
}
|
}
|
||||||
type ProductInfo {
|
type ProductInfo {
|
||||||
ProductId int64 `json:"product_id"` //产品id
|
ProductId int64 `json:"product_id"` //产品id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user