-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/177 : 애플로그인 사용자명 랜덤 세팅 #198
Conversation
@@ -87,8 +92,12 @@ private Member loginWithApple(MemberRequest.LoginDTO request) { | |||
Optional<Member> foundMember = | |||
memberRepository.findBySocialIdAndSocialType(appleSocialId, SocialType.APPLE); | |||
|
|||
String nickName = ""; | |||
List<String> nickNameWords = nickNameClient.getNickName(NICK_NAME_FORMAT, NICK_NAME_COUNT, NICK_NAME_MAX_LENGTH).getWords(); | |||
if(!nickNameWords.isEmpty()) nickName = nickNameWords.get(0); |
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.
닉네임이 빈 리스트인 경우는 어떻게 될까요?
nickNameWords.stream().findFirst();를 이용하여 null인 경우에 대해 예외처리를 안해도 될지 궁금합니다!
*/ | ||
private String getOneRandomNickNameWithDetails(int maxLength) { | ||
List<String> nickNameWords = nickNameClient.getNickName(NICK_NAME_FORMAT, NICK_NAME_COUNT, maxLength).getWords(); | ||
if (!nickNameWords.isEmpty()) return nickNameWords.get(0); |
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.
앞선 리뷰와 동일한데, nickNameWords.stream().findFirst();를 사용하는 방식에 대해서는 어떻게 생각하시나요?
빈 리스트의 경우 ""를 반환할지 아니면 기본 닉네임을 반환할지도 고민이 되네요
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 안 넘어오게 응답(words)에 빈 리스트 할당하고, 기본 닉네임 하품하는 프로도로 세팅해두었습니다!👍 |
🚀 개요
애플로그인 시, 사용자명을 받을 수 없어 외부 API를 사용해 랜덤 사용자명을 세팅해줍니다.
⏳ 작업 내용
📝 논의사항