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..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 @@ -86,6 +86,19 @@ public ResponseEntity getGuestSchedule(@PathVariable("meeti return ResponseEntity.ok(responseDto); } + /** + * 회원의 일정 작성 여부 확인 메서드입니다. + * + * @param meetingUuid 모임 UUID + * @param memberId 요청 회원 ID + * @return 회원의 일정 작성 여부 + */ + @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 1ed74c3..6a272b3 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 @@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; +import java.util.Optional; import java.util.UUID; /** @@ -201,6 +202,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 생성 메서드입니다. *