From 0b67b7cea3a0799231d9cbb8c30f754a7f11a604 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Tue, 30 Jul 2024 02:13:35 +0900 Subject: [PATCH 1/7] =?UTF-8?q?[fix]=20Q=20=ED=81=B4=EB=9E=98=EC=8A=A4=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 3f831893..cbe79a71 100644 --- a/build.gradle +++ b/build.gradle @@ -73,20 +73,25 @@ tasks.named('test') { useJUnitPlatform() } -// Querydsl 설정부 -def generated = 'src/main/generated' - -// querydsl QClass 파일 생성 위치를 지정 -tasks.withType(JavaCompile) { - options.getGeneratedSourceOutputDirectory().set(file(generated)) +test { + useJUnitPlatform() } -// java source set 에 querydsl QClass 위치 추가 +def generatedDir = "src/main/generated" + + sourceSets { - main.java.srcDirs += [ generated ] + main { + java { + srcDirs = ['src/main/java'] + } + // Mybatis 쿼리 xml 위치때문에 조정 + resources{ + srcDir "${project.projectDir}/src/main/java" + } + } } -// gradle clean 시에 QClass 디렉토리 삭제 clean { - delete file(generated) + delete file(generatedDir) } \ No newline at end of file From 49161e6ce16f50acf4f869c144256d1f5b499c74 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Tue, 30 Jul 2024 02:15:04 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[fix]=20=EB=AF=B8=EC=85=98=ED=8F=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=EA=B0=92=20=EB=B0=8F=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=EC=97=90=20userId=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/farmclub/controller/FarmClubController.java | 7 ++++--- .../domain/farmclub/helper/MissionPostHelper.java | 5 +++++ .../domain/farmclub/service/MissionPostService.java | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java index 09ecb732..ec0dd416 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java @@ -111,11 +111,12 @@ public BaseResponseDto deleteMissionPostLike( return BaseResponseDto.of(SuccessCode.SUCCESS, null); } - @GetMapping("/{id}/mission") + @GetMapping("/{farmClubId}/mission") public BaseResponseDto getMissionPostList( - @PathVariable Long id + @AuthenticationPrincipal CustomUser user, + @PathVariable Long farmClubId ) { - return BaseResponseDto.of(SuccessCode.SUCCESS, missionPostService.getMissionPostList(id)); + return BaseResponseDto.of(SuccessCode.SUCCESS, missionPostService.getMissionPostList(user.getUserId(), farmClubId)); } @GetMapping("/mission/{id}") diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/MissionPostHelper.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/MissionPostHelper.java index 820a0e8b..2ab5fbef 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/MissionPostHelper.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/MissionPostHelper.java @@ -4,6 +4,7 @@ import com.modernfarmer.farmusspring.domain.farmclub.exception.FarmClubErrorCode; import com.modernfarmer.farmusspring.domain.farmclub.exception.custom.FarmClubEntityNotFoundException; import com.modernfarmer.farmusspring.domain.farmclub.repository.MissionPostRepository; +import com.modernfarmer.farmusspring.domain.farmclub.vo.MissionPostVo; import com.modernfarmer.farmusspring.domain.history.vo.MissionPostHistoryVo; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -26,6 +27,10 @@ public List getMissionPostHistory(Long userFarmClubId) { return missionPostRepository.getMissionPostHistory(userFarmClubId); } + public List getMissionPostList(Long userId, Long missionPostId) { + return missionPostRepository.getMissionPostList(userId, missionPostId); + } + @Transactional public void deleteMissionPostLike(Long userId, Long missionPostId) { missionPostRepository.deleteMissionPostLike(userId, missionPostId); diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/MissionPostService.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/MissionPostService.java index 334dd729..1f1e5495 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/MissionPostService.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/MissionPostService.java @@ -68,8 +68,8 @@ public void deleteMissionPostLike(Long userId, Long missionPostId) { missionPostHelper.deleteMissionPostLike(userId, missionPostId); } - public GetMissionPostListResponseDto getMissionPostList(Long farmClubId) { - List missionPosts = missionPostRepository.getMissionPostList(farmClubId); + public GetMissionPostListResponseDto getMissionPostList(Long userId, Long farmClubId) { + List missionPosts = missionPostHelper.getMissionPostList(userId, farmClubId); return GetMissionPostListResponseDto.of(missionPosts); } From 35ec8ae1f3b09bfd4c86dad4e386c35091cbe518 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Tue, 30 Jul 2024 02:15:23 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[fix]=20=EB=AF=B8=EC=85=98=ED=8F=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80(=EC=A2=8B?= =?UTF-8?q?=EC=95=84=EC=9A=94=20=EC=97=AC=EB=B6=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../farmusspring/domain/farmclub/vo/MissionPostVo.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/MissionPostVo.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/MissionPostVo.java index d73d54e0..a4b54180 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/MissionPostVo.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/MissionPostVo.java @@ -12,10 +12,11 @@ public record MissionPostVo( String image, String content, Long likeCount, - Long commentCount + Long commentCount, + Boolean isLiked ) { @QueryProjection - public MissionPostVo(MissionPost missionPost, User user, Long likeCount, Long commentCount) + public MissionPostVo(MissionPost missionPost, User user, Long likeCount, Long commentCount, Boolean isLiked) { this( missionPost.getId(), @@ -25,7 +26,8 @@ public MissionPostVo(MissionPost missionPost, User user, Long likeCount, Long co missionPost.getImage(), missionPost.getContent(), likeCount, - commentCount + commentCount, + isLiked ); } } From d1a5ab5940a9537e3419939da36da6b7a6db8585 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Tue, 30 Jul 2024 02:15:41 +0900 Subject: [PATCH 4/7] =?UTF-8?q?[fix]=20=EB=AF=B8=EC=85=98=ED=8F=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EC=BF=BC=EB=A6=AC=EC=88=98=EC=A0=95(=EC=A2=8B=EC=95=84?= =?UTF-8?q?=EC=9A=94=20=EC=97=AC=EB=B6=80=20=EC=B6=94=EA=B0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/MissionPostRepositoryCustom.java | 2 +- .../farmclub/repository/MissionPostRepositoryImpl.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryCustom.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryCustom.java index 81c78143..eb923fe0 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryCustom.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryCustom.java @@ -12,7 +12,7 @@ public interface MissionPostRepositoryCustom { List getMissionPostStepNumAndImage(Long farmClubId); List getMissionPostComment(Long missionPostId); - List getMissionPostList(Long missionPostId); + List getMissionPostList(Long userId, Long missionPostId); List getMissionPostHistory(Long missionPostId); void deleteMissionPostLike(Long userId, Long missionPostId); } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryImpl.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryImpl.java index d0eff5f9..473ab625 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryImpl.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/repository/MissionPostRepositoryImpl.java @@ -51,7 +51,7 @@ public List getMissionPostComment(Long missionPostId) { } @Override - public List getMissionPostList(Long farmClubId) { + public List getMissionPostList(Long userId, Long farmClubId) { return queryFactory .select(new QMissionPostVo( @@ -62,7 +62,13 @@ public List getMissionPostList(Long farmClubId) { .where(missionPostLike.missionPost.eq(missionPost)), JPAExpressions.select(missionPostComment.count()) .from(missionPostComment) - .where(missionPostComment.missionPost.eq(missionPost)))) + .where(missionPostComment.missionPost.eq(missionPost)), + JPAExpressions.selectOne() + .from(missionPostLike) + .where(missionPostLike.missionPost.eq(missionPost) + .and(missionPostLike.user.id.eq(userId))) + .exists() + )) .from(missionPost) .join(missionPost.userFarmClub, userFarmClub) .join(userFarmClub.myVeggie, myVeggie) From 72fef986b84bc28867601d2430af536be4a73ef0 Mon Sep 17 00:00:00 2001 From: seungryeol Date: Wed, 31 Jul 2024 02:56:07 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[fix]=20=EB=A9=94=EC=9D=B8=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=8B=A4=EC=9D=B4=EC=96=B4=EB=A6=AC=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EC=A1=B0=EA=B1=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20->=20=EC=98=A4=EB=8A=98=20=EC=93=B4=20=EC=9D=BC?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../myveggiegarden/controller/MyVeggieDiaryController.java | 4 +--- .../domain/myveggiegarden/repository/DiaryRepository.java | 5 +++++ .../domain/myveggiegarden/service/MyVeggieDiaryService.java | 6 ++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieDiaryController.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieDiaryController.java index 403a9d69..e9efd747 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieDiaryController.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieDiaryController.java @@ -63,9 +63,7 @@ public BaseResponseDto checkTodayDiary( } @GetMapping(value = "/{myVeggieId}/one") - public BaseResponseDto selectDiaryOne( - @PathVariable("myVeggieId") Long myVeggieId - ) { + public BaseResponseDto selectDiaryOne(@PathVariable("myVeggieId") Long myVeggieId) { return myVeggieDiaryService.selectDiaryOne(MyVeggie.builder().id(myVeggieId).build()); } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/DiaryRepository.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/DiaryRepository.java index 6b43cfd6..68481a3d 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/DiaryRepository.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/DiaryRepository.java @@ -46,4 +46,9 @@ public interface DiaryRepository extends JpaRepository { ) List findDiaryByFarmClub(@Param("farmClubId") Long farmClubId); + @Query("SELECT d FROM diary AS d WHERE d.myVeggie = :myVeggie AND FUNCTION('DATE', d.createdDate) = CURRENT_DATE") + List findDiaryByToday(@Param("myVeggie") MyVeggie myVeggie); + + + } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieDiaryService.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieDiaryService.java index e34426c9..0f1dd7e3 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieDiaryService.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieDiaryService.java @@ -141,10 +141,8 @@ public void updateComment(User user, Long diaryCommentId, String content) { myVeggieRepository.updateDiaryCommentByIdAndUserId(diaryCommentId, user, content); } @Transactional - public BaseResponseDto selectDiaryOne( - MyVeggie myVeggie - ) { - List diaryList = selectDiaryByMyVeggie(myVeggie); + public BaseResponseDto selectDiaryOne(MyVeggie myVeggie) { + List diaryList = diaryRepository.findDiaryByToday(myVeggie); if(diaryList.isEmpty()) { return BaseResponseDto.of(MyVeggieGardenSuccessCode.NOT_FOUND_DIARY, null); } From c4a2a0c09f9c4a2af997e9123966293985037fd1 Mon Sep 17 00:00:00 2001 From: seungryeol Date: Wed, 31 Jul 2024 03:20:31 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[fix]=20=EB=A9=94=EC=9D=B8=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=A3=A8=ED=8B=B4=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EC=8B=9C=20=EC=A1=B0=EA=B1=B4=20=EC=B6=94=EA=B0=80=20->=20?= =?UTF-8?q?=EC=98=A4=EB=8A=98=20=ED=95=B4=EC=95=BC=ED=95=A0=20=EB=A3=A8?= =?UTF-8?q?=ED=8B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../myveggiegarden/controller/MyVeggieRoutineController.java | 4 +--- .../domain/myveggiegarden/repository/RoutineRepository.java | 3 +++ .../domain/myveggiegarden/service/MyVeggieRoutineService.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieRoutineController.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieRoutineController.java index d019f8ae..2b553155 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieRoutineController.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieRoutineController.java @@ -62,9 +62,7 @@ public BaseResponseDto checkVeggieRoutine(@Validated @RequestBody RoutineChec } @GetMapping(value = "/{myVeggieId}") - public BaseResponseDto selectMyVeggieRoutineById( - @PathVariable("myVeggieId") Long myVeggieId - ) { + public BaseResponseDto selectRoutineToday(@PathVariable("myVeggieId") Long myVeggieId) { MyVeggie myVeggie = MyVeggie.builder().id(myVeggieId).build(); List result = myVeggieRoutineService.selectMyVeggieRoutineById(myVeggie); return BaseResponseDto.of(SuccessCode.SUCCESS, result); diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/RoutineRepository.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/RoutineRepository.java index 7a875755..28fc8837 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/RoutineRepository.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/RoutineRepository.java @@ -39,4 +39,7 @@ public interface RoutineRepository extends JpaRepository { "FUNCTION('YEAR', r.date) = FUNCTION('YEAR', :month) AND FUNCTION('MONTH', r.date) = FUNCTION('MONTH', :month)") List findRoutineAndRoutineAndMyVeggieByMonthWithUser(@Param("month") Date month, @Param("user") User user ); + + @Query("SELECT r FROM routine AS r WHERE r.myVeggie = :myVeggie AND r.date = CURRENT_DATE") + List findRoutineByIdAndToday(@Param("myVeggie") MyVeggie myVeggie); } \ No newline at end of file diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieRoutineService.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieRoutineService.java index 16eb71d0..ee1fcdcd 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieRoutineService.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieRoutineService.java @@ -51,7 +51,7 @@ public void eraseRoutine(RoutineDelete routineDelete) { @Transactional public List selectMyVeggieRoutineById(MyVeggie myVeggie) { - List routineList = myVeggieRepository.findMyVeggieRoutineById(myVeggie); + List routineList = routineRepository.findRoutineByIdAndToday(myVeggie); return MyVeggieRoutine.processData(routineList); } From c64e9fd5bc9610fa48bf75eabd504cf0fd3f57fc Mon Sep 17 00:00:00 2001 From: seungryeol Date: Wed, 31 Jul 2024 03:59:43 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[fix]=20=EC=9D=BC=EA=B8=B0=20=EB=8C=93?= =?UTF-8?q?=EA=B8=80=20=EC=A1=B0=ED=9A=8C=20=EC=A1=B0=EA=B1=B4=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20/=20farmClubId=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MyVeggieDiaryController.java | 11 +++-------- .../myveggiegarden/repository/DiaryRepository.java | 5 ++--- .../myveggiegarden/service/MyVeggieDiaryService.java | 7 ++----- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieDiaryController.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieDiaryController.java index 403a9d69..d5d57d12 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieDiaryController.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/controller/MyVeggieDiaryController.java @@ -107,14 +107,9 @@ public BaseResponseDto cancelLike( return BaseResponseDto.of(SuccessCode.SUCCESS, null); } - @GetMapping(value = "/{diaryId}/{farmClubId}/comment") - public BaseResponseDto selectComment( - @AuthenticationPrincipal CustomUser user, - @PathVariable("diaryId") Long diaryId, - @PathVariable("farmClubId") Long farmClubId - ) { - List diaryCommentList = myVeggieDiaryService.selectComment(user.getUserId(), diaryId, farmClubId); - + @GetMapping(value = "/{diaryId}/comment") + public BaseResponseDto selectComment(@AuthenticationPrincipal CustomUser user, @PathVariable("diaryId") Long diaryId) { + List diaryCommentList = myVeggieDiaryService.selectComment(user.getUserId(), diaryId); return BaseResponseDto.of(SuccessCode.SUCCESS, diaryCommentList); } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/DiaryRepository.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/DiaryRepository.java index 6b43cfd6..77087673 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/DiaryRepository.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/repository/DiaryRepository.java @@ -32,9 +32,8 @@ public interface DiaryRepository extends JpaRepository { "JOIN FETCH dc.diary AS d " + "JOIN FETCH d.myVeggie AS mv " + "JOIN FETCH mv.user " + - "JOIN FETCH d.farmClub " + - "WHERE d.id = :diaryId AND d.farmClub.id = :farmClubId AND d.isOpen = true") - List findDiary(@Param("diaryId") Long diaryId, @Param("farmClubId") Long farmClubId); + "WHERE d.id = :diaryId") + List findDiaryById(@Param("diaryId") Long diaryId); @Query("SELECT d FROM diary AS d " + diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieDiaryService.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieDiaryService.java index e34426c9..73de7865 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieDiaryService.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieDiaryService.java @@ -158,11 +158,8 @@ public BaseResponseDto selectDiaryOne( @Transactional - public List selectComment( - Long userId, Long diaryId, Long farmClubId - ) { - - List diaryCommentList = diaryRepository.findDiary(diaryId, farmClubId); + public List selectComment(Long userId, Long diaryId) { + List diaryCommentList = diaryRepository.findDiaryById(diaryId); List diaryCommentContent = DiaryCommentContent.processData(diaryCommentList, userId); return diaryCommentContent; }