每个方法都加这段校验太麻烦了
准备做一个统一异常处理@ControllerAdvice
后台代码:
package com.nanjing.gulimall.product.exception;
import com.nanjing.common.exception.BizCodeEnum;
import com.nanjing.common.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import java.util.HashMap;
import java.util.Map;
/**
* @author zhou
* @version 1.0
* @