TASK:product/pose transfer的回参添加sort和id

This commit is contained in:
2025-07-08 10:21:28 +08:00
parent 9fc8f52aca
commit 060db899cf
4 changed files with 10 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
package com.ai.da.service;
import com.ai.da.common.enums.CreditsEventsEnum;
import com.ai.da.mapper.primary.entity.CollectionSort;
import com.ai.da.mapper.primary.entity.Generate;
import com.ai.da.mapper.primary.entity.GenerateDetail;
import com.ai.da.model.dto.*;
@@ -57,7 +58,7 @@ public interface GenerateService extends IService<Generate> {
List<PoseTransformationVO> getPoseTransformationResultList(Long projectId, boolean like);
Object disOrLikePose(Long transformedId, String likeOrDislike, Long projectId, Long sortLikeParentId);
CollectionSort disOrLikePose(Long transformedId, String likeOrDislike, Long projectId, Long sortLikeParentId);
String modifyModelProportion(ModifyModelProportionDTO proportionDTO);

View File

@@ -1189,11 +1189,9 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
private Integer addPoseTransferLike(PoseTransformDTO poseTransformDTO, Long poseTransformationId){
if (Objects.nonNull(poseTransformDTO.getParentId())
&& !poseTransformDTO.getParentId().equals(0L)){
Object object = disOrLikePose(poseTransformationId, "like",
CollectionSort collectionSort = disOrLikePose(poseTransformationId, "like",
poseTransformDTO.getProjectId(), poseTransformDTO.getParentId());
if (object instanceof CollectionSort){
return ((CollectionSort) object).getSort();
}
return collectionSort.getSort();
}
return null;
}
@@ -1335,7 +1333,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
}
}
public Object disOrLikePose(Long transformedId, String likeOrDislike, Long projectId, Long collectionSortParentId){
public CollectionSort disOrLikePose(Long transformedId, String likeOrDislike, Long projectId, Long collectionSortParentId){
PoseTransformation poseTransformation = poseTransformationMapper.selectById(transformedId);
CollectionSort collectionSort = null;
if (Objects.nonNull(poseTransformation)){
@@ -1352,14 +1350,11 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
}
poseTransformation.setUpdateTime(LocalDateTime.now());
poseTransformationMapper.updateById(poseTransformation);
}else {
return false;
}
if (Objects.nonNull(collectionSort)) {
projectService.modifyProjectUpdateTime(projectId);
return collectionSort;
}
return true;
return collectionSort;
}
@Resource