From ea061971077903071ed9d23ae54c1aab6fa0581d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=E5=9B=A0=E6=96=AF=E5=94=90?= Date: Thu, 9 Jan 2020 18:32:33 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20#1371=20=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E9=80=9A=E8=AE=AF=E5=BD=95=E6=88=90=E5=91=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=AF=BB=E5=8F=96=E6=88=90=E5=91=98=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0thumb=5Favatar=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java | 1 + .../me/chanjar/weixin/cp/util/json/WxCpUserGsonAdapter.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java index b7389afa2b..a47d2a2a0f 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java @@ -27,6 +27,7 @@ public class WxCpUser implements Serializable { private Gender gender; private String email; private String avatar; + private String thumbAvatar; /** * 地址。长度最大128个字符 */ diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/util/json/WxCpUserGsonAdapter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/util/json/WxCpUserGsonAdapter.java index 482a42b47b..8dfeb1d752 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/util/json/WxCpUserGsonAdapter.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/util/json/WxCpUserGsonAdapter.java @@ -66,6 +66,7 @@ public WxCpUser deserialize(JsonElement json, Type typeOfT, JsonDeserializationC user.setGender(Gender.fromCode(GsonHelper.getString(o, "gender"))); user.setEmail(GsonHelper.getString(o, "email")); user.setAvatar(GsonHelper.getString(o, "avatar")); + user.setThumbAvatar(GsonHelper.getString(o, "thumb_avatar")); user.setAddress(GsonHelper.getString(o, "address")); user.setAvatarMediaId(GsonHelper.getString(o, "avatar_mediaid")); user.setStatus(GsonHelper.getInteger(o, "status")); @@ -187,6 +188,9 @@ public JsonElement serialize(WxCpUser user, Type typeOfSrc, JsonSerializationCon if (user.getAvatar() != null) { o.addProperty("avatar", user.getAvatar()); } + if (user.getThumbAvatar() != null) { + o.addProperty("thumb_avatar", user.getThumbAvatar()); + } if (user.getAddress() != null) { o.addProperty("address", user.getAddress()); }