Open
Conversation
jjunhub
reviewed
Oct 26, 2024
Comment on lines
+59
to
61
| // 일치하는 회원이 있다면, AuthLoginResponse로 변환하여 반환한다. | ||
| return AuthLoginResponse.from(member); | ||
| } |
Member
There was a problem hiding this comment.
주석 틀리게 작성됐던 것 지금 확인했네요.. 좋습니다!!@@!
jjunhub
reviewed
Oct 26, 2024
Comment on lines
+66
to
+72
| Optional<Member> OptionalMember = memberRepository.findById(memberId); | ||
|
|
||
| if(OptionalMember.isEmpty()) { | ||
| throw new IllegalArgumentException(); | ||
| } | ||
|
|
||
| Member member = OptionalMember.get(); |
Member
There was a problem hiding this comment.
꼼꼼하게 잘 처리해주셨습니다!
Optional을 직접적으로 사용하는 것보다는 아래처럼 사용하는 것이 권장되는 편입니다.
Suggested change
| Optional<Member> OptionalMember = memberRepository.findById(memberId); | |
| if(OptionalMember.isEmpty()) { | |
| throw new IllegalArgumentException(); | |
| } | |
| Member member = OptionalMember.get(); | |
| Member member = memberRepository.findById(memberId) | |
| .orElseThrow(() -> new IllegalArgumentException("에러 발생")); | |
Java Optional 바르게 사용하기 블로그 글 한 번 정독해보시는 것을 추천드릴게요!!
jjunhub
reviewed
Oct 26, 2024
Member
jjunhub
left a comment
There was a problem hiding this comment.
전체적으로 완벽하게 잘 해주셨습니다. 첨부해드린 블로그 꼭 읽어보시고 추후 프로젝트에 적용하시면 코드 가독성 측면에서 많이 좋아질 거라구 생각합니다. 고생하셨습니다!
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.