parent
7d5096823d
commit
b407484298
@ -1,4 +1,4 @@
|
|||||||
package com.mashibing.constant;
|
package com.mashibing.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存模块中的各种前缀
|
* 缓存模块中的各种前缀
|
@ -1,4 +1,4 @@
|
|||||||
package com.mashibing.enums;
|
package com.mashibing.common.enums;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
package com.mashibing.exceptiion;
|
package com.mashibing.common.exception;
|
||||||
|
|
||||||
import com.mashibing.enums.ExceptionEnums;
|
import com.mashibing.common.enums.ExceptionEnums;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,22 +1,23 @@
|
|||||||
package com.mashibing.advice;
|
package com.mashibing.api.advice;
|
||||||
|
|
||||||
import com.mashibing.api.util.R;
|
import com.mashibing.api.util.R;
|
||||||
import com.mashibing.api.vo.ResultVO;
|
import com.mashibing.api.vo.ResultVO;
|
||||||
import com.mashibing.exceptiion.ApiException;
|
import com.mashibing.common.exception.ApiException;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kezhen
|
* @author zjw
|
||||||
* @date 2022/12/29
|
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class ApiExceptionHander {
|
public class ApiExceptionHandler{
|
||||||
|
|
||||||
@ExceptionHandler(ApiException.class)
|
@ExceptionHandler(ApiException.class)
|
||||||
public ResultVO apiException(ApiException ex){
|
public ResultVO apiException(ApiException ex){
|
||||||
System.out.println("exception.getCode() = " + ex.getCode());
|
System.out.println("ApiExceptionHandler.apiException");
|
||||||
return R.error(ex);
|
return R.error(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in new issue