From 7435f2dbd528d7e6d97d26ff1006719831e22ffc Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Sun, 13 May 2018 22:44:06 +0800 Subject: [PATCH] =?UTF-8?q?#587=20=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=87=A0=E4=B8=AA=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=AD=97=E6=AE=B5?= 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 + .../main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java | 2 +- .../me/chanjar/weixin/cp/util/json/WxCpUserGsonAdapter.java | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) 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 2cc1b40765..fd06ea23c5 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 @@ -31,6 +31,7 @@ public class WxCpUser implements Serializable { private Integer hideMobile; private String englishName; private String telephone; + private String qrCode; private Boolean toInvite; public void addExtAttr(String name, String value) { diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java index d86722a072..d8df026d47 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java @@ -19,6 +19,6 @@ public class WxCpUserDetail { private String mobile; private String gender; private String email; - @SerializedName("qr_code") + @SerializedName("qrCode") private String qrCode; } 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 adb0ed2608..1eec481512 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 @@ -49,6 +49,7 @@ public WxCpUser deserialize(JsonElement json, Type typeOfT, JsonDeserializationC user.setHideMobile(GsonHelper.getInteger(o, "hide_mobile")); user.setEnglishName(GsonHelper.getString(o, "english_name")); user.setTelephone(GsonHelper.getString(o, "telephone")); + user.setQrCode(GsonHelper.getString(o, "qr_code")); user.setToInvite(GsonHelper.getBoolean(o, "to_invite")); if (GsonHelper.isNotNull(o.get("extattr"))) { @@ -113,6 +114,9 @@ public JsonElement serialize(WxCpUser user, Type typeOfSrc, JsonSerializationCon if (user.getTelephone() != null) { o.addProperty("telephone", user.getTelephone()); } + if (user.getQrCode() != null) { + o.addProperty("qr_code", user.getQrCode()); + } if (user.getToInvite() != null) { o.addProperty("to_invite", user.getToInvite()); }