否则调用不了
ParaChecker.isOK(bindingResult);
public class ParaChecker { static BaseResult paraCheck(BindingResult bindingResult) { if (bindingResult.hasErrors()) { Map<String, Object> map = new HashMap<>(); List<FieldError> fieldErrors = bindingResult.getFieldErrors(); for (FieldError fieldError : fieldErrors) { map.put(fieldError.getField(), fieldError.getDefaultMessage()); } return ResultUtil.error(303, "参数异常").add("errorFields", map); } return null; } public static BaseResult isOK(BindingResult bindingResult) { BaseResult baseResult = paraCheck(bindingResult); if (baseResult != null) { return baseResult; } else { return null; } } }