Hello

42. ResponseDto 수정

by 볼빵빵오춘기

GlobalExceptionHandler

handleArgumentException() 수정한다.

@ExceptionHandler(value = IllegalArgumentException.class)
public ResponseDto<String> handleArgumentException(IllegalArgumentException e){
    return new ResponseDto<String>(HttpStatus.INTERNAL_SERVER_ERROR,e.getMessage());
}

 

ResponseDto

status Type 변경한다.

public class ResponseDto <T>{
    // HttpStatus status; 기존 HttpStatus -> int로 변경
    int status;
    T data;
}

 

블로그의 정보

Hello 춘기's world

볼빵빵오춘기

활동하기