View Javadoc
1   package com.foxinmy.weixin4j.mp.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 ComponentAuthorizer
12   * @author jinyu(foxinmy@gmail.com)
13   * @date 2016年7月5日
14   * @since JDK 1.6
15   */
16  public class ComponentAuthorizer implements Serializable {
17  	private static final long serialVersionUID = -3610172415045923599L;
18  	/**
19  	 * 授权方appId
20  	 */
21  	@JSONField(name = "appid")
22  	private String appId;
23  	/**
24  	 * 授权方昵称
25  	 */
26  	@JSONField(name = "nick_name")
27  	private String nickName;
28  	/**
29  	 * 授权方头像
30  	 */
31  	@JSONField(name = "head_img")
32  	private String headImg;
33  	/**
34  	 * 授权方公众号类型,0代表订阅号,1代表由历史老帐号升级后的订阅号,2代表服务号
35  	 */
36  	@JSONField(deserialize = false)
37  	private int serviceType;
38  	/**
39  	 * 授权方认证类型,-1代表未认证,0代表微信认证,1代表新浪微博认证,2代表腾讯微博认证,3代表已资质认证通过但还未通过名称认证,4
40  	 * 代表已资质认证通过、还未通过名称认证,但通过了新浪微博认证,5代表已资质认证通过、还未通过名称认证,但通过了腾讯微博认证
41  	 */
42  	@JSONField(deserialize = false)
43  	private int verifyType;
44  	/**
45  	 * 授权方公众号的原始ID
46  	 */
47  	@JSONField(name = "user_name")
48  	private String userName;
49  	/**
50  	 * 授权方公众号所设置的微信号,可能为空
51  	 */
52  	@JSONField(name = "alias")
53  	private String alias;
54  	/**
55  	 * 二维码图片的URL,开发者最好自行也进行保存
56  	 */
57  	@JSONField(name = "qrcode_url")
58  	private String qrcodeUrl;
59  	/**
60  	 * 公众号功能的开通状况
61  	 */
62  	@JSONField(name = "business_info")
63  	private BusinessInfo businessInfo;
64  	/**
65  	 * 公众号授权给开发者的权限集列表,ID为1到15时分别代表: 消息管理权限 用户管理权限 帐号服务权限 网页服务权限 微信小店权限 微信多客服权限
66  	 * 群发与通知权限 微信卡券权限 微信扫一扫权限 微信连WIFI权限 素材管理权限 微信摇周边权限 微信门店权限 微信支付权限 自定义菜单权限
67  	 */
68  	@JSONField(deserialize = false)
69  	private List<Integer> privileges;
70  
71  	/**
72  	 * 公众号的主体名称
73  	 */
74  	@JSONField(name = "principal_name")
75  	private String principalName;
76  
77  	/**
78  	 * 帐号介绍
79  	 *
80  	 * @since 1.9.0
81  	 */
82  	@JSONField(name = "signature")
83  	private String signature;
84  
85  	public String getAppId() {
86  		return appId;
87  	}
88  
89  	public void setAppId(String appId) {
90  		this.appId = appId;
91  	}
92  
93  	public String getNickName() {
94  		return nickName;
95  	}
96  
97  	public void setNickName(String nickName) {
98  		this.nickName = nickName;
99  	}
100 
101 	public String getHeadImg() {
102 		return headImg;
103 	}
104 
105 	public void setHeadImg(String headImg) {
106 		this.headImg = headImg;
107 	}
108 
109 	public int getServiceType() {
110 		return serviceType;
111 	}
112 
113 	public void setServiceType(int serviceType) {
114 		this.serviceType = serviceType;
115 	}
116 
117 	public int getVerifyType() {
118 		return verifyType;
119 	}
120 
121 	public void setVerifyType(int verifyType) {
122 		this.verifyType = verifyType;
123 	}
124 
125 	public String getUserName() {
126 		return userName;
127 	}
128 
129 	public void setUserName(String userName) {
130 		this.userName = userName;
131 	}
132 
133 	public String getAlias() {
134 		return alias;
135 	}
136 
137 	public void setAlias(String alias) {
138 		this.alias = alias;
139 	}
140 
141 	public String getQrcodeUrl() {
142 		return qrcodeUrl;
143 	}
144 
145 	public void setQrcodeUrl(String qrcodeUrl) {
146 		this.qrcodeUrl = qrcodeUrl;
147 	}
148 
149 	public BusinessInfo getBusinessInfo() {
150 		return businessInfo;
151 	}
152 
153 	public void setBusinessInfo(BusinessInfo businessInfo) {
154 		this.businessInfo = businessInfo;
155 	}
156 
157 	public List<Integer> getPrivileges() {
158 		return privileges;
159 	}
160 
161 	public void setPrivileges(List<Integer> privileges) {
162 		this.privileges = privileges;
163 	}
164 
165 	public String getPrincipalName() {
166 		return principalName;
167 	}
168 
169 	public void setPrincipalName(String principalName) {
170 		this.principalName = principalName;
171 	}
172 
173 	public String getSignature() {
174 		return signature;
175 	}
176 
177 	public void setSignature(String signature) {
178 		this.signature = signature;
179 	}
180 
181 	@Override
182 	public String toString() {
183 		return "ComponentAuthInfo [nickName=" + nickName + ", principalName="
184 				+ principalName + ", headImg=" + headImg + ", serviceType="
185 				+ serviceType + ", verifyType=" + verifyType + ", userName="
186 				+ userName + ", alias=" + alias + ", qrcodeUrl=" + qrcodeUrl
187 				+ ", businessInfo=" + businessInfo + ", privileges="
188 				+ privileges + ", signature=" + signature + "]";
189 	}
190 
191 	public static class BusinessInfo implements Serializable {
192 		private static final long serialVersionUID = 3106626182191149662L;
193 		/**
194 		 * 是否开通微信门店功能
195 		 */
196 		@JSONField(name = "open_store")
197 		private boolean openStore;
198 		/**
199 		 * 是否开通微信扫商品功能
200 		 */
201 		@JSONField(name = "open_scan")
202 		private boolean openScan;
203 		/**
204 		 * 是否开通微信支付功能
205 		 */
206 		@JSONField(name = "open_pay")
207 		private boolean openPay;
208 		/**
209 		 * 是否开通微信卡券功能
210 		 */
211 		@JSONField(name = "open_card")
212 		private boolean openCard;
213 		/**
214 		 * 是否开通微信摇一摇功能
215 		 */
216 		@JSONField(name = "open_shake")
217 		private boolean openShake;
218 
219 		public boolean isOpenStore() {
220 			return openStore;
221 		}
222 
223 		public void setOpenStore(boolean openStore) {
224 			this.openStore = openStore;
225 		}
226 
227 		public boolean isOpenScan() {
228 			return openScan;
229 		}
230 
231 		public void setOpenScan(boolean openScan) {
232 			this.openScan = openScan;
233 		}
234 
235 		public boolean isOpenPay() {
236 			return openPay;
237 		}
238 
239 		public void setOpenPay(boolean openPay) {
240 			this.openPay = openPay;
241 		}
242 
243 		public boolean isOpenCard() {
244 			return openCard;
245 		}
246 
247 		public void setOpenCard(boolean openCard) {
248 			this.openCard = openCard;
249 		}
250 
251 		public boolean isOpenShake() {
252 			return openShake;
253 		}
254 
255 		public void setOpenShake(boolean openShake) {
256 			this.openShake = openShake;
257 		}
258 
259 		@Override
260 		public String toString() {
261 			return "BusinessInfo [openStore=" + openStore + ", openScan="
262 					+ openScan + ", openPay=" + openPay + ", openCard="
263 					+ openCard + ", openShake=" + openShake + "]";
264 		}
265 	}
266 }