-
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/#9 닉네임 중복 체크 기능 구현 #43
Conversation
|
||
public void checkDuplicatedNickname(String nickname) { | ||
if (userRepository.findUserByProfileNickname(nickname).isPresent()) { | ||
throw new IllegalArgumentException("이미 존재하는 닉네임입니다."); | ||
} | ||
} | ||
|
||
public void checkDuplicatedUser(OAuthInfoResponse response) { | ||
if (userRepository.existsUserByOauthInfo_oauthProviderAndOauthInfo_oauthProviderId( | ||
response.oAuthProvider(), response.oAuthProviderId())) { | ||
throw new IllegalArgumentException(ALREADY_REGISTERED_MESSAGE); | ||
} | ||
} |
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.
AuthService에 책임이 너무 많고 유저 중복 체크와 닉네임 중복 체크 로직은 UserService에 위치하는게 더 적절할 것 같아 AuthService에서 UserService로 이동했습니다!
추후에 AuthService의 역할을 OAuthService처럼 분리하여 개선할 예정입니다! 🙇🏻♀️🙆🏻♀️
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.
수고하셨씁니다!
@GetMapping("/duplicate") | ||
public ResponseEntity<Void> checkDuplicatedNickname(@RequestParam String nickname) { | ||
userService.checkDuplicatedNickname(nickname); | ||
return ResponseEntity.ok().build(); |
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.
dto 로 뺴서 @Valid 적용해주세용!
@@ -20,6 +21,7 @@ | |||
public class UserService { | |||
|
|||
public static final String EXISTED_COMPANY_EMAIL_ERROR = "이미 사용 중인 회사이메일입니다."; |
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.
접근제어자 수정해주세용
이슈번호
close: #9
작업 내용 설명
리뷰어에게 한마디
브랜치를 38 -> 9 변경하면서 꼬이게 되어 기존 PR을 닫고 새로 올렸습니다!
코멘트로 남겨주신 리뷰 반영하여 함께 푸시했습니다.