package com.uas.account.entity;

import java.io.Serializable;
import java.util.Date;

import com.uas.account.AccountConfig;

/**
 * 调用业务系统的回调接口如果出错，会记录下来以便下次有机会再次同步过去
 * 
 * @author yingp
 *
 */
public class UserSpaceFailed implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Long id;
	private Date callTime;
	private String errMsg;
	private Long fromId;
	private String fromAppId;
	private String toAppId;

	public UserSpaceFailed() {
	}

	public UserSpaceFailed(UserSpace to, Exception e) {
		this.callTime = new Date();
		this.errMsg = e.getMessage();
		this.fromId = to.getId();
		this.fromAppId = AccountConfig.ACCOUNT_CENTER;
		this.toAppId = to.getAppId();
	}

	public UserSpaceFailed(UserSpace from, UserSpace to, Exception e) {
		this.callTime = new Date();
		this.errMsg = e.getMessage();
		this.fromId = from.getId();
		this.fromAppId = from.getAppId();
		this.toAppId = to.getAppId();
	}

	public Date getCallTime() {
		return callTime;
	}

	public void setCallTime(Date callTime) {
		this.callTime = callTime;
	}

	public String getErrMsg() {
		return errMsg;
	}

	public void setErrMsg(String errMsg) {
		this.errMsg = errMsg;
	}

	public Long getFromId() {
		return fromId;
	}

	public void setFromId(Long fromId) {
		this.fromId = fromId;
	}

	public String getFromAppId() {
		return fromAppId;
	}

	public void setFromAppId(String fromAppId) {
		this.fromAppId = fromAppId;
	}

	public String getToAppId() {
		return toAppId;
	}

	public void setToAppId(String toAppId) {
		this.toAppId = toAppId;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

}
