forked from binarywang/WxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWxCpTpPermanentCodeInfo.java
More file actions
228 lines (172 loc) · 5.17 KB
/
WxCpTpPermanentCodeInfo.java
File metadata and controls
228 lines (172 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
package me.chanjar.weixin.cp.bean;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.Setter;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
/**
* 服务商模式获取永久授权码信息
*
* @author yunaqixun
*/
@Getter
@Setter
public class WxCpTpPermanentCodeInfo extends WxCpBaseResp {
private static final long serialVersionUID = -5028321625140879571L;
@SerializedName("access_token")
private String accessToken;
@SerializedName("expires_in")
private Long expiresIn;
@SerializedName("permanent_code")
private String permanentCode;
/**
* 授权企业信息
*/
@SerializedName("auth_corp_info")
private AuthCorpInfo authCorpInfo;
/**
* 授权信息。如果是通讯录应用,且没开启实体应用,是没有该项的。通讯录应用拥有企业通讯录的全部信息读写权限
*/
@SerializedName("auth_info")
private AuthInfo authInfo;
/**
* 授权用户信息
*/
@SerializedName("auth_user_info")
private AuthUserInfo authUserInfo;
@Getter
@Setter
public static class AuthCorpInfo implements Serializable {
private static final long serialVersionUID = -5028321625140879571L;
@SerializedName("corpid")
private String corpId;
@SerializedName("corp_name")
private String corpName;
@SerializedName("corp_type")
private String corpType;
@SerializedName("corp_square_logo_url")
private String corpSquareLogoUrl;
@SerializedName("corp_round_logo_url")
private String corpRoundLogoUrl;
@SerializedName("corp_user_max")
private String corpUserMax;
@SerializedName("corp_agent_max")
private String corpAgentMax;
/**
* 所绑定的企业微信主体名称(仅认证过的企业有)
*/
@SerializedName("corp_full_name")
private String corpFullName;
/**
* 认证到期时间
*/
@SerializedName("verified_end_time")
private Long verifiedEndTime;
/**
* 企业类型,1. 企业; 2. 政府以及事业单位; 3. 其他组织, 4.团队号
*/
@SerializedName("subject_type")
private Integer subjectType;
/**
* 授权企业在微工作台(原企业号)的二维码,可用于关注微工作台
*/
@SerializedName("corp_wxqrcode")
private String corpWxQrcode;
@SerializedName("corp_scale")
private String corpScale;
@SerializedName("corp_industry")
private String corpIndustry;
@SerializedName("corp_sub_industry")
private String corpSubIndustry;
@SerializedName("location")
private String location;
}
/**
* 授权信息
*/
@Getter
@Setter
public static class AuthInfo implements Serializable {
private static final long serialVersionUID = -5028321625140879571L;
/**
* 授权的应用信息,注意是一个数组,但仅旧的多应用套件授权时会返回多个agent,对新的单应用授权,永远只返回一个agent
*/
@SerializedName("agent")
private List<Agent> agents;
}
@Getter
@Setter
public static class Agent implements Serializable {
private static final long serialVersionUID = -5028321625140879571L;
@SerializedName("agentid")
private Integer agentId;
@SerializedName("name")
private String name;
@SerializedName("round_logo_url")
private String roundLogoUrl;
@SerializedName("square_logo_url")
private String squareLogoUrl;
/**
* 旧的多应用套件中的对应应用id,新开发者请忽略
*/
@SerializedName("appid")
@Deprecated
private String appid;
/**
* 应用权限
*/
@SerializedName("privilege")
private Privilege privilege;
}
/**
* 授权人员信息
*/
@Getter
@Setter
public static class AuthUserInfo implements Serializable {
private static final long serialVersionUID = -5028321625140879571L;
@SerializedName("userid")
private String userId;
@SerializedName("name")
private String name;
@SerializedName("avatar")
private String avatar;
}
/**
* 应用对应的权限
*/
@Getter
@Setter
public static class Privilege implements Serializable {
private static final long serialVersionUID = -5028321625140879571L;
/**
* 权限等级。
* 1:通讯录基本信息只读
* 2:通讯录全部信息只读
* 3:通讯录全部信息读写
* 4:单个基本信息只读
* 5:通讯录全部信息只写
*/
@SerializedName("level")
private Integer level;
@SerializedName("allow_party")
private List<Integer> allowParties;
@SerializedName("allow_user")
private List<String> allowUsers;
@SerializedName("allow_tag")
private List<Integer> allowTags;
@SerializedName("extra_party")
private List<Integer> extraParties;
@SerializedName("extra_user")
private List<String> extraUsers;
@SerializedName("extra_tag")
private List<Integer> extraTags;
}
public static WxCpTpPermanentCodeInfo fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpTpPermanentCodeInfo.class);
}
public String toJson() {
return WxCpGsonBuilder.create().toJson(this);
}
}