View Javadoc
1   package com.foxinmy.weixin4j.mp.model;
2   
3   import java.io.Serializable;
4   import java.util.Date;
5   import java.util.Iterator;
6   import java.util.List;
7   
8   import com.alibaba.fastjson.annotation.JSONField;
9   
10  /**
11   * 客服会话信息
12   * 
13   * @className KfSession
14   * @author jinyu(foxinmy@gmail.com)
15   * @date 2015年3月22日
16   * @since JDK 1.6
17   * @see
18   */
19  public class KfSession implements Serializable {
20  
21  	private static final long serialVersionUID = 7236468333492555458L;
22  
23  	/**
24  	 * 客服账号
25  	 */
26  	@JSONField(name = "kf_account")
27  	private String kfAccount;
28  	/**
29  	 * 用户ID
30  	 */
31  	@JSONField(name = "openid")
32  	private String userOpenId;
33  	/**
34  	 * 创建时间
35  	 */
36  	@JSONField(name = "createtime")
37  	private Date createTime;
38  	/**
39  	 * 最后一条消息的时间,在`获取未接入会话列表`接口中有值
40  	 */
41  	@JSONField(name = "latest_time")
42  	private Date latestTime;
43  
44  	public String getKfAccount() {
45  		return kfAccount;
46  	}
47  
48  	public void setKfAccount(String kfAccount) {
49  		this.kfAccount = kfAccount;
50  	}
51  
52  	public String getUserOpenId() {
53  		return userOpenId;
54  	}
55  
56  	public void setUserOpenId(String userOpenId) {
57  		this.userOpenId = userOpenId;
58  	}
59  
60  	public Date getCreateTime() {
61  		return createTime;
62  	}
63  
64  	public void setCreateTime(Date createTime) {
65  		this.createTime = createTime;
66  	}
67  
68  	public Date getLatestTime() {
69  		return latestTime;
70  	}
71  
72  	public void setLatestTime(Date latestTime) {
73  		this.latestTime = latestTime;
74  	}
75  
76  	/**
77  	 * 会话计数,如 未接入会话列表
78  	 * 
79  	 * @className: kfSessionCounter
80  	 * @description:
81  	 * @author jinyu
82  	 * @date 2016年4月15日
83  	 * @since JDK 1.6
84  	 * @see
85  	 */
86  	public static class KfSessionCounter implements Iterable<KfSession>, Serializable {
87  
88  		private static final long serialVersionUID = -2200434961546270829L;
89  
90  		@JSONField(name = "count")
91  		private int count;
92  		@JSONField(name = "waitcaselist")
93  		private List<KfSession> kfSessions;
94  
95  		@Override
96  		public Iterator<KfSession> iterator() {
97  			return kfSessions.iterator();
98  		}
99  
100 		public int getCount() {
101 			return count;
102 		}
103 
104 		public void setCount(int count) {
105 			this.count = count;
106 		}
107 
108 		public List<KfSession> getKfSessions() {
109 			return kfSessions;
110 		}
111 
112 		public void setKfSessions(List<KfSession> kfSessions) {
113 			this.kfSessions = kfSessions;
114 		}
115 
116 		@Override
117 		public String toString() {
118 			return "kfSessionCounter [count=" + count + ", kfSessions=" + kfSessions + "]";
119 		}
120 	}
121 
122 	@Override
123 	public String toString() {
124 		return "KfSession [kfAccount=" + kfAccount + ", userOpenId=" + userOpenId + ", createTime=" + createTime
125 				+ ", latestTime=" + latestTime + "]";
126 	}
127 }