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