Skip to content

Commit

Permalink
Merge pull request #58 from feedback-forest/develop
Browse files Browse the repository at this point in the history
Release 2.0
  • Loading branch information
Bumnote authored Oct 17, 2024
2 parents cb2f71f + b6f15ad commit 5688a6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/zerobase/sijak/exception/ErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public enum ErrorCode {
ALREADY_PUSH_HEART(404, "이미 찜을 해놓았습니다.", "ALREADY PUSH HEART"),
HEART_REMOVE_FAILED(404, "찜클래스 삭제에 실패했습니다.", "HEART REMOVE FAILED"),
INVALID_LENGTH_NICKNAME(404, "띄어쓰기 없이 2자 ~ 12자까지 가능해요.", "INVALID LENGTH NICKNAME"),
INVALID_CV_NICKNAME(404, "자음, 모음은 닉네임 설정 불가합니다.", "INVALID CV NICKNAME"),
INVALID_CHARACTER_NICKNAME(404, "한글, 영문, 숫자만 입력해주세요.", "INVALID CHARACTER NICKNAME"),
ALREADY_NICKNAME_EXIST(404, "이미 사용중인 닉네임이에요.", "ALREADY NICKNAME EXIST"),
GEOLOCATION_NOT_EXIST(404, "해당 위도, 경도의 행정구역을 알 수 없습니다.", "GEOLOCATION NOT EXIST"),
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/zerobase/sijak/service/KakaoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ public void validateNickname(String token, NicknameRequest nicknameRequest) {
throw new InvalidNicknameException("띄어쓰기 없이 2자 ~ 12자까지 가능해요.", ErrorCode.INVALID_LENGTH_NICKNAME);
if (nickname.length() < 2 || nickname.length() > 12)
throw new InvalidNicknameException("띄어쓰기 없이 2자 ~ 12자까지 가능해요.", ErrorCode.INVALID_LENGTH_NICKNAME);
if (nickname.matches(".*[ㄱ-ㅎㅏ-ㅣ].*"))
throw new InvalidNicknameException("자음, 모음은 닉네임 설정 불가합니다.", ErrorCode.INVALID_CV_NICKNAME);
if (!nickname.matches("^[가-힣a-zA-Z0-9]+$"))
throw new InvalidNicknameException("자음, 모음은 닉네임 설정 불가합니다.", ErrorCode.INVALID_CHARACTER_NICKNAME);
throw new InvalidNicknameException("한글, 영문, 숫자만 입력해주세요.", ErrorCode.INVALID_CHARACTER_NICKNAME);
if (memberRepository.existsByProfileNickname(nickname))
throw new AlreadyNicknameExistException("이미 사용중인 닉네임이예요.", ErrorCode.ALREADY_NICKNAME_EXIST);
}
Expand All @@ -259,6 +261,8 @@ public void validateNickname(String token, NicknameRequest nicknameRequest) {
throw new InvalidNicknameException("띄어쓰기 없이 2자 ~ 12자까지 가능해요.", ErrorCode.INVALID_LENGTH_NICKNAME);
if (nickname.length() < 2 || nickname.length() > 12)
throw new InvalidNicknameException("띄어쓰기 없이 2자 ~ 12자까지 가능해요.", ErrorCode.INVALID_LENGTH_NICKNAME);
if (nickname.matches(".*[ㄱ-ㅎㅏ-ㅣ].*"))
throw new InvalidNicknameException("자음, 모음은 닉네임 설정 불가합니다.", ErrorCode.INVALID_CV_NICKNAME);
if (!nickname.matches("^[가-힣a-zA-Z0-9]+$"))
throw new InvalidNicknameException("한글, 영문, 숫자만 입력해주세요.", ErrorCode.INVALID_CHARACTER_NICKNAME);
if (memberRepository.existsByProfileNickname(nickname))
Expand Down

0 comments on commit 5688a6a

Please sign in to comment.