|
|
@ -105,6 +105,17 @@ public class ResponseConfig implements ResponseBodyAdvice<Object> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 添加手动校验参数的异常处理
|
|
|
|
|
|
|
|
* @param exception 参数验证异常
|
|
|
|
|
|
|
|
* @return 通用返回值
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ExceptionHandler(IllegalArgumentException.class)
|
|
|
|
|
|
|
|
public GlobalResult<?> manualValidationExceptionResponse(IllegalArgumentException exception) {
|
|
|
|
|
|
|
|
log.error(exception.getMessage(), exception);
|
|
|
|
|
|
|
|
return GlobalResult.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), exception.getMessage(), "参数验证异常");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 未知异常处理
|
|
|
|
* 未知异常处理
|
|
|
|
*
|
|
|
|
*
|
|
|
|