From bec43f9e61d50b19131c9805ca58aa2509f26bff Mon Sep 17 00:00:00 2001 From: hyeonjaez Date: Sun, 22 Sep 2024 20:58:46 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20bookMark=20=ED=96=88=EB=8A=94=EC=A7=80?= =?UTF-8?q?=20=EA=B5=AC=ED=95=98=EB=8A=94=20=EC=A0=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gathering/repository/GatheringRepositoryImpl.java | 10 +++++----- .../repository/InformationRepositoryImpl.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/solitour_backend/solitour/gathering/repository/GatheringRepositoryImpl.java b/src/main/java/solitour_backend/solitour/gathering/repository/GatheringRepositoryImpl.java index b1a0fac..918b278 100644 --- a/src/main/java/solitour_backend/solitour/gathering/repository/GatheringRepositoryImpl.java +++ b/src/main/java/solitour_backend/solitour/gathering/repository/GatheringRepositoryImpl.java @@ -69,7 +69,7 @@ public List getGatheringRecommend(Long gatheringId, Long zoneCategoryParent.name, zoneCategoryChild.name, gathering.viewCount, - isGatheringBookmark(userId), + isGatheringBookmark(userId, gathering.id), countGreatGatheringByGatheringById(gathering.id), gathering.gatheringCategory.name, gathering.user.nickname, @@ -113,7 +113,7 @@ public Page getGatheringPageFilterAndOrder(Pageable page zoneCategoryParent.name, zoneCategoryChild.name, gathering.viewCount, - isGatheringBookmark(userId), + isGatheringBookmark(userId, gathering.id), countGreatGatheringByGatheringById(gathering.id), gathering.gatheringCategory.name, gathering.user.nickname, @@ -229,7 +229,7 @@ public List getGatheringLikeCountFromCreatedIn3(Long use zoneCategoryParent.name, zoneCategoryChild.name, gathering.viewCount, - isGatheringBookmark(userId), + isGatheringBookmark(userId, gathering.id), countGreatGatheringByGatheringById(gathering.id), gathering.gatheringCategory.name, gathering.user.nickname, @@ -327,11 +327,11 @@ private BooleanExpression isUserGreatGathering(Long userId) { .otherwise(false); } - private BooleanExpression isGatheringBookmark(Long userId) { + private BooleanExpression isGatheringBookmark(Long userId, NumberPath gatheringId) { return new CaseBuilder() .when(JPAExpressions.selectOne() .from(bookMarkGathering) - .where(bookMarkGathering.gathering.id.eq(gathering.id) + .where(bookMarkGathering.gathering.id.eq(gatheringId) .and(bookMarkGathering.user.id.eq(userId))) .exists()) .then(true) diff --git a/src/main/java/solitour_backend/solitour/information/repository/InformationRepositoryImpl.java b/src/main/java/solitour_backend/solitour/information/repository/InformationRepositoryImpl.java index 49a38c4..6b50234 100644 --- a/src/main/java/solitour_backend/solitour/information/repository/InformationRepositoryImpl.java +++ b/src/main/java/solitour_backend/solitour/information/repository/InformationRepositoryImpl.java @@ -91,7 +91,7 @@ public Page getInformationPageFilterAndOrder(Pageable zoneCategoryChild.name, information.category.name, information.viewCount, - isInformationBookmark(userId), + isInformationBookmark(userId, information.id), image.address, countGreatInformationByInformationById(information.id), isUserGreatInformation(userId) @@ -122,7 +122,7 @@ public List getInformationLikeCountFromCreatedIn3(Long zoneCategoryChild.name, category.parentCategory.name, information.viewCount, - isInformationBookmark(userId), + isInformationBookmark(userId, information.id), image.address, countGreatInformationByInformationById(information.id), // 파라미터 전달 isUserGreatInformation(userId) @@ -148,7 +148,7 @@ public List getInformationRecommend(Long informationId zoneCategoryChild.name, information.category.name, information.viewCount, - isInformationBookmark(userId), + isInformationBookmark(userId, information.id), image.address, countGreatInformationByInformationById(information.id), isUserGreatInformation(userId) @@ -272,11 +272,11 @@ private BooleanExpression isUserGreatInformation(Long userId) { .otherwise(false); } - private BooleanExpression isInformationBookmark(Long userId) { + private BooleanExpression isInformationBookmark(Long userId, NumberPath informationId) { return new CaseBuilder() .when(JPAExpressions.selectOne() .from(bookMarkInformation) - .where(bookMarkInformation.information.id.eq(information.id) + .where(bookMarkInformation.information.id.eq(informationId) .and(bookMarkInformation.user.id.eq(userId))) .exists()) .then(true)