View Javadoc
1   package com.foxinmy.weixin4j.qy.model;
2   
3   import java.io.Serializable;
4   import java.util.List;
5   
6   import com.alibaba.fastjson.annotation.JSONField;
7   
8   /**
9    * 权限信息
10   * 
11   * @className PrivilegeInfo
12   * @author jinyu(foxinmy@gmail.com)
13   * @date 2016年3月28日
14   * @since JDK 1.6
15   * @see
16   */
17  public class PrivilegeInfo implements Serializable {
18  
19  	private static final long serialVersionUID = 2689295767648714897L;
20  	/**
21  	 * 权限级别
22  	 */
23  	private int level;
24  	/**
25  	 * 	应用可见范围(成员)
26  	 */
27  	@JSONField(name = "allow_user")
28  	private List<String> allowUserIds;
29  	/**
30  	 * 应用可见范围(部门)
31  	 */
32  	@JSONField(name = "allow_party")
33  	private List<Integer> allowPartyIds;
34  	/**
35  	 * 	应用可见范围(标签)
36  	 */
37  	@JSONField(name = "allow_tag")
38  	private List<Integer> allowTagIds;
39  	/**
40  	 * 额外通讯录(成员)
41  	 */
42  	@JSONField(name = "extra_user")
43  	private List<String> extraUserIds;
44  	/**
45  	 * 额外通讯录(部门)
46  	 */
47  	@JSONField(name = "extra_party")
48  	private List<Integer> extraPartyIds;
49  	/**
50  	 * 额外通讯录(标签)
51  	 */
52  	@JSONField(name = "extra_tag")
53  	private List<Integer> extraTagIds;
54  
55  	public int getLevel() {
56  		return level;
57  	}
58  
59  	@JSONField(serialize = false)
60  	public PrivilegeLevel getFormatLevel() {
61  		return PrivilegeLevel.values()[level - 1];
62  	}
63  
64  	public void setLevel(int level) {
65  		this.level = level;
66  	}
67  
68  	public List<String> getAllowUserIds() {
69  		return allowUserIds;
70  	}
71  
72  	public void setAllowUserIds(List<String> allowUserIds) {
73  		this.allowUserIds = allowUserIds;
74  	}
75  
76  	public List<Integer> getAllowPartyIds() {
77  		return allowPartyIds;
78  	}
79  
80  	public void setAllowPartyIds(List<Integer> allowPartyIds) {
81  		this.allowPartyIds = allowPartyIds;
82  	}
83  
84  	public List<Integer> getAllowTagIds() {
85  		return allowTagIds;
86  	}
87  
88  	public void setAllowTagIds(List<Integer> allowTagIds) {
89  		this.allowTagIds = allowTagIds;
90  	}
91  
92  	public List<String> getExtraUserIds() {
93  		return extraUserIds;
94  	}
95  
96  	public void setExtraUserIds(List<String> extraUserIds) {
97  		this.extraUserIds = extraUserIds;
98  	}
99  
100 	public List<Integer> getExtraPartyIds() {
101 		return extraPartyIds;
102 	}
103 
104 	public void setExtraPartyIds(List<Integer> extraPartyIds) {
105 		this.extraPartyIds = extraPartyIds;
106 	}
107 
108 	public List<Integer> getExtraTagIds() {
109 		return extraTagIds;
110 	}
111 
112 	public void setExtraTagIds(List<Integer> extraTagIds) {
113 		this.extraTagIds = extraTagIds;
114 	}
115 
116 	@Override
117 	public String toString() {
118 		return "PrivilegeInfo [level=" + level + ", allowUserIds=" + allowUserIds + ", allowPartyIds=" + allowPartyIds
119 				+ ", allowTagIds=" + allowTagIds + ", extraUserIds=" + extraUserIds + ", extraPartyIds=" + extraPartyIds
120 				+ ", extraTagIds=" + extraTagIds + "]";
121 	}
122 }