From ac156f78fb7c9a8fda6c12220e3c49af05e2c1a0 Mon Sep 17 00:00:00 2001 From: bo-ram-bo-ram Date: Tue, 17 Sep 2024 00:33:18 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[fix]=20swagger=20=EC=88=9C=EC=84=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/api/notice/controller/NoticeControllerDocs.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/pickple/server/api/notice/controller/NoticeControllerDocs.java b/src/main/java/com/pickple/server/api/notice/controller/NoticeControllerDocs.java index bdd89a5..6a9dde9 100644 --- a/src/main/java/com/pickple/server/api/notice/controller/NoticeControllerDocs.java +++ b/src/main/java/com/pickple/server/api/notice/controller/NoticeControllerDocs.java @@ -39,9 +39,9 @@ ApiResponseDto createNotice( } ) ApiResponseDto getNoticeListByMoimId( + @PathVariable Long moimId, @Parameter(schema = @Schema(implementation = String.class), in = ParameterIn.PATH) - @GuestId Long guestId, - @PathVariable Long moimId + @GuestId Long geustId ); @Operation(summary = "공지사항 삭제") From afdb8d36b1f314068792ac10c904e2183eb56f0a Mon Sep 17 00:00:00 2001 From: bo-ram-bo-ram Date: Tue, 17 Sep 2024 00:34:28 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat=20:=20=EB=AA=A8=EC=9E=84=EC=9D=98=20ho?= =?UTF-8?q?st=EC=9D=BC=EA=B2=BD=EC=9A=B0=20=EC=B0=B8=EA=B0=80=EC=9E=90?= =?UTF-8?q?=EB=A7=8C=20=EC=A1=B0=ED=9A=8C=20=EA=B0=80=EB=8A=A5=ED=95=9C=20?= =?UTF-8?q?=EA=B3=B5=EC=A7=80=20=EC=A1=B0=ED=9A=8C=20=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/api/notice/service/NoticeQueryService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/pickple/server/api/notice/service/NoticeQueryService.java b/src/main/java/com/pickple/server/api/notice/service/NoticeQueryService.java index 710bd66..3645917 100644 --- a/src/main/java/com/pickple/server/api/notice/service/NoticeQueryService.java +++ b/src/main/java/com/pickple/server/api/notice/service/NoticeQueryService.java @@ -1,6 +1,7 @@ package com.pickple.server.api.notice.service; import com.pickple.server.api.comment.repository.CommentRepository; +import com.pickple.server.api.guest.repository.GuestRepository; import com.pickple.server.api.moim.domain.Moim; import com.pickple.server.api.moim.repository.MoimRepository; import com.pickple.server.api.moimsubmission.domain.MoimSubmission; @@ -25,6 +26,7 @@ public class NoticeQueryService { private final NoticeRepository noticeRepository; private final CommentRepository commentRepository; private final MoimSubmissionRepository moimSubmissionRepository; + private final GuestRepository guestRepository; public List getNoticeListByMoimId(Long moimId, Long guestId) { Moim moim = moimRepository.findMoimByIdOrThrow(moimId); @@ -71,7 +73,10 @@ private boolean checkOwner(Long userId, Long moimId) { } private boolean isUserAppliedToMoim(Long moimId, Long guestId) { - if (moimSubmissionRepository.existsByMoimIdAndGuestId(moimId, guestId)) { + if ((moimRepository.findMoimByIdOrThrow(moimId).getHost().getUser()) + .equals(guestRepository.findGuestByIdOrThrow(guestId).getUser().getId())) { + return true; + } else if (moimSubmissionRepository.existsByMoimIdAndGuestId(moimId, guestId)) { MoimSubmission moimSubmission = moimSubmissionRepository.findByMoimIdAndGuestId(moimId, guestId); // 참가한 상태일 경우(승인된 상태 - approved , completed