TASK:生成获取结果接口返回parentId
This commit is contained in:
@@ -58,6 +58,8 @@ public interface UserLikeGroupService extends IService<UserLikeGroup> {
|
||||
|
||||
List<MagicToolResultVO> getToProductImageResultList(List<String> taskIdList);
|
||||
|
||||
Long getParentIdByElementIdAndElementType(Long elementId, String elementType);
|
||||
|
||||
JSONObject exportSearch(ExportSearchDTO exportSearchDTO);
|
||||
|
||||
CanvasElementUpload canvasElementUpload(MultipartFile file);
|
||||
|
||||
@@ -1259,6 +1259,8 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
poseTransformationVO.setFirstFrameUrl(minioUtil.getPreSignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME)));
|
||||
}
|
||||
poseTransformationVO.setResultType(CollectionType.POSE_TRANSFORM.getValue());
|
||||
Long parentId = userLikeGroupService.getParentIdByElementIdAndElementType(poseTransformationVO.getId(), CollectionType.POSE_TRANSFORM.getValue());
|
||||
poseTransformationVO.setParentId(parentId);
|
||||
poseTransformationVOS.add(poseTransformationVO);
|
||||
} else if(type.equals("wx")){
|
||||
poseTransformationVOS.add(getAnimateResult(taskId));
|
||||
@@ -1924,6 +1926,8 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
if (!StringUtil.isNullOrEmpty(poseTransformation.getFirstFrameUrl())){
|
||||
poseTransformationVO.setFirstFrameUrl(minioUtil.getPreSignedUrl(poseTransformation.getFirstFrameUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||
}
|
||||
Long parentId = userLikeGroupService.getParentIdByElementIdAndElementType(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue());
|
||||
poseTransformationVO.setParentId(parentId);
|
||||
// 执行积分扣除
|
||||
Long accountId = poseTransformation.getAccountId();
|
||||
Boolean flag = creditsService.taskCreditsDeduction(accountId, taskId);
|
||||
|
||||
@@ -797,7 +797,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
return results;
|
||||
}
|
||||
|
||||
private Long getParentIdByElementIdAndElementType(Long elementId, String elementType) {
|
||||
public Long getParentIdByElementIdAndElementType(Long elementId, String elementType) {
|
||||
QueryWrapper<CollectionSort> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(CollectionSort::getRelationId, elementId);
|
||||
|
||||
@@ -820,6 +820,8 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
return CollectionType.DESIGN.getValue();
|
||||
}else if (elementType.equals("ToProductImage")) {
|
||||
return CollectionType.TO_PRODUCT_IMAGE.getValue();
|
||||
}else if (elementType.equals("PoseTransfer")) {
|
||||
return CollectionType.POSE_TRANSFORM.getValue();
|
||||
}else {
|
||||
return "";
|
||||
}
|
||||
@@ -847,6 +849,8 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
ToProductImageResult toProductImage = toProductImageResultMapper.selectById(toProductImageResult.getElementId());
|
||||
magicToolResultVO.setSourceUrl(minioUtil.getPreSignedUrl(toProductImage.getUrl(), 24 * 60));
|
||||
}
|
||||
Long parentId = getParentIdByElementIdAndElementType(toProductImageResult.getId(), toProductImageResult.getResultType());
|
||||
magicToolResultVO.setParentId(parentId);
|
||||
return magicToolResultVO;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user