From 1793c2576ab87c93f160a46b3c33e316dddcbc4a Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Fri, 26 Jul 2019 23:43:58 +0800 Subject: [PATCH] =?UTF-8?q?#1126=20=E4=BF=AE=E5=A4=8D=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1WxCpXmlMessage=E7=B1=BB=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chanjar/weixin/cp/bean/WxCpXmlMessage.java | 18 ++++++++++++------ .../weixin/cp/bean/WxCpXmlMessageTest.java | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlMessage.java index c201af5c..771e5729 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlMessage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpXmlMessage.java @@ -180,17 +180,17 @@ public class WxCpXmlMessage implements Serializable { */ @XStreamAlias("ExternalUserID") @XStreamConverter(value = XStreamCDataConverter.class) - private String externalUserID; + private String externalUserId; /** - * 添加此用户的「联系我」方式配置的state参数,可用于识别添加此用户的渠道 + * 添加此用户的「联系我」方式配置的state参数,可用于识别添加此用户的渠道. */ @XStreamAlias("State") @XStreamConverter(value = XStreamCDataConverter.class) private String state; /** - * 欢迎语code,可用于发送欢迎语 + * 欢迎语code,可用于发送欢迎语. */ @XStreamAlias("WelcomeCode") @XStreamConverter(value = XStreamCDataConverter.class) @@ -211,11 +211,11 @@ public class WxCpXmlMessage implements Serializable { private String name; /** - * 成员部门列表. + * 成员部门列表,变更时推送,仅返回该应用有查看权限的部门id. */ @XStreamAlias("Department") @XStreamConverter(value = XStreamCDataConverter.class) - private String department; + private Long[] departments; /** * 手机号码. @@ -264,6 +264,12 @@ public class WxCpXmlMessage implements Serializable { @XStreamAlias("IsLeader") private Integer isLeader; + /** + * 表示所在部门是否为上级,0-否,1-是,顺序与Department字段的部门逐一对应. + */ + @XStreamAlias("IsLeaderInDept") + private Integer[] isLeaderInDept; + /** * 座机. */ @@ -288,7 +294,7 @@ public class WxCpXmlMessage implements Serializable { * 部门Id. */ @XStreamAlias("Id") - private Integer id; + private Long id; /** * 父部门id. diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpXmlMessageTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpXmlMessageTest.java index ad9a04b6..e6efa043 100644 --- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpXmlMessageTest.java +++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/WxCpXmlMessageTest.java @@ -195,7 +195,7 @@ public class WxCpXmlMessageTest { assertEquals(wxMessage.getMsgType(), WxConsts.XmlMsgType.EVENT); assertEquals(wxMessage.getEvent(), WxCpConsts.EventType.CHANGE_EXTERNAL_CONTACT); assertEquals(wxMessage.getChangeType(), WxCpConsts.ExternalContactChangeType.ADD_EXTERNAL_CONTACT); - assertEquals(wxMessage.getExternalUserID(), "woAJ2GCAAAXtWyujaWJHDDGi0mACH71w"); + assertEquals(wxMessage.getExternalUserId(), "woAJ2GCAAAXtWyujaWJHDDGi0mACH71w"); assertEquals(wxMessage.getState(), "teststate"); assertEquals(wxMessage.getWelcomeCode(), "WELCOMECODE"); @@ -220,6 +220,6 @@ public class WxCpXmlMessageTest { assertEquals(wxMessage.getEvent(), WxCpConsts.EventType.CHANGE_EXTERNAL_CONTACT); assertEquals(wxMessage.getChangeType(), WxCpConsts.ExternalContactChangeType.DEL_EXTERNAL_CONTACT); assertEquals(wxMessage.getUserId(), "zhangsan"); - assertEquals(wxMessage.getExternalUserID(), "woAJ2GCAAAXtWyujaWJHDDGi0mACH71w"); + assertEquals(wxMessage.getExternalUserId(), "woAJ2GCAAAXtWyujaWJHDDGi0mACH71w"); } }