Merge pull request #193 from ajffdnt/develop

企业号用户增加enable属性,可以同步本地系统的用户有效性
This commit is contained in:
Daniel Qian 2015-08-13 16:06:31 +08:00
commit 2f2543673f
3 changed files with 13 additions and 1 deletions

View File

@ -49,7 +49,7 @@ public class WxError implements Serializable {
@Override
public String toString() {
return "微信错误 errcode=" + errorCode + ", errmsg=" + errorMsg + "\njson:" + json;
return "微信错误: errcode=" + errorCode + ", errmsg=" + errorMsg + "\njson:" + json;
}
}

View File

@ -24,6 +24,7 @@ public class WxCpUser implements Serializable {
private String weiXinId;
private String avatar;
private Integer status;
private Integer enable;
private final List<Attr> extAttrs = new ArrayList<Attr>();
public String getUserId() {
@ -114,6 +115,14 @@ public class WxCpUser implements Serializable {
this.status = status;
}
public Integer getEnable() {
return enable;
}
public void setEnable(Integer enable) {
this.enable = enable;
}
public void addExtAttr(String name, String value) {
this.extAttrs.add(new Attr(name, value));
}

View File

@ -98,6 +98,9 @@ public class WxCpUserGsonAdapter implements JsonDeserializer<WxCpUser>, JsonSeri
if (user.getStatus() != null) {
o.addProperty("status", user.getStatus());
}
if (user.getEnable() != null) {
o.addProperty("enable", user.getEnable());
}
if (user.getExtAttrs().size() > 0) {
JsonArray attrsJsonArray = new JsonArray();
for (WxCpUser.Attr attr : user.getExtAttrs()) {