双重预防项目-国泰新华二开定制版
heheng
2024-11-15 9015e720487b737743232b0b3aa464c2ac9e8d17
src/main/java/com/ruoyi/doublePrevention/exception/BusinessException.java
@@ -1,40 +1,40 @@
package com.ruoyi.doublePrevention.exception;
import com.ruoyi.doublePrevention.enums.ResultCodes;
public class BusinessException extends RuntimeException {
    private String code;
    private String message;
    public BusinessException(ResultCodes error) {
        super(error.getDesc());
        this.code = error.getCode();
        this.message = error.getDesc();
    }
    public BusinessException(String code,String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Override
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
}
package com.ruoyi.doublePrevention.exception;
import com.ruoyi.doublePrevention.enums.ResultCodes;
public class BusinessException extends RuntimeException {
    private String code;
    private String message;
    public BusinessException(ResultCodes error) {
        super(error.getDesc());
        this.code = error.getCode();
        this.message = error.getDesc();
    }
    public BusinessException(String code,String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Override
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
}