1 package com.foxinmy.weixin4j.qy.chat;
2
3 import java.io.Serializable;
4 import java.util.List;
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 import com.foxinmy.weixin4j.type.AgentType;
13
14
15
16
17
18
19
20
21
22
23 @XmlRootElement(name = "xml")
24 @XmlAccessorType(XmlAccessType.FIELD)
25 public class WeixinChatMessage implements Serializable {
26
27 private static final long serialVersionUID = 6788124387186831643L;
28
29
30
31
32 @XmlElement(name = "ToUserName")
33 private String corpId;
34
35
36
37 @XmlElement(name = "AgentType")
38 private String agentType;
39
40
41
42 @XmlElement(name = "ItemCount")
43 private int itemCount;
44
45
46
47 @XmlElement(name = "Item")
48 public List<ChatItem> items;
49
50
51
52 @XmlElement(name = "PackageId")
53 private String packageId;
54
55 public String getCorpId() {
56 return corpId;
57 }
58
59 public String getAgentType() {
60 return agentType;
61 }
62
63 @XmlTransient
64 public AgentType getFormatAgentType() {
65 return AgentType.valueOf(agentType);
66 }
67
68 public int getItemCount() {
69 return itemCount;
70 }
71
72 public List<ChatItem> getItems() {
73 return items;
74 }
75
76 public String getPackageId() {
77 return packageId;
78 }
79
80 @Override
81 public String toString() {
82 return "WeixinChatMessage [corpId=" + corpId + ", agentType="
83 + agentType + ", itemCount=" + itemCount + ", items=" + items
84 + ", packageId=" + packageId + "]";
85 }
86 }