From b76f9ce566d40aa0b7545640fb8cc02390874f0f Mon Sep 17 00:00:00 2001 From: zhiyuan Date: Sun, 24 Dec 2023 04:56:06 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20#3190=E3=80=90=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=BE=A4=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0member=5Fversion=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4state=E5=AD=97=E6=AE=B5,unionId=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=B3=A8=E9=87=8A=E5=8F=98=E6=9B=B4=E3=80=82=E6=8C=89?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=A1=BA=E5=BA=8F=E6=8E=92=E5=BA=8F=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WxCpUserExternalGroupChatInfo.java | 66 +++++++++++++------ .../WxCpExternalContactServiceImplTest.java | 10 ++- 2 files changed, 53 insertions(+), 23 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java index 88f6c8a64b..ec0c4731a0 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java @@ -18,47 +18,74 @@ @Setter public class WxCpUserExternalGroupChatInfo extends WxCpBaseResp { + /** + * 客户群详情 + */ @SerializedName("group_chat") private GroupChat groupChat; /** - * The type Group chat. + * 客户群详情 */ @Getter @Setter public static class GroupChat implements Serializable { private static final long serialVersionUID = -4301684507150486556L; + /** + * 客户群ID + */ @SerializedName("chat_id") private String chatId; - + /** + * 群名 + */ @SerializedName("name") private String name; - + /** + * 群主ID + */ @SerializedName("owner") private String owner; + /** + * 群的创建时间 + */ @SerializedName("create_time") private Long createTime; - + /** + * 群公告 + */ @SerializedName("notice") private String notice; - + /** + * 群成员列表 + */ @SerializedName("member_list") private List memberList; - + /** + * 群管理员列表 + */ @SerializedName("admin_list") private List adminList; + /** + * 当前群成员版本号。可以配合客户群变更事件减少主动调用本接口的次数 + */ + @SerializedName("member_version") + private String memberVersion; } /** - * The type Group member. + * 群成员 */ @Getter @Setter public static class GroupMember implements Serializable { private static final long serialVersionUID = -4301684507150486556L; + /** + * 群成员id + */ @SerializedName("userid") private String userId; @@ -70,17 +97,21 @@ public static class GroupMember implements Serializable { @SerializedName("type") private int type; - @SerializedName("join_time") - private Long joinTime; - /** * 外部联系人在微信开放平台的唯一身份标识(微信unionid) * 通过此字段企业可将外部联系人与公众号/小程序用户关联起来 - * 仅当群成员类型是微信用户(包括企业成员未添加好友),且企业或第三方服务商绑定了微信开发者ID有此字段 + * 仅当群成员类型是微信用户(包括企业成员未添加好友),且企业绑定了微信开发者ID有此字段(查看绑定方法)。 + * 第三方不可获取,上游企业不可获取下游企业客户的unionid字段 */ @SerializedName("unionid") private String unionId; + /** + * 入群时间 + */ + @SerializedName("join_time") + private Long joinTime; + /** * 入群方式。 * 1 - 由成员邀请入群(直接邀请入群) @@ -91,10 +122,10 @@ public static class GroupMember implements Serializable { private int joinScene; /** - * 该成员入群方式对应的state参数 + * 邀请者。目前仅当是由本企业内部成员邀请入群时会返回该值 */ - @SerializedName("state") - private String state; + @SerializedName("invitor") + private Invitor invitor; /** * 在群里的昵称 @@ -110,11 +141,6 @@ public static class GroupMember implements Serializable { @SerializedName("name") private String name; - /** - * 邀请者。目前仅当是由本企业内部成员邀请入群时会返回该值 - */ - @SerializedName("invitor") - private Invitor invitor; } /** @@ -132,7 +158,7 @@ public static class Invitor { } /** - * The type Group admin. + * 群管理员列表 */ @Getter @Setter diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java index d7ed2a6221..a33e458e0d 100644 --- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java +++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java @@ -389,11 +389,15 @@ public void testListGroupChatV3() throws WxErrorException { assertNotNull(result); } + /** * Test get group chat. */ @Test - public void testGetGroupChat() { + public void testGetGroupChat() throws WxErrorException { + final WxCpUserExternalGroupChatInfo result = this.wxCpService.getExternalContactService().getGroupChat("wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA", 1); + System.out.println(result); + assertNotNull(result); } /** @@ -624,7 +628,7 @@ public void testGetJoinWay() throws WxErrorException { @Test public void testRemindGroupMsgSend() throws WxErrorException { this.wxCpService.getExternalContactService() - .remindGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA"); + .remindGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA"); } /** @@ -635,6 +639,6 @@ public void testRemindGroupMsgSend() throws WxErrorException { @Test public void testCancelGroupMsgSend() throws WxErrorException { this.wxCpService.getExternalContactService() - .cancelGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA"); + .cancelGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA"); } }