View Javadoc
1   package com.foxinmy.weixin4j.mp.model;
2   
3   import java.io.Serializable;
4   
5   import com.alibaba.fastjson.annotation.JSONField;
6   import com.foxinmy.weixin4j.mp.type.KfOnlineStatus;
7   
8   /**
9    * 多客服在线信息
10   * 
11   * @className KfOnlineAccount
12   * @author jinyu(foxinmy@gmail.com)
13   * @date 2014年11月16日
14   * @since JDK 1.6
15   * @see <a href="http://dkf.qq.com/document-3_1.html">多客服账号信息</a>
16   */
17  public class KfOnlineAccount implements Serializable {
18  
19  	private static final long serialVersionUID = -4565570894727129245L;
20  	/**
21  	 * 客服工号
22  	 */
23  	@JSONField(name = "kf_id")
24  	private String id;
25  	/**
26  	 * 客服账号@微信别名 微信别名如有修改,旧账号返回旧的微信别名,新增的账号返回新的微信别名
27  	 */
28  	@JSONField(name = "kf_account")
29  	private String account;
30  	/**
31  	 * 客服在线状态 1:pc在线,2:手机在线 若pc和手机同时在线则为 1+2=3
32  	 */
33  	private int status;
34  	/**
35  	 * 客服设置的最大自动接入数
36  	 */
37  	@JSONField(name = "auto_accept")
38  	private int autoAccept;
39  	/**
40  	 * 客服当前正在接待的会话数
41  	 */
42  	@JSONField(name = "accepted_case")
43  	private int acceptedCase;
44  
45  	public String getAccount() {
46  		return account;
47  	}
48  
49  	public void setAccount(String account) {
50  		this.account = account;
51  	}
52  
53  	public String getId() {
54  		return id;
55  	}
56  
57  	public void setId(String id) {
58  		this.id = id;
59  	}
60  
61  	public int getStatus() {
62  		return status;
63  	}
64  
65  	@JSONField(serialize = false)
66  	public KfOnlineStatus getFormatStatus() {
67  		if (status == 1) {
68  			return KfOnlineStatus.PC;
69  		} else if (status == 2) {
70  			return KfOnlineStatus.MOBILE;
71  		} else {
72  			return KfOnlineStatus.BOTH;
73  		}
74  	}
75  
76  	public void setStatus(int status) {
77  		this.status = status;
78  	}
79  
80  	public int getAutoAccept() {
81  		return autoAccept;
82  	}
83  
84  	public void setAutoAccept(int autoAccept) {
85  		this.autoAccept = autoAccept;
86  	}
87  
88  	public int getAcceptedCase() {
89  		return acceptedCase;
90  	}
91  
92  	public void setAcceptedCase(int acceptedCase) {
93  		this.acceptedCase = acceptedCase;
94  	}
95  
96  	@Override
97  	public String toString() {
98  		return "KfAccount [account=" + account + ", id=" + id + ", status="
99  				+ status + ", autoAccept=" + autoAccept + ", acceptedCase="
100 				+ acceptedCase + "]";
101 	}
102 }