From 6e6a0f2c964187f215020868fcc29cbe2e8f7783 Mon Sep 17 00:00:00 2001 From: yanglbme Date: Tue, 3 Dec 2024 08:53:13 +0800 Subject: [PATCH] chore: add code comments --- .../GetSpecifiedGroupMemberInfoRequest.java | 16 ++++++++++++++++ .../GetSpecifiedGroupMemberInfoResult.java | 6 ++++++ .../java/io/github/doocs/im/core/GroupTest.java | 16 ++++++++-------- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/doocs/im/model/request/GetSpecifiedGroupMemberInfoRequest.java b/src/main/java/io/github/doocs/im/model/request/GetSpecifiedGroupMemberInfoRequest.java index 26b0c6c..aa06f16 100644 --- a/src/main/java/io/github/doocs/im/model/request/GetSpecifiedGroupMemberInfoRequest.java +++ b/src/main/java/io/github/doocs/im/model/request/GetSpecifiedGroupMemberInfoRequest.java @@ -16,18 +16,34 @@ public class GetSpecifiedGroupMemberInfoRequest extends GenericRequest implements Serializable { private static final long serialVersionUID = -1588717038990106029L; + /** + * 需要拉取成员信息的群组的 ID + */ @JsonProperty("GroupId") private String groupId; + /** + * 需要拉取指定群成员的UserID列表,数量不得超过50。 + */ @JsonProperty("Member_List_Account") private List memberListAccount; + /** + * 需要获取哪些信息,如果没有该字段则为群成员全部资料,成员信息字段详情请参见 群成员资料。 + */ @JsonProperty("MemberInfoFilter") private List memberInfoFilter; + /** + * 选填 + * 拉取指定身份的群成员资料。如没有填写该字段,默认为所有身份成员资料,成员身份可以为:“Owner”,“Admin”,“Member”。 + */ @JsonProperty("MemberRoleFilter") private List memberRoleFilter; + /** + * 默认情况是没有的。该字段用来群成员维度的自定义字段过滤器,指定需要获取的群成员维度的自定义字段 + */ @JsonProperty("AppDefinedDataFilter_GroupMember") private List appDefinedDataFilterGroupMember; diff --git a/src/main/java/io/github/doocs/im/model/response/GetSpecifiedGroupMemberInfoResult.java b/src/main/java/io/github/doocs/im/model/response/GetSpecifiedGroupMemberInfoResult.java index 04b3bd9..c88ba25 100644 --- a/src/main/java/io/github/doocs/im/model/response/GetSpecifiedGroupMemberInfoResult.java +++ b/src/main/java/io/github/doocs/im/model/response/GetSpecifiedGroupMemberInfoResult.java @@ -15,9 +15,15 @@ public class GetSpecifiedGroupMemberInfoResult extends GenericResult implements Serializable { private static final long serialVersionUID = -5466167278504273597L; + /** + * 需要拉取成员信息的群组的 ID + */ @JsonProperty("GroupId") private String groupId; + /** + * 获取到的群成员列表,其中包含了全部或者指定字段的群成员信息 + */ @JsonProperty("MemberList") private List memberList; diff --git a/src/test/java/io/github/doocs/im/core/GroupTest.java b/src/test/java/io/github/doocs/im/core/GroupTest.java index fd6bcee..3b0e26d 100644 --- a/src/test/java/io/github/doocs/im/core/GroupTest.java +++ b/src/test/java/io/github/doocs/im/core/GroupTest.java @@ -92,14 +92,14 @@ void testGetGroupMemberInfo() throws IOException { @Test void testGetSpecifiedGroupMemberInfo() throws IOException { -GetSpecifiedGroupMemberInfoRequest request = GetSpecifiedGroupMemberInfoRequest.builder() - .groupId("MyFirstGroup") - .memberInfoFilter(Collections.singletonList("bingo")) - .build(); - -GetSpecifiedGroupMemberInfoResult result = client.group.getSpecifiedGroupMemberInfo(request); -System.out.println(result); -Assertions.assertEquals(ErrorCode.SUCCESS.getCode(), result.getErrorCode()); + GetSpecifiedGroupMemberInfoRequest request = GetSpecifiedGroupMemberInfoRequest.builder() + .groupId("MyFirstGroup") + .memberInfoFilter(Collections.singletonList("bingo")) + .build(); + + GetSpecifiedGroupMemberInfoResult result = client.group.getSpecifiedGroupMemberInfo(request); + System.out.println(result); + Assertions.assertEquals(ErrorCode.SUCCESS.getCode(), result.getErrorCode()); } @Test