issue #72 WxCpUser缺少avatar,status属性
This commit is contained in:
@@ -21,6 +21,8 @@ public class WxCpUser {
|
|||||||
private String tel;
|
private String tel;
|
||||||
private String email;
|
private String email;
|
||||||
private String weiXinId;
|
private String weiXinId;
|
||||||
|
private String avatar;
|
||||||
|
private Integer status;
|
||||||
private final List<Attr> extAttrs = new ArrayList<Attr>();
|
private final List<Attr> extAttrs = new ArrayList<Attr>();
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
@@ -95,6 +97,22 @@ public class WxCpUser {
|
|||||||
this.weiXinId = weiXinId;
|
this.weiXinId = weiXinId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(String avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
public void addExtAttr(String name, String value) {
|
public void addExtAttr(String name, String value) {
|
||||||
this.extAttrs.add(new Attr(name, value));
|
this.extAttrs.add(new Attr(name, value));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ public class WxCpUserGsonAdapter implements JsonDeserializer<WxCpUser>, JsonSeri
|
|||||||
user.setTel(GsonHelper.getString(o, "tel"));
|
user.setTel(GsonHelper.getString(o, "tel"));
|
||||||
user.setEmail(GsonHelper.getString(o, "email"));
|
user.setEmail(GsonHelper.getString(o, "email"));
|
||||||
user.setWeiXinId(GsonHelper.getString(o, "weixinid"));
|
user.setWeiXinId(GsonHelper.getString(o, "weixinid"));
|
||||||
|
user.setAvatar(GsonHelper.getString(o, "avatar"));
|
||||||
|
user.setStatus(GsonHelper.getInteger(o, "status"));
|
||||||
|
|
||||||
if (GsonHelper.isNotNull(o.get("extattr"))) {
|
if (GsonHelper.isNotNull(o.get("extattr"))) {
|
||||||
JsonArray attrJsonElements = o.get("extattr").getAsJsonObject().get("attrs").getAsJsonArray();
|
JsonArray attrJsonElements = o.get("extattr").getAsJsonObject().get("attrs").getAsJsonArray();
|
||||||
@@ -97,6 +99,12 @@ public class WxCpUserGsonAdapter implements JsonDeserializer<WxCpUser>, JsonSeri
|
|||||||
if (user.getWeiXinId() != null) {
|
if (user.getWeiXinId() != null) {
|
||||||
o.addProperty("weixinid", user.getWeiXinId());
|
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) {
|
if (user.getExtAttrs().size() > 0) {
|
||||||
JsonArray attrsJsonArray = new JsonArray();
|
JsonArray attrsJsonArray = new JsonArray();
|
||||||
for (WxCpUser.Attr attr : user.getExtAttrs()) {
|
for (WxCpUser.Attr attr : user.getExtAttrs()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user