Closed j00r6 closed 6 months ago
MemberController.class
// 이메일 중복 체크
if (service.checkLoginIdDuplicate(request.getEmail())) {
return ResponseEntity
.status(HttpStatus.BAD_REQUEST)
.body("이메일 중복!");
}
// 닉네임 중복 체크
if (service.checkNickNameDuplicate(request.getNickName())) {
return ResponseEntity
.status(HttpStatus.BAD_REQUEST)
.body("닉네임 중복!");
}
코드는 상단 참조
Ref.
참조 1 - GlobalExceptionHandler 구현 (블로그) 참조 2 - ExceptionCode Custom 심화과정 (블로그) 참조 3 - GlobalExceptionHandler (블로그) 참조 4 - ResponseEntity 에 대해 (블로그)
구현내용
4df5af2d8e7f0d5b730312a1dbba2ae711778608
BusinessLogicException.class
>GlobalExceptionHandler.class
로 변경ExceptionCode
삭제 > Exception 별로 개별 Class 구현적용
Exception 호출
MemberService.class
LoginIdDuplicateException 구현
exception
패키지 내부에서LoginIdDuplicateException.class
를 구현GlobalExceptionHandler
내부에 로직 구현POSTMAN
요청
응답