Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/#121-meeting
Browse files Browse the repository at this point in the history
  • Loading branch information
f1v3-dev authored Oct 1, 2024
2 parents a89f502 + 03ddf5a commit f89a68f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ public ResponseEntity<ScheduleResponseDto> getGuestSchedule(@PathVariable("meeti
return ResponseEntity.ok(responseDto);
}

/**
* 회원의 일정 작성 여부 확인 메서드입니다.
*
* @param meetingUuid 모임 UUID
* @param memberId 요청 회원 ID
* @return 회원의 일정 작성 여부
*/
@GetMapping("/check")
public ResponseEntity<Boolean> getMemberScheduleWrite(@PathVariable("meetingUuid") String meetingUuid,
@AuthenticationPrincipal Long memberId){
return ResponseEntity.ok(scheduleService.getMemberScheduleWrite(meetingUuid, memberId));
}

/**
* 비회원의 일정을 수정하는 메서드입니다.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.Optional;
import java.util.UUID;

/**
Expand Down Expand Up @@ -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> schedule = scheduleRepository.findByMemberIdAndMeetingUuid(memberId, meetingUuid);
return schedule.isPresent();
}


/**
* UUID 생성 메서드입니다.
*
Expand Down

0 comments on commit f89a68f

Please sign in to comment.