package com.chuanxia.mcp.exception;

import com.chuanxia.mcp.bean.enums.ResultStatusEnum;
import lombok.Data;

/**
 * 自定制异常类
 *

 */
@Data
public class ResultException extends RuntimeException {
    private int code;
    private String message;

    public ResultException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResultException(ResultStatusEnum resultStatusEnum) {
        this.code = resultStatusEnum.getCode();
        this.message = resultStatusEnum.getMessage();
    }
}

