package cn.superdesk.uniorder.common.exception;

import cn.superdesk.uniorder.common.exception.constants.ExceptionMsg;

import java.io.Serializable;


/**
 * @Description: RuntimeException
 * @Author: linjinyu
 * @CreateDate: 2021/1/21 上午10:13
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/1/21 上午10:13
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public class UnifiedOrderRuntimeException extends RuntimeException implements Serializable {

	private static final long serialVersionUID = 1L;

	private Integer code;

	public UnifiedOrderRuntimeException() {
	}

	public UnifiedOrderRuntimeException(ExceptionMsg exceptionMsg) {
		super(exceptionMsg.getMsg());
		this.code = exceptionMsg.getCode();
	}

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

	public UnifiedOrderRuntimeException(ExceptionMsg exceptionMsg, String message) {
		super(exceptionMsg.getMsg() + " " + message);
		this.code = exceptionMsg.getCode();
	}

	public UnifiedOrderRuntimeException(String message, ExceptionMsg exceptionMsg) {
		super(message + " " + exceptionMsg.getMsg());
		this.code = exceptionMsg.getCode();
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}
}
