TASK:模块化;
This commit is contained in:
@@ -2536,14 +2536,11 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
toProductImageResultQueryWrapper.lambda().eq(ToProductImageResult::getTaskIdBatch, query.getTaskId());
|
||||
List<ToProductImageResult> toProductImageResultList = toProductImageResultMapper.selectList(toProductImageResultQueryWrapper);
|
||||
for (ToProductImageResult toProductImageResult : toProductImageResultList) {
|
||||
String key = toProductImageResultKey + ":" + toProductImageResult.getTaskId();
|
||||
MagicToolResultVO magicToolResultVO = new Gson().fromJson(redisUtil.getFromString(key), MagicToolResultVO.class);
|
||||
if (!Objects.isNull(magicToolResultVO) && !StringUtil.isNullOrEmpty(magicToolResultVO.getUrl())) {
|
||||
String url = magicToolResultVO.getUrl();
|
||||
if (url.substring(url.lastIndexOf("/") + 1).equals("white_image.jpg")) {
|
||||
magicToolResultVO.setStatus("Invalid");
|
||||
} else {
|
||||
magicToolResultVO.setUrl(minioUtil.getPreSignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||
MagicToolResultVO magicToolResultVO = new MagicToolResultVO();
|
||||
magicToolResultVO.setId(toProductImageResult.getId());
|
||||
magicToolResultVO.setTaskId(toProductImageResult.getTaskId());
|
||||
magicToolResultVO.setStatus("Success");
|
||||
magicToolResultVO.setUrl(minioUtil.getPreSignedUrl(toProductImageResult.getUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||
magicToolResultVO.setResultType(toProductImageResult.getResultType());
|
||||
magicToolResultVO.setElementId(toProductImageResult.getElementId());
|
||||
magicToolResultVO.setElementType(toProductImageResult.getElementType());
|
||||
@@ -2554,11 +2551,6 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(toProductImageResult.getElementId());
|
||||
magicToolResultVO.setSourceUrl(minioUtil.getPreSignedUrl(tDesignPythonOutfit.getDesignUrl(), 24 * 60));
|
||||
}
|
||||
}
|
||||
} else if (Objects.isNull(magicToolResultVO)) {
|
||||
magicToolResultVO = new MagicToolResultVO();
|
||||
}
|
||||
// if (!StringUtil.isNullOrEmpty(magicToolResultVO.getStatus())) collect.add(magicToolResultVO.getStatus());
|
||||
results.add(magicToolResultVO);
|
||||
}
|
||||
result.setToProductImage(results);
|
||||
@@ -2569,14 +2561,11 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
toProductImageResultQueryWrapper.lambda().eq(ToProductImageResult::getTaskIdBatch, query.getTaskId());
|
||||
List<ToProductImageResult> toProductImageResultList = toProductImageResultMapper.selectList(toProductImageResultQueryWrapper);
|
||||
for (ToProductImageResult toProductImageResult : toProductImageResultList) {
|
||||
String key = relightResultKey + ":" + toProductImageResult.getTaskId();
|
||||
MagicToolResultVO magicToolResultVO = new Gson().fromJson(redisUtil.getFromString(key), MagicToolResultVO.class);
|
||||
if (!Objects.isNull(magicToolResultVO) && !StringUtil.isNullOrEmpty(magicToolResultVO.getUrl())) {
|
||||
String url = magicToolResultVO.getUrl();
|
||||
if (url.substring(url.lastIndexOf("/") + 1).equals("white_image.jpg")) {
|
||||
magicToolResultVO.setStatus("Invalid");
|
||||
} else {
|
||||
magicToolResultVO.setUrl(minioUtil.getPreSignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||
MagicToolResultVO magicToolResultVO = new MagicToolResultVO();
|
||||
magicToolResultVO.setId(toProductImageResult.getId());
|
||||
magicToolResultVO.setTaskId(toProductImageResult.getTaskId());
|
||||
magicToolResultVO.setStatus("Success");
|
||||
magicToolResultVO.setUrl(minioUtil.getPreSignedUrl(toProductImageResult.getUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||
magicToolResultVO.setResultType(toProductImageResult.getResultType());
|
||||
magicToolResultVO.setElementId(toProductImageResult.getElementId());
|
||||
magicToolResultVO.setElementType(toProductImageResult.getElementType());
|
||||
@@ -2587,11 +2576,6 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageResult.getElementId());
|
||||
magicToolResultVO.setSourceUrl(minioUtil.getPreSignedUrl(toProductImageResult1.getUrl(), 24 * 60));
|
||||
}
|
||||
}
|
||||
} else if (Objects.isNull(magicToolResultVO)) {
|
||||
magicToolResultVO = new MagicToolResultVO();
|
||||
}
|
||||
// if (!StringUtil.isNullOrEmpty(magicToolResultVO.getStatus())) collect.add(magicToolResultVO.getStatus());
|
||||
results.add(magicToolResultVO);
|
||||
}
|
||||
result.setRelight(results);
|
||||
|
||||
Reference in New Issue
Block a user