Skip to content

Commit

Permalink
RollBack: @checkpassword
Browse files Browse the repository at this point in the history
  • Loading branch information
KoungQ committed Jul 16, 2024
1 parent dd91204 commit 1d955f9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 53 deletions.

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/java/leets/weeth/domain/user/dto/UserDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import leets.weeth.domain.user.annotation.CheckPassword;
import leets.weeth.domain.user.entity.enums.Department;
import leets.weeth.domain.user.entity.enums.Position;

public class UserDTO {

@CheckPassword
public record SignUp (
@NotBlank String name,
@Email @NotBlank String email,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindException;
import org.springframework.web.ErrorResponse;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

Expand All @@ -28,13 +27,6 @@ public CommonResponse<Void> handle(Exception ex) {
return CommonResponse.createFailure(status, ex.getMessage());
}

@ExceptionHandler(MethodArgumentNotValidException.class) // BindException == @ModelAttribute 어노테이션으로 받은 파라미터의 @Valid 통해 발생한 Exception
public CommonResponse<Void> handle(MethodArgumentNotValidException e) { // 클라이언트의 오류일 경우
int status = 400; // 파라미터 값 실수이므로 4XX
log.error("Error", e);
return CommonResponse.createFailure(status, e.getAllErrors().get(0).getDefaultMessage()); // 디폴트 메세지 가져오기
}

@ExceptionHandler(BindException.class) // BindException == @ModelAttribute 어노테이션으로 받은 파라미터의 @Valid 통해 발생한 Exception
public CommonResponse<Void> handle(BindException e) { // 클라이언트의 오류일 경우
int status = 400; // 파라미터 값 실수이므로 4XX
Expand Down

0 comments on commit 1d955f9

Please sign in to comment.