From 42c12066ba2d6a2613842cde36fd4976c594199c Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Sat, 14 Sep 2024 14:06:58 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EB=AF=B8=EC=85=98=EA=B8=80=20=EB=AF=B8?= =?UTF-8?q?=EB=A6=AC=EB=B3=B4=EA=B8=B0=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=8B=A0=EA=B3=A0=ED=95=9C=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=EB=8A=94=20=EB=9C=A8=EC=A7=80?= =?UTF-8?q?=EC=95=8A=EA=B3=A0=20=EC=99=84=EB=A3=8C=20=EC=88=98=EB=8A=94=20?= =?UTF-8?q?=EC=A0=9C=EB=8C=80=EB=A1=9C=20=EB=9C=A8=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/farmclub/dto/res/GetMyFarmClubResponseDto.java | 3 ++- .../farmclub/repository/MissionPostRepositoryImpl.java | 5 +++-- .../domain/farmclub/vo/GetMissionPostListVo.java | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMyFarmClubResponseDto.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMyFarmClubResponseDto.java index 0cf4187..2924083 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMyFarmClubResponseDto.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMyFarmClubResponseDto.java @@ -40,7 +40,8 @@ public static List createSteps(List stepVoList, List images = new ArrayList<>(); for (GetMissionPostListVo mission: missionList) { if (step.num() == mission.stepNum()) { - images.add(mission.image()); + if (!mission.isReported()) + images.add(mission.image()); count++; } } 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 5207e67..e038e9d 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 @@ -41,11 +41,12 @@ public List getMissionPostStepNumAndImage(Long userId, Lon .select(Projections.constructor( GetMissionPostListVo.class, missionPost.stepNum, - missionPost.image)) + missionPost.image, + missionPost.id.in(reportMissionPostIds))) .from(missionPost) .join(missionPost.userFarmClub, userFarmClub) .join(userFarmClub.farmClub, farmClub) - .where(farmClub.id.eq(farmClubId).and(missionPost.id.notIn(reportMissionPostIds))) + .where(farmClub.id.eq(farmClubId)) .fetch(); } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/GetMissionPostListVo.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/GetMissionPostListVo.java index 4eb2f52..3af2bfe 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/GetMissionPostListVo.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/vo/GetMissionPostListVo.java @@ -4,7 +4,8 @@ public record GetMissionPostListVo( int stepNum, - String image + String image, + Boolean isReported ) { @QueryProjection public GetMissionPostListVo {