This commit is contained in:
laodaming 2023-09-11 17:41:07 +08:00
parent 67c8c70feb
commit 4eaf5b89d0

View File

@ -135,7 +135,7 @@ func (w *wsConnectItem) renderImage(data []byte) {
productSize *gmodel.FsProductSize productSize *gmodel.FsProductSize
) )
//获取信息 //获取信息
productSize, productTemplate, model3dInfo, err = w.getProductRelateionInfo(renderImageData) productSize, productTemplate, model3dInfo, err = w.getProductRelateionInfo(*renderImageData)
if err != nil { if err != nil {
logx.Error(err) logx.Error(err)
return return
@ -243,7 +243,7 @@ func (w *wsConnectItem) renderImage(data []byte) {
} }
// 获取模板相关信息(指定尺寸) // 获取模板相关信息(指定尺寸)
func (w *wsConnectItem) getProductRelateionInfo(renderImageData websocket_data.RenderImageReqMsg) (productSize *gmodel.FsProductSize, productTemplate *gmodel.FsProductTemplateV2, model3d *gmodel.FsProductModel3d, err error) { func (w *wsConnectItem) getProductRelateionInfo(renderImageData *websocket_data.RenderImageReqMsg) (productSize *gmodel.FsProductSize, productTemplate *gmodel.FsProductTemplateV2, model3d *gmodel.FsProductModel3d, err error) {
//指定尺寸 //指定尺寸
if renderImageData.RenderData.ProductSizeId > 0 { if renderImageData.RenderData.ProductSizeId > 0 {
productSize, err = w.logic.svcCtx.AllModels.FsProductSize.FindOneByIdProductId(w.logic.ctx, renderImageData.RenderData.ProductSizeId, renderImageData.RenderData.ProductId) productSize, err = w.logic.svcCtx.AllModels.FsProductSize.FindOneByIdProductId(w.logic.ctx, renderImageData.RenderData.ProductSizeId, renderImageData.RenderData.ProductId)
@ -270,6 +270,7 @@ func (w *wsConnectItem) getProductRelateionInfo(renderImageData websocket_data.R
logx.Error("failed to get product size:", err) logx.Error("failed to get product size:", err)
return nil, nil, nil, err return nil, nil, nil, err
} }
renderImageData.RenderData.ProductSizeId = productSize.Id
} }
//获取模型 //获取模型