|
|
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; |
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.ConstraintViolation; |
|
|
|
import javax.validation.ConstraintViolation; |
|
|
|
import javax.validation.ConstraintViolationException; |
|
|
|
import javax.validation.ConstraintViolationException; |
|
|
|
|
|
|
|
import javax.validation.ValidationException; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
@ -113,4 +114,11 @@ public class RestExceptionHandler { |
|
|
|
return R.getResult(BaseResponseCode.METHOD_ARGUMENT_NOT_VALID_EXCEPTION.getCode(), builder.toString()); |
|
|
|
return R.getResult(BaseResponseCode.METHOD_ARGUMENT_NOT_VALID_EXCEPTION.getCode(), builder.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ExceptionHandler |
|
|
|
|
|
|
|
@ResponseStatus(HttpStatus.NOT_FOUND) |
|
|
|
|
|
|
|
public R handle(ValidationException e) { |
|
|
|
|
|
|
|
log.error("Exception,exception:{}", e, e); |
|
|
|
|
|
|
|
return new R(404, e.getMessage()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|