From a6aa880d81dd39306d716c414bbc100e1240aa00 Mon Sep 17 00:00:00 2001 From: tlarbals824 Date: Wed, 24 May 2023 15:42:03 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EB=8C=93=EA=B8=80=20=EC=88=98=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=EC=8B=9C=20=EC=82=AD=EC=A0=9C=EB=90=9C=20?= =?UTF-8?q?=EB=8C=93=EA=B8=80=EA=B9=8C=EC=A7=80=20=ED=8F=AC=ED=95=A8?= =?UTF-8?q?=ED=95=B4=EC=84=9C=20=EC=B9=B4=EC=9A=B4=ED=8A=B8=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/comment/domain/repository/CommentRepository.java | 3 ++- .../domain/comment/domain/service/CommentQueryService.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/kusitms/samsion/domain/comment/domain/repository/CommentRepository.java b/src/main/java/com/kusitms/samsion/domain/comment/domain/repository/CommentRepository.java index b0143c1..01206d8 100644 --- a/src/main/java/com/kusitms/samsion/domain/comment/domain/repository/CommentRepository.java +++ b/src/main/java/com/kusitms/samsion/domain/comment/domain/repository/CommentRepository.java @@ -10,7 +10,8 @@ public interface CommentRepository extends JpaRepository { - long countByAlbumId(Long albumId); + + long countByAlbumIdAndDeletedFalse(Long albumId); @Query("select c from Comment c where c.album.id = :albumId order by c.parent.id asc nulls first, c.createdDate asc") Slice findByAlbumId(Pageable pageable, @Param("albumId") Long albumId); } diff --git a/src/main/java/com/kusitms/samsion/domain/comment/domain/service/CommentQueryService.java b/src/main/java/com/kusitms/samsion/domain/comment/domain/service/CommentQueryService.java index fc3220d..5b80eb5 100644 --- a/src/main/java/com/kusitms/samsion/domain/comment/domain/service/CommentQueryService.java +++ b/src/main/java/com/kusitms/samsion/domain/comment/domain/service/CommentQueryService.java @@ -31,7 +31,7 @@ public Slice getCommentByAlbumId(Pageable pageable, Long albumId) { @Cacheable(value = CachingStoreConst.COMMENT_COUNT_CACHE_NAME, key = "#albumId") public long getCommentCountByAlbumId(Long albumId){ - return commentRepository.countByAlbumId(albumId); + return commentRepository.countByAlbumIdAndDeletedFalse(albumId); } }