View Javadoc
1   package com.foxinmy.weixin4j.qy.suite;
2   
3   import java.io.Serializable;
4   import java.util.Date;
5   
6   import javax.xml.bind.annotation.XmlAccessType;
7   import javax.xml.bind.annotation.XmlAccessorType;
8   import javax.xml.bind.annotation.XmlElement;
9   import javax.xml.bind.annotation.XmlRootElement;
10  import javax.xml.bind.annotation.XmlTransient;
11  
12  /**
13   * 套件消息
14   * 
15   * @className SuiteMessage
16   * @author jinyu(foxinmy@gmail.com)
17   * @date 2015年6月23日
18   * @since JDK 1.6
19   * @see
20   */
21  @XmlRootElement(name = "xml")
22  @XmlAccessorType(XmlAccessType.FIELD)
23  public class SuiteMessage implements Serializable {
24  
25  	private static final long serialVersionUID = 6457919241019021514L;
26  	/**
27  	 * 应用套件的SuiteId
28  	 */
29  	@XmlElement(name = "SuiteId")
30  	private String suiteId;
31  	/**
32  	 * 事件类型
33  	 */
34  	@XmlElement(name = "InfoType")
35  	private String eventType;
36  	/**
37  	 * 时间戳
38  	 */
39  	@XmlElement(name = "TimeStamp")
40  	private long timeStamp;
41  	/**
42  	 * Ticket内容
43  	 */
44  	@XmlElement(name = "SuiteTicket")
45  	private String suiteTicket;
46  	/**
47  	 * 授权方企业号的corpid
48  	 */
49  	@XmlElement(name = "AuthCorpId")
50  	private String authCorpId;
51  
52  	public String getSuiteId() {
53  		return suiteId;
54  	}
55  
56  	public String getEventType() {
57  		return eventType;
58  	}
59  
60  	@XmlTransient
61  	public SuiteEventType getFormatEventType() {
62  		return SuiteEventType.valueOf(eventType);
63  	}
64  
65  	public long getTimeStamp() {
66  		return timeStamp;
67  	}
68  
69  	@XmlTransient
70  	public Date getFormatTimeStamp() {
71  		return timeStamp > 0l ? new Date(timeStamp * 1000l) : null;
72  	}
73  
74  	public String getSuiteTicket() {
75  		return suiteTicket;
76  	}
77  
78  	public String getAuthCorpId() {
79  		return authCorpId;
80  	}
81  
82  	@Override
83  	public String toString() {
84  		return "SuiteMessage [suiteId=" + suiteId + ", eventType="
85  				+ eventType + ", timeStamp=" + timeStamp + ", suiteTicket="
86  				+ suiteTicket + ", authCorpId=" + authCorpId + "]";
87  	}
88  }