From 0970127f6861dd8f923f37b3d6c01fce1a612f91 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 17 Jun 2025 10:10:00 +0800 Subject: [PATCH] TASK: collection sort; --- .../java/com/ai/da/controller/GenerateController.java | 4 ++-- .../java/com/ai/da/model/dto/ProductImageLikeDTO.java | 2 +- .../java/com/ai/da/service/impl/DesignServiceImpl.java | 8 ++++---- .../java/com/ai/da/service/impl/GenerateServiceImpl.java | 6 +++--- .../com/ai/da/service/impl/UserLikeGroupServiceImpl.java | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/ai/da/controller/GenerateController.java b/src/main/java/com/ai/da/controller/GenerateController.java index 13b61bd3..5ec38bef 100644 --- a/src/main/java/com/ai/da/controller/GenerateController.java +++ b/src/main/java/com/ai/da/controller/GenerateController.java @@ -114,8 +114,8 @@ public class GenerateController { @ApiOperation("喜欢或取消喜欢姿势变换生成的图片") @PostMapping("/likeOrDislike") - public Response likeOrDislike(@ApiParam("id") @RequestParam Long transformedId, @ApiParam("like || dislike") @RequestParam String likeOrDislike, @RequestParam("projectId") Long projectId, @RequestParam("sortLikeParentId") Long sortLikeParentId) { - return Response.success(generateService.disOrLikePose(transformedId, likeOrDislike, projectId, sortLikeParentId)); + public Response likeOrDislike(@ApiParam("id") @RequestParam Long transformedId, @ApiParam("like || dislike") @RequestParam String likeOrDislike, @RequestParam("projectId") Long projectId, @RequestParam("collectionSortParentId") Long collectionSortParentId) { + return Response.success(generateService.disOrLikePose(transformedId, likeOrDislike, projectId, collectionSortParentId)); } @ApiOperation(value = "修改模特比例") diff --git a/src/main/java/com/ai/da/model/dto/ProductImageLikeDTO.java b/src/main/java/com/ai/da/model/dto/ProductImageLikeDTO.java index 0cd96fd1..a88f8df5 100644 --- a/src/main/java/com/ai/da/model/dto/ProductImageLikeDTO.java +++ b/src/main/java/com/ai/da/model/dto/ProductImageLikeDTO.java @@ -9,5 +9,5 @@ public class ProductImageLikeDTO { private List toProductImageResultId; private Long projectId; - private Long sortLikeParentId; + private Long collectionSortParentId; } diff --git a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java index 789ec55c..11a120bc 100644 --- a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java @@ -1247,8 +1247,8 @@ public class DesignServiceImpl extends ServiceImpl impleme } @Override - public CollectionSort addCollectionSort(Long relationId, String relationType, Long projectId, Long sortParentId) { - int sort = getNextSort(projectId, sortParentId); + public CollectionSort addCollectionSort(Long relationId, String relationType, Long projectId, Long collectionSortParentId) { + int sort = getNextSort(projectId, collectionSortParentId); CollectionSort userLikeSort = new CollectionSort(); // userLikeSort.setUserLikeGroupId(userGroupId); // userLikeSort.setUserLikeId(relationId); @@ -1256,8 +1256,8 @@ public class DesignServiceImpl extends ServiceImpl impleme userLikeSort.setRelationId(relationId); userLikeSort.setRelationType(relationType); userLikeSort.setSort(sort); - if (null != sortParentId) { - userLikeSort.setParentId(sortParentId); + if (null != collectionSortParentId) { + userLikeSort.setParentId(collectionSortParentId); } collectionSortMapper.insert(userLikeSort); return userLikeSort; diff --git a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java index 046344fb..4351dced 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -1255,17 +1255,17 @@ public class GenerateServiceImpl extends ServiceImpl i return vos; } - public Object disOrLikePose(Long transformedId, String likeOrDislike, Long projectId, Long sortLikeParentId){ + public Object disOrLikePose(Long transformedId, String likeOrDislike, Long projectId, Long collectionSortParentId){ PoseTransformation poseTransformation = poseTransformationMapper.selectById(transformedId); Long collectionSortId = null; if (Objects.nonNull(poseTransformation)){ if (likeOrDislike.equals("like")){ poseTransformation.setIsLiked((byte)1); - CollectionSort collectionSort = designService.addCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, sortLikeParentId); + CollectionSort collectionSort = designService.addCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, collectionSortParentId); collectionSortId = collectionSort.getId(); }else if (likeOrDislike.equals("dislike")){ poseTransformation.setIsLiked((byte)0); - designService.deleteCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, sortLikeParentId); + designService.deleteCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, collectionSortParentId); } poseTransformation.setUpdateTime(LocalDateTime.now()); poseTransformationMapper.updateById(poseTransformation); diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index 7399142a..83ee3b1f 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -618,10 +618,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl