🎨 #1583 企业微信读取成员接口增加返回字段:main_department

Co-authored-by: laowang <wangzhengwei@chinaredstar.cn>
This commit is contained in:
wzw921001
2020-05-26 17:41:47 +08:00
committed by GitHub
parent 7b641e7b5b
commit edf1401dbe
2 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,7 @@ public class WxCpUser implements Serializable {
private String email;
private String avatar;
private String thumbAvatar;
private String mainDepartment;
/**
* 地址。长度最大128个字符

View File

@ -74,6 +74,7 @@ public class WxCpUserGsonAdapter implements JsonDeserializer<WxCpUser>, JsonSeri
user.setTelephone(GsonHelper.getString(o, "telephone"));
user.setQrCode(GsonHelper.getString(o, "qr_code"));
user.setToInvite(GsonHelper.getBoolean(o, "to_invite"));
user.setMainDepartment(GsonHelper.getString(o, "main_department"));
if (GsonHelper.isNotNull(o.get(EXTRA_ATTR))) {
this.buildExtraAttrs(o, user);
@ -243,6 +244,9 @@ public class WxCpUserGsonAdapter implements JsonDeserializer<WxCpUser>, JsonSeri
if (user.getToInvite() != null) {
o.addProperty("to_invite", user.getToInvite());
}
if (user.getMainDepartment() != null) {
o.addProperty("main_department", user.getMainDepartment());
}
if (user.getExtAttrs().size() > 0) {
JsonArray attrsJsonArray = new JsonArray();