-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] 회원 별 데일리 루틴 리스트 조회 #41
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
너무 고생하셨습니다~~ 소현님은 오늘 끝나시겠군요..
} | ||
|
||
private Member findMember(Long id) { | ||
return memberRepository.findById(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
별거 아니긴 한데 유저가 없을 때는 NULL 값이 들어오는데 에러 처리가 따로 필요할까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csb9427
기본적으로 JPA에서 제공하는 findById 메소드는 Optional 타입을 반환해요. Member 값이 없을 때는 빈 Optional 값을 보내게 됩니다. 해당 값에 대해 아래의 .orElseThrow(() -> new EntityNotFoundException(INVALID_MEMBER.getMeesage()));
코드로 이러한 경우를 처리하게 됩니다!
아래 Optional 관련 레퍼런스 추가해두겠습니다 :)
https://mangkyu.tistory.com/70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다~!!
@@ -90,4 +86,16 @@ private void checkRoutineForMember(Member member, MemberDailyRoutine routine) { | |||
throw new IllegalStateException(INACCESSIBLE_ROUTINE.getMeesage()); | |||
} | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
원시값 사용 관련 이슈 생성해놨습니다~!
✨ Related Issue
📝 기능 구현 명세
🐥 추가적인 언급 사항