Skip to content

Commit

Permalink
[mod] #5 중복 검증 로직 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
seokjun01 committed Jan 3, 2025
1 parent b32ee64 commit 0cbff45
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,17 @@ public Void completeRegistration(MemberSignUpRequestDto signUpRequestDto, UserDe
}

private void validateSignUpData(MemberSignUpRequestDto signUpRequestDto) {
// 성별 필수 선택 검증
if (signUpRequestDto.getGender() == null) {
throw new CommonException(ErrorCode.INVALID_GENDER);
}

// 전화번호 유효성 검증
if (!signUpRequestDto.getPhoneNumber().matches("^\\d{10,11}$")) {
throw new CommonException(ErrorCode.INVALID_PHONE_NUMBER);
}
// 전화번호 중복 검증
if (memberRepository.existsByPhoneNumber(signUpRequestDto.getPhoneNumber())) {
throw new CommonException(ErrorCode.DUPLICATE_PHONE_NUMBER); // 전화번호 중복 예외 발생
}

// 학번 유효성 검증
if (signUpRequestDto.getStudentNumber() == null || String.valueOf(signUpRequestDto.getStudentNumber()).length() != 9) {
throw new CommonException(ErrorCode.INVALID_STUDENT_NUMBER);
}
// 학번 중복 검증
if (memberRepository.existsByStudentNumber(signUpRequestDto.getStudentNumber())) {
throw new CommonException(ErrorCode.DUPLICATE_STUDENT_NUMBER); // 학번 중복 예외 발생
}


// 닉네임 중복 확인
if (memberRepository.existsByNickname(signUpRequestDto.getNickname())) {
throw new CommonException(ErrorCode.DUPLICATE_NICKNAME);
Expand Down

0 comments on commit 0cbff45

Please sign in to comment.