You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
그리고 각 에러에 대한 내용을 작성하고 throw new BusinessException을 작성함.
@Getter@AllArgsConstructorpublicenumUserErrorCodeimplementsErrorCode {
// 기본 사용자 관리USER_NOT_FOUND(HttpStatus.NOT_FOUND, 1001, "사용자를 찾을 수 없습니다."),
DUPLICATE_EMAIL(HttpStatus.CONFLICT, 1002, "이미 사용 중인 이메일입니다."),
// 계정 상태ACCOUNT_LOCKED(HttpStatus.FORBIDDEN, 1011, "계정이 잠금 상태입니다."),
ACCOUNT_DISABLED(HttpStatus.FORBIDDEN, 1012, "비활성화된 계정입니다."),
ACCOUNT_EXPIRED(HttpStatus.FORBIDDEN, 1013, "만료된 계정입니다."),
// 권한 관련INSUFFICIENT_PERMISSION(HttpStatus.FORBIDDEN, 1021, "권한이 부족합니다."),
ADMIN_ONLY_ACCESS(HttpStatus.FORBIDDEN, 1022, "관리자만 접근 가능합니다.");
privatefinalHttpStatushttpStatus;
privatefinalIntegercode;
privatefinalStringmessage;
}
thrownewBusinessException(UserErrorCode.USER_NOT_FOUND,
"이메일 " + email + "로 등록된 사용자를 찾을 수 없습니다.");
thrownewBusinessException(UserErrorCode.USER_NOT_FOUND);