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
16
17
18
19
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
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
43
44 @XmlElement(name = "SuiteTicket")
45 private String suiteTicket;
46
47
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 }