从统一接口获取pose transformation的生成记录

This commit is contained in:
2025-03-25 16:20:00 +08:00
parent 50ecc3a177
commit 67225c1a96
5 changed files with 24 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ public class ModuleChooseVO {
private CavasModuleChooseVO canvas;
private List<CollectionSketchVO> boundingBox;
// private moodBoardModuleChooseVO poseTransfer;
private List<PoseTransformationVO> poseTransfer;
// private moodBoardModuleChooseVO patternMaking3D;
private SketchReconstructionVO deReconstruction;
}

View File

@@ -13,6 +13,8 @@ public class PoseTransformationVO {
private String taskId;
private String productImage;
private String gifUrl;
private String videoUrl;
@@ -22,4 +24,14 @@ public class PoseTransformationVO {
private byte isLiked;
private String status;
public PoseTransformationVO(Long id, String taskId, String gifUrl, String videoUrl, String firstFrameUrl, byte isLiked, String status) {
this.id = id;
this.taskId = taskId;
this.gifUrl = gifUrl;
this.videoUrl = videoUrl;
this.firstFrameUrl = firstFrameUrl;
this.isLiked = isLiked;
this.status = status;
}
}

View File

@@ -52,7 +52,7 @@ public interface GenerateService extends IService<Generate> {
PoseTransformationVO getPoseTransformationResult(String taskId);
List<PoseTransformationVO> getPoseTransformationResultList(String projectId);
List<PoseTransformationVO> getPoseTransformationResultList(Long projectId);
Boolean disOrLikePose(Long transformedId, String likeOrDislike);

View File

@@ -1018,13 +1018,18 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
}
}
public List<PoseTransformationVO> getPoseTransformationResultList(String projectId){
public List<PoseTransformationVO> getPoseTransformationResultList(Long projectId){
List<PoseTransformation> poseTransformations = poseTransformationMapper.selectList(new QueryWrapper<PoseTransformation>().eq("project_id", projectId).eq("is_liked", 1));
List<PoseTransformationVO> vos = new ArrayList<>();
if (poseTransformations != null && poseTransformations.size() > 1){
poseTransformations.forEach(item -> {
PoseTransformationVO poseTransformationVO = CopyUtil.copyObject(item, PoseTransformationVO.class);
PoseTransformationVO poseTransformationVO = new PoseTransformationVO();
poseTransformationVO.setId(item.getId());
poseTransformationVO.setProductImage(minioUtil.getPreSignedUrl(item.getProductImage(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
poseTransformationVO.setGifUrl(minioUtil.getPreSignedUrl(item.getGifUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
poseTransformationVO.setVideoUrl(minioUtil.getPreSignedUrl(item.getVideoUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
poseTransformationVO.setFirstFrameUrl(minioUtil.getPreSignedUrl(item.getFirstFrameUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
poseTransformationVO.setIsLiked(item.getIsLiked());
vos.add(poseTransformationVO);
});
}

View File

@@ -1549,6 +1549,9 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
}else if (module.equals(Module.deReconstruction.name())){
SketchReconstructionVO sketchReconstruction = generateService.getSketchReconstruction(projectDTO.getId());
moduleChooseVO.setDeReconstruction(sketchReconstruction);
}else if (module.equals(Module.poseTransfer.name())){
List<PoseTransformationVO> poseTransformationResultList = generateService.getPoseTransformationResultList(projectDTO.getId());
moduleChooseVO.setPoseTransfer(poseTransformationResultList);
}
}
return moduleChooseVO;