package com.ruoyi.common.exception;

/**
 * 部门数据不一致异常类
 * 
 * 当关联数据的部门不一致时抛出此异常
 * 
 * @author ruoyi
 */
public class DepartmentDataInconsistencyException extends RuntimeException
{
    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误提示
     */
    private String message;

    /**
     * 错误明细，内部调试错误
     */
    private String detailMessage;

    /**
     * 空构造方法，避免反序列化问题
     */
    public DepartmentDataInconsistencyException()
    {
    }

    public DepartmentDataInconsistencyException(String message)
    {
        this.message = message;
    }

    public DepartmentDataInconsistencyException(String message, Integer code)
    {
        this.message = message;
        this.code = code;
    }

    public DepartmentDataInconsistencyException(String message, Throwable e)
    {
        super(message, e);
        this.message = message;
    }

    public String getDetailMessage()
    {
        return detailMessage;
    }

    public DepartmentDataInconsistencyException setDetailMessage(String detailMessage)
    {
        this.detailMessage = detailMessage;
        return this;
    }

    @Override
    public String getMessage()
    {
        return message;
    }

    public DepartmentDataInconsistencyException setMessage(String message)
    {
        this.message = message;
        return this;
    }

    public Integer getCode()
    {
        return code;
    }
}