View Javadoc
1   package com.foxinmy.weixin4j.qy.model;
2   
3   import java.io.Serializable;
4   
5   import com.alibaba.fastjson.annotation.JSONField;
6   
7   /**
8    * 成员新消息免打扰
9    *
10   * @className ChatMute
11   * @author jinyu(foxinmy@gmail.com)
12   * @date 2015年8月1日
13   * @since JDK 1.6
14   * @see
15   */
16  public class ChatMute implements Serializable {
17  
18  	private static final long serialVersionUID = 6734443056426236273L;
19  
20  	@JSONField(name = "userid")
21  	private String userId;
22  	private int status;
23  
24  	/**
25  	 * 默认关闭免打扰
26  	 *
27  	 * @param userid
28  	 */
29  	public ChatMute(String userId) {
30  		this.userId = userId;
31  	}
32  
33  	/**
34  	 * 传入true时开启免打扰
35  	 *
36  	 * @param userId
37  	 *            成员userid
38  	 * @param status
39  	 *            是否开启免打扰
40  	 */
41  	public ChatMute(String userId, boolean status) {
42  		this.userId = userId;
43  		this.status = status ? 1 : 0;
44  	}
45  
46  	public String getUserId() {
47  		return userId;
48  	}
49  
50  	public int getStatus() {
51  		return status;
52  	}
53  
54  	@JSONField(serialize = false)
55  	public boolean getFormatStatus() {
56  		return status == 1;
57  	}
58  
59  	@Override
60  	public String toString() {
61  		return "ChatMute [userId=" + userId + ", status=" + status + "]";
62  	}
63  }