bugfix: collectionSortParentId非必穿;
This commit is contained in:
@@ -114,7 +114,7 @@ public class GenerateController {
|
||||
|
||||
@ApiOperation("喜欢或取消喜欢姿势变换生成的图片")
|
||||
@PostMapping("/likeOrDislike")
|
||||
public Response<Object> likeOrDislike(@ApiParam("id") @RequestParam Long transformedId, @ApiParam("like || dislike") @RequestParam String likeOrDislike, @RequestParam("projectId") Long projectId, @RequestParam("collectionSortParentId") Long collectionSortParentId) {
|
||||
public Response<Object> likeOrDislike(@ApiParam("id") @RequestParam Long transformedId, @ApiParam("like || dislike") @RequestParam String likeOrDislike, @RequestParam("projectId") Long projectId, @RequestParam(value = "collectionSortParentId", required = false) Long collectionSortParentId) {
|
||||
return Response.success(generateService.disOrLikePose(transformedId, likeOrDislike, projectId, collectionSortParentId));
|
||||
}
|
||||
|
||||
|
||||
@@ -1276,11 +1276,15 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
if (Objects.nonNull(poseTransformation)){
|
||||
if (likeOrDislike.equals("like")){
|
||||
poseTransformation.setIsLiked((byte)1);
|
||||
CollectionSort collectionSort = designService.addCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, collectionSortParentId);
|
||||
collectionSortId = collectionSort.getId();
|
||||
if (null != collectionSortParentId) {
|
||||
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, collectionSortParentId);
|
||||
if (null != collectionSortParentId) {
|
||||
designService.deleteCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, collectionSortParentId);
|
||||
}
|
||||
}
|
||||
poseTransformation.setUpdateTime(LocalDateTime.now());
|
||||
poseTransformationMapper.updateById(poseTransformation);
|
||||
|
||||
@@ -635,11 +635,15 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageResultId.get(0));
|
||||
Long collectionSortId = null;
|
||||
if (toProductImageResult1.getResultType().equals("Relight")) {
|
||||
CollectionSort collectionSort = designService.addCollectionSort(toProductImageResult1.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
collectionSortId = collectionSort.getId();
|
||||
if (null != productImageLikeDTO.getCollectionSortParentId()) {
|
||||
CollectionSort collectionSort = designService.addCollectionSort(toProductImageResult1.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
collectionSortId = collectionSort.getId();
|
||||
}
|
||||
}else {
|
||||
CollectionSort collectionSort = designService.addCollectionSort(toProductImageResult1.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
collectionSortId = collectionSort.getId();
|
||||
if (null != productImageLikeDTO.getCollectionSortParentId()) {
|
||||
CollectionSort collectionSort = designService.addCollectionSort(toProductImageResult1.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
collectionSortId = collectionSort.getId();
|
||||
}
|
||||
}
|
||||
return collectionSortId;
|
||||
}
|
||||
@@ -909,9 +913,13 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
toProductImageResult.setIsLike(0);
|
||||
toProductImageResultMapper.updateById(toProductImageResult);
|
||||
if (toProductImageResult.getResultType().equals("Relight")) {
|
||||
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
if (null != productImageLikeDTO.getCollectionSortParentId()) {
|
||||
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
}
|
||||
}else {
|
||||
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
if (null != productImageLikeDTO.getCollectionSortParentId()) {
|
||||
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
|
||||
Reference in New Issue
Block a user