Skip to content

Commit

Permalink
Merge pull request #125 from dnd-side-project/feature/#124-member-sch…
Browse files Browse the repository at this point in the history
…edule-status

[feature] : 회원의 일정 작성 여부 확인 메소드 구현
  • Loading branch information
RTUnu12 authored Oct 1, 2024
2 parents d8191b9 + cb1f645 commit 03ddf5a
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 @@ -23,6 +23,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Optional;
import java.util.UUID;

/**
Expand Down Expand Up @@ -196,6 +197,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 03ddf5a

Please sign in to comment.