@Slf4j
@RestControllerAdvice
public class DefaultExceptionHandler {
/**缺少必要的参数*/
@ExceptionHandler(value = MissingServletRequestParameterException.class)
public Result missingParameterHandler(HttpServletRequest request,MissingServletRequestParameterException e) {
this.logError(request,e);
return Result.fail(ErrorCode.PARAM_MISSING);
}
/**参数类型不匹配*/
@ExceptionHandler(value = MethodArgumentTypeMismatchException.class)
public Result methodArgumentTypeMismatchException(HttpServletRequest request,MethodArgumentTypeMismatchException e) {
this.logError(request,e);
return Result