BUGFIX: 模特preview;

This commit is contained in:
shahaibo
2023-10-16 10:53:37 +08:00
parent 0dd765123f
commit 5e70f7ca73
5 changed files with 43 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ import com.ai.da.model.dto.*;
import com.ai.da.model.vo.DesignCollectionVO;
import com.ai.da.model.vo.DesignItemDetailVO;
import com.ai.da.model.vo.DesignLikeVO;
import com.ai.da.python.vo.DesignPythonObjects;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -78,4 +79,6 @@ public interface DesignService extends IService<Design> {
DesignItemDetailVO detail(Long designPythonOutfitId,Long designItemId);
Integer designProcess(String processId);
void relationImageId(DesignPythonObjects objects);
}

View File

@@ -317,7 +317,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
// return saveDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone());
}
private void relationImageId(DesignPythonObjects pythonObjects) {
@Override
public void relationImageId(DesignPythonObjects pythonObjects) {
if (Objects.isNull(pythonObjects)) {
return;
}

View File

@@ -2,6 +2,7 @@ package com.ai.da.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.json.JSONUtil;
import com.ai.da.common.config.exception.BusinessException;
import com.ai.da.common.enums.LibraryLevel1TypeEnum;
import com.ai.da.common.enums.SingleOverallEnum;
import com.ai.da.common.utils.CopyUtil;
@@ -17,15 +18,18 @@ import com.ai.da.model.vo.LibraryModelPointVO;
import com.ai.da.model.vo.LibraryUpdateVo;
import com.ai.da.python.PythonService;
import com.ai.da.python.vo.DesignPythonObjects;
import com.ai.da.service.DesignService;
import com.ai.da.service.LibraryModelPointService;
import com.ai.da.service.LibraryService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.omg.PortableServer.LIFESPAN_POLICY_ID;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.Arrays;
@@ -49,6 +53,8 @@ public class LibraryModelPointServiceImpl extends ServiceImpl<LibraryModelPointM
private LibraryService libraryService;
@Resource
private PythonService pythonService;
@Resource
private DesignService designService;
@Override
public LibraryModelPointVO saveOrEditTemplatePoint(LibraryModelPointDTO libraryModelPointDTO) {
@@ -109,9 +115,21 @@ public class LibraryModelPointServiceImpl extends ServiceImpl<LibraryModelPointM
public String modelsDot( ModelsDotDTO modelsDotDTO) {
DesignPythonObjects objects =pythonService.covertModelsDotParam(
modelsDotDTO, SingleOverallEnum.OVERALL.getRealName(),"");
pythonService.design(objects);
return objects.getObjects().get(0).getBasic().getSave_name();
designService.relationImageId(objects);
JSONObject jsonObject = pythonService.designNew(objects);
JSONObject data = jsonObject.getJSONObject("data");
if (data == null) {
throw new BusinessException("python design response is null");
}
JSONObject jsonObject1 = data.getJSONObject("0");
if (jsonObject1 == null) {
throw new BusinessException("python design response is null");
}
String synthesisUrl = jsonObject1.getString("synthesis_url");
if (StringUtils.isEmpty(synthesisUrl)) {
throw new BusinessException("python design response synthesis_url is null");
}
return synthesisUrl;
}
@Override