From f12b997d9458854c529cfe43a3de5b5aa3f9e850 Mon Sep 17 00:00:00 2001 From: JeongInJae <93825184+injae-348@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:42:11 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20isLiked=20=ED=95=84=EB=93=9C=EA=B0=80?= =?UTF-8?q?=20null=EB=A1=9C=20=EB=B0=98=ED=99=98=20=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20(#160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: isLiked 필드 제거 * refactor: isLiked 기본값 false 설정 * comment: 필요없는 주석 제거(반환 값 명시해주는 주석) --- src/main/java/econo/buddybridge/post/dto/PostResDto.java | 2 +- src/main/java/econo/buddybridge/post/entity/Post.java | 2 -- .../econo/buddybridge/post/repository/PostRepositoryImpl.java | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/econo/buddybridge/post/dto/PostResDto.java b/src/main/java/econo/buddybridge/post/dto/PostResDto.java index 7b37c16..29f8506 100644 --- a/src/main/java/econo/buddybridge/post/dto/PostResDto.java +++ b/src/main/java/econo/buddybridge/post/dto/PostResDto.java @@ -44,7 +44,7 @@ public PostResDto(Post post) { post.getModifiedAt(), post.getPostStatus(), post.getDisabilityType(), - post.getIsLiked() + false ); } diff --git a/src/main/java/econo/buddybridge/post/entity/Post.java b/src/main/java/econo/buddybridge/post/entity/Post.java index 4506579..a2ea0e8 100644 --- a/src/main/java/econo/buddybridge/post/entity/Post.java +++ b/src/main/java/econo/buddybridge/post/entity/Post.java @@ -62,8 +62,6 @@ public class Post extends BaseEntity { @OneToMany(mappedBy = "post", orphanRemoval = true, cascade = CascadeType.ALL) private final List comments = new ArrayList<>(); - private Boolean isLiked = false; - public void changeStatus(PostStatus status){ // 상태 변경 this.postStatus = status; } diff --git a/src/main/java/econo/buddybridge/post/repository/PostRepositoryImpl.java b/src/main/java/econo/buddybridge/post/repository/PostRepositoryImpl.java index 3eaa54d..89f34e2 100644 --- a/src/main/java/econo/buddybridge/post/repository/PostRepositoryImpl.java +++ b/src/main/java/econo/buddybridge/post/repository/PostRepositoryImpl.java @@ -66,7 +66,6 @@ public PostCustomPage findPosts(Long memberId, Integer page, Integer size, Strin buildPostDisabilityTypeExpression(disabilityType), buildPostAssistanceTypeExpression(assistanceType)) .fetchOne(); - // content, totalElements, last return new PostCustomPage(content, totalElements, content.size() < size); }