Skip to content

Commit b14ff56

Browse files
shuiyihan12boris.bao
authored and
boris.bao
committed
🎨 binarywang#3190【企业微信】获取客户群详情接口响应类中增加member_version字段,并移除过期的state字段
1 parent 92602df commit b14ff56

File tree

2 files changed

+53
-23
lines changed

2 files changed

+53
-23
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java

+46-20
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,74 @@
1818
@Setter
1919
public class WxCpUserExternalGroupChatInfo extends WxCpBaseResp {
2020

21+
/**
22+
* 客户群详情
23+
*/
2124
@SerializedName("group_chat")
2225
private GroupChat groupChat;
2326

2427
/**
25-
* The type Group chat.
28+
* 客户群详情
2629
*/
2730
@Getter
2831
@Setter
2932
public static class GroupChat implements Serializable {
3033
private static final long serialVersionUID = -4301684507150486556L;
3134

35+
/**
36+
* 客户群ID
37+
*/
3238
@SerializedName("chat_id")
3339
private String chatId;
34-
40+
/**
41+
* 群名
42+
*/
3543
@SerializedName("name")
3644
private String name;
37-
45+
/**
46+
* 群主ID
47+
*/
3848
@SerializedName("owner")
3949
private String owner;
4050

51+
/**
52+
* 群的创建时间
53+
*/
4154
@SerializedName("create_time")
4255
private Long createTime;
43-
56+
/**
57+
* 群公告
58+
*/
4459
@SerializedName("notice")
4560
private String notice;
46-
61+
/**
62+
* 群成员列表
63+
*/
4764
@SerializedName("member_list")
4865
private List<GroupMember> memberList;
49-
66+
/**
67+
* 群管理员列表
68+
*/
5069
@SerializedName("admin_list")
5170
private List<GroupAdmin> adminList;
71+
/**
72+
* 当前群成员版本号。可以配合客户群变更事件减少主动调用本接口的次数
73+
*/
74+
@SerializedName("member_version")
75+
private String memberVersion;
5276
}
5377

5478
/**
55-
* The type Group member.
79+
* 群成员
5680
*/
5781
@Getter
5882
@Setter
5983
public static class GroupMember implements Serializable {
6084
private static final long serialVersionUID = -4301684507150486556L;
6185

86+
/**
87+
* 群成员id
88+
*/
6289
@SerializedName("userid")
6390
private String userId;
6491

@@ -70,17 +97,21 @@ public static class GroupMember implements Serializable {
7097
@SerializedName("type")
7198
private int type;
7299

73-
@SerializedName("join_time")
74-
private Long joinTime;
75-
76100
/**
77101
* 外部联系人在微信开放平台的唯一身份标识(微信unionid)
78102
* 通过此字段企业可将外部联系人与公众号/小程序用户关联起来
79-
* 仅当群成员类型是微信用户(包括企业成员未添加好友),且企业或第三方服务商绑定了微信开发者ID有此字段
103+
* 仅当群成员类型是微信用户(包括企业成员未添加好友),且企业绑定了微信开发者ID有此字段(查看绑定方法)。
104+
* 第三方不可获取,上游企业不可获取下游企业客户的unionid字段
80105
*/
81106
@SerializedName("unionid")
82107
private String unionId;
83108

109+
/**
110+
* 入群时间
111+
*/
112+
@SerializedName("join_time")
113+
private Long joinTime;
114+
84115
/**
85116
* 入群方式。
86117
* 1 - 由成员邀请入群(直接邀请入群)
@@ -91,10 +122,10 @@ public static class GroupMember implements Serializable {
91122
private int joinScene;
92123

93124
/**
94-
* 该成员入群方式对应的state参数
125+
* 邀请者。目前仅当是由本企业内部成员邀请入群时会返回该值
95126
*/
96-
@SerializedName("state")
97-
private String state;
127+
@SerializedName("invitor")
128+
private Invitor invitor;
98129

99130
/**
100131
* 在群里的昵称
@@ -110,11 +141,6 @@ public static class GroupMember implements Serializable {
110141
@SerializedName("name")
111142
private String name;
112143

113-
/**
114-
* 邀请者。目前仅当是由本企业内部成员邀请入群时会返回该值
115-
*/
116-
@SerializedName("invitor")
117-
private Invitor invitor;
118144
}
119145

120146
/**
@@ -132,7 +158,7 @@ public static class Invitor {
132158
}
133159

134160
/**
135-
* The type Group admin.
161+
* 群管理员列表
136162
*/
137163
@Getter
138164
@Setter

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,15 @@ public void testListGroupChatV3() throws WxErrorException {
389389
assertNotNull(result);
390390
}
391391

392+
392393
/**
393394
* Test get group chat.
394395
*/
395396
@Test
396-
public void testGetGroupChat() {
397+
public void testGetGroupChat() throws WxErrorException {
398+
final WxCpUserExternalGroupChatInfo result = this.wxCpService.getExternalContactService().getGroupChat("wrOgQhDgAAMYQiS5ol9G7gK9JVAAAA", 1);
399+
System.out.println(result);
400+
assertNotNull(result);
397401
}
398402

399403
/**
@@ -624,7 +628,7 @@ public void testGetJoinWay() throws WxErrorException {
624628
@Test
625629
public void testRemindGroupMsgSend() throws WxErrorException {
626630
this.wxCpService.getExternalContactService()
627-
.remindGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA");
631+
.remindGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA");
628632
}
629633

630634
/**
@@ -635,6 +639,6 @@ public void testRemindGroupMsgSend() throws WxErrorException {
635639
@Test
636640
public void testCancelGroupMsgSend() throws WxErrorException {
637641
this.wxCpService.getExternalContactService()
638-
.cancelGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA");
642+
.cancelGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA");
639643
}
640644
}

0 commit comments

Comments
 (0)