From 7a4e13df025bbf9d04623d44a7a4afab35446002 Mon Sep 17 00:00:00 2001 From: RyuTaeUung Date: Mon, 30 Sep 2024 16:42:48 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=EC=9D=98=20?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EC=9E=91=EC=84=B1=20=EC=97=AC=EB=B6=80=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=20=EB=A9=94=EC=86=8C=EB=93=9C=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../schedule/controller/ScheduleController.java | 13 +++++++++++++ .../schedule/service/ScheduleService.java | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/main/java/com/dnd/jjakkak/domain/schedule/controller/ScheduleController.java b/src/main/java/com/dnd/jjakkak/domain/schedule/controller/ScheduleController.java index 82e2c3d..aadc4a2 100644 --- a/src/main/java/com/dnd/jjakkak/domain/schedule/controller/ScheduleController.java +++ b/src/main/java/com/dnd/jjakkak/domain/schedule/controller/ScheduleController.java @@ -86,6 +86,19 @@ public ResponseEntity getGuestSchedule(@PathVariable("meeti return ResponseEntity.ok(responseDto); } + /** + * 회원의 일정 작성 여부 확인 메서드입니다. + * + * @param meetingUuid 모임 UUID + * @param memberId 요청 회원 ID + * @return 회원의 일정 작성 여부 + */ + @GetMapping("/check-schedule-write") + public ResponseEntity getMemberScheduleWrite(@PathVariable("meetingUuid") String meetingUuid, + @AuthenticationPrincipal Long memberId){ + return ResponseEntity.ok(scheduleService.getMemberScheduleWrite(meetingUuid, memberId)); + } + /** * 비회원의 일정을 수정하는 메서드입니다. * diff --git a/src/main/java/com/dnd/jjakkak/domain/schedule/service/ScheduleService.java b/src/main/java/com/dnd/jjakkak/domain/schedule/service/ScheduleService.java index 023dc56..89ee487 100644 --- a/src/main/java/com/dnd/jjakkak/domain/schedule/service/ScheduleService.java +++ b/src/main/java/com/dnd/jjakkak/domain/schedule/service/ScheduleService.java @@ -23,8 +23,11 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Optional; import java.util.UUID; +import static org.eclipse.jdt.internal.compiler.problem.ProblemSeverities.Optional; + /** * 일정 서비스 클래스입니다. * @@ -196,6 +199,20 @@ public ScheduleResponseDto getMemberSchedule(String meetingUuid, Long memberId) return scheduleRepository.findScheduleWithDateOfSchedule(schedule.getScheduleId()); } + /** + * 회원의 일정 작성 여부 확인 메서드입니다. + * + * @param meetingUuid 모임 UUID + * @param memberId 요청 회원 ID + * @return 회원의 일정 작성 여부 + */ + @Transactional(readOnly = true) + public Boolean getMemberScheduleWrite(String meetingUuid, Long memberId){ + Optional schedule = scheduleRepository.findByMemberIdAndMeetingUuid(memberId, meetingUuid); + return schedule.isPresent(); + } + + /** * UUID 생성 메서드입니다. * From cb1f64529075f45f2441337674e7d5ebee9a0818 Mon Sep 17 00:00:00 2001 From: RyuTaeUung Date: Tue, 1 Oct 2024 17:19:47 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=EC=97=94=EB=93=9C=ED=8F=AC?= =?UTF-8?q?=EC=9D=B8=ED=8A=B8=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EC=9E=98?= =?UTF-8?q?=EB=AA=BB=EB=90=9C=20import=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jjakkak/domain/schedule/controller/ScheduleController.java | 2 +- .../dnd/jjakkak/domain/schedule/service/ScheduleService.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/dnd/jjakkak/domain/schedule/controller/ScheduleController.java b/src/main/java/com/dnd/jjakkak/domain/schedule/controller/ScheduleController.java index aadc4a2..4131d02 100644 --- a/src/main/java/com/dnd/jjakkak/domain/schedule/controller/ScheduleController.java +++ b/src/main/java/com/dnd/jjakkak/domain/schedule/controller/ScheduleController.java @@ -93,7 +93,7 @@ public ResponseEntity getGuestSchedule(@PathVariable("meeti * @param memberId 요청 회원 ID * @return 회원의 일정 작성 여부 */ - @GetMapping("/check-schedule-write") + @GetMapping("/check") public ResponseEntity getMemberScheduleWrite(@PathVariable("meetingUuid") String meetingUuid, @AuthenticationPrincipal Long memberId){ return ResponseEntity.ok(scheduleService.getMemberScheduleWrite(meetingUuid, memberId)); diff --git a/src/main/java/com/dnd/jjakkak/domain/schedule/service/ScheduleService.java b/src/main/java/com/dnd/jjakkak/domain/schedule/service/ScheduleService.java index 89ee487..417592d 100644 --- a/src/main/java/com/dnd/jjakkak/domain/schedule/service/ScheduleService.java +++ b/src/main/java/com/dnd/jjakkak/domain/schedule/service/ScheduleService.java @@ -26,8 +26,6 @@ import java.util.Optional; import java.util.UUID; -import static org.eclipse.jdt.internal.compiler.problem.ProblemSeverities.Optional; - /** * 일정 서비스 클래스입니다. *