mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-26 22:15:06 +08:00
36 lines
835 B
Java
36 lines
835 B
Java
package com.jsowell.common.exception;
|
|
|
|
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
|
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
|
import lombok.Data;
|
|
|
|
@Data
|
|
public class BusinessException extends RuntimeException{
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
/**
|
|
* 错误码
|
|
*/
|
|
private String code;
|
|
|
|
/**
|
|
* 错误提示
|
|
*/
|
|
private String message;
|
|
|
|
public BusinessException(ReturnCodeEnum returnCodeEnum) {
|
|
this.code = returnCodeEnum.getValue();
|
|
this.message = returnCodeEnum.getLabel();
|
|
}
|
|
|
|
public BusinessException(String code, String message) {
|
|
this.code = code;
|
|
this.message = message;
|
|
}
|
|
|
|
public BusinessException(ThirdPartyReturnCodeEnum thirdPartyReturnCodeEnum) {
|
|
this.code = thirdPartyReturnCodeEnum.getRet();
|
|
this.message = thirdPartyReturnCodeEnum.getMsg();
|
|
}
|
|
}
|