This commit is contained in:
laodaming 2023-08-17 10:39:02 +08:00
parent 07dbf5eb6d
commit b222579633

View File

@ -191,6 +191,12 @@ func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data.Re
element, err := w.logic.svcCtx.AllModels.FsProductTemplateElement.FindOneByModelId(w.logic.ctx, *productTemplate.ModelId)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
// todo 没有图就给他返回一张默认(后面要删除)
defaultImg := w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{
RenderId: info.RenderId,
Image: "https://s3.us-west-1.amazonaws.com/storage.fusenpack.com/695463af6e9b93c003db39ddf728241f9523efc55b20dc37f30fe5d96ed54fb5",
})
w.sendToOutChan(defaultImg)
logx.Error("element info is not found,model_id = ", *productTemplate.ModelId)
return err
}