mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
issue #72 WxCpUser缺少avatar,status属性
This commit is contained in:
@@ -49,6 +49,8 @@ public class WxCpUserGsonAdapter implements JsonDeserializer<WxCpUser>, JsonSeri
|
||||
user.setTel(GsonHelper.getString(o, "tel"));
|
||||
user.setEmail(GsonHelper.getString(o, "email"));
|
||||
user.setWeiXinId(GsonHelper.getString(o, "weixinid"));
|
||||
user.setAvatar(GsonHelper.getString(o, "avatar"));
|
||||
user.setStatus(GsonHelper.getInteger(o, "status"));
|
||||
|
||||
if (GsonHelper.isNotNull(o.get("extattr"))) {
|
||||
JsonArray attrJsonElements = o.get("extattr").getAsJsonObject().get("attrs").getAsJsonArray();
|
||||
@@ -97,6 +99,12 @@ public class WxCpUserGsonAdapter implements JsonDeserializer<WxCpUser>, JsonSeri
|
||||
if (user.getWeiXinId() != null) {
|
||||
o.addProperty("weixinid", user.getWeiXinId());
|
||||
}
|
||||
if (user.getAvatar() != null) {
|
||||
o.addProperty("avatar", user.getAvatar());
|
||||
}
|
||||
if (user.getStatus() != null) {
|
||||
o.addProperty("status", user.getStatus());
|
||||
}
|
||||
if (user.getExtAttrs().size() > 0) {
|
||||
JsonArray attrsJsonArray = new JsonArray();
|
||||
for (WxCpUser.Attr attr : user.getExtAttrs()) {
|
||||
|
||||
Reference in New Issue
Block a user