Skip to content
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

Merged
merged 8 commits into from
Oct 25, 2023
Merged

Feat/#9 닉네임 중복 체크 기능 구현 #43

merged 8 commits into from
Oct 25, 2023

Conversation

1o18z
Copy link
Collaborator

@1o18z 1o18z commented Oct 25, 2023

이슈번호

close: #9

작업 내용 설명

  • 닉네임 중복 체크 기능 구현

리뷰어에게 한마디

브랜치를 38 -> 9 변경하면서 꼬이게 되어 기존 PR을 닫고 새로 올렸습니다!
코멘트로 남겨주신 리뷰 반영하여 함께 푸시했습니다.

@1o18z 1o18z added the feat 기능 개발 label Oct 25, 2023
@1o18z 1o18z added this to the 1차 스프린트 milestone Oct 25, 2023
@1o18z 1o18z self-assigned this Oct 25, 2023
@github-actions
Copy link

github-actions bot commented Oct 25, 2023

Test Results

1 tests   1 ✔️  1s ⏱️
1 suites  0 💤
1 files    0

Results for commit c8ae9f6.

♻️ This comment has been updated with latest results.

Comment on lines 76 to +106

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);
}
}
Copy link
Collaborator Author

@1o18z 1o18z Oct 25, 2023

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처럼 분리하여 개선할 예정입니다! 🙇🏻‍♀️🙆🏻‍♀️

Copy link
Collaborator

@yumyeonghan yumyeonghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨씁니다!

Comment on lines 52 to 65
@GetMapping("/duplicate")
public ResponseEntity<Void> checkDuplicatedNickname(@RequestParam String nickname) {
userService.checkDuplicatedNickname(nickname);
return ResponseEntity.ok().build();
Copy link
Collaborator

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 = "이미 사용 중인 회사이메일입니다.";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

접근제어자 수정해주세용

@yumyeonghan yumyeonghan merged commit 6c00885 into dev Oct 25, 2023
3 checks passed
@yumyeonghan yumyeonghan deleted the feat/#9 branch October 25, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능 개발
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

🚀 [Feature] 닉네임 중복 체크 기능 구현
2 participants