Skip to content

Commit

Permalink
feat: nickname blank error
Browse files Browse the repository at this point in the history
  • Loading branch information
junseokkim committed Nov 1, 2023
1 parent cbadc50 commit 2be15fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ public class MemberService implements EntityLoader<Member, Long> {
private final MemberMapper memberMapper;

public MemberIdResponse createMember(MemberSignUpRequest request) {
// TODO Validation 추가하기
// 닉네임 공백 여부 체크
if(request.getNickname().isBlank()) throw new ExceptionHandler(ErrorStatus.NICKNAME_BLANK);

// 이메일, 닉네임 중복 여부 체크
Optional<Member> member = memberRepository.findMemberByEmail(request.getEmail());
if(member.isPresent()) throw new ExceptionHandler(ErrorStatus.MEMBER_EXISTED);
member = memberRepository.findMemberByNickname(request.getNickname());
// 닉네임 중복 여부 체크
Optional<Member> member = memberRepository.findMemberByNickname(request.getNickname());
if(member.isPresent()) throw new ExceptionHandler(ErrorStatus.NICKNAME_DUPLICATED);

// TODO 비밀번호 암호화
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum ErrorStatus implements BaseErrorCode {
MEMBER_EXISTED(HttpStatus.BAD_REQUEST, "MEMBER4002", "이미 사용중인 계정입니다."),
PASSWORD_NOT_MATCH(HttpStatus.BAD_REQUEST, "MEMBER4003","비밀번호가 일치하지 않습니다."),
NICKNAME_DUPLICATED(HttpStatus.BAD_REQUEST, "MEMBER4004", "이미 사용중인 닉네임입니다."),
NICKNAME_BLANK(HttpStatus.BAD_REQUEST, "MEMBER4005", "닉네임은 공백일 수 없습니다."),

// 꽃 관련 응답
FLOWER_NOT_FOUND(HttpStatus.BAD_REQUEST, "FLOWER4001", "존재하지 않는 꽃입니다."),
Expand Down

0 comments on commit 2be15fa

Please sign in to comment.