package com.uas.account.entity;

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

import com.uas.account.AccountConfig;

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

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

	public UserFailed() {
	}

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

	public UserFailed(User from, User to, Exception e) {
		this.callTime = new Date();
		this.errMsg = e.getMessage();
		this.fromId = from.getId();
		this.fromSpaceId = from.getSpaceId();
		this.fromAppId = from.getAppId();
		this.toSpaceId = to.getSpaceId();
		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 Long getFromSpaceId() {
		return fromSpaceId;
	}

	public void setFromSpaceId(Long fromSpaceId) {
		this.fromSpaceId = fromSpaceId;
	}

	public String getFromAppId() {
		return fromAppId;
	}

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

	public Long getToSpaceId() {
		return toSpaceId;
	}

	public void setToSpaceId(Long toSpaceId) {
		this.toSpaceId = toSpaceId;
	}

	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;
	}

}
