Skip to content

Commit

Permalink
chore: add code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Dec 3, 2024
1 parent 05c4cab commit 6e6a0f2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> memberListAccount;

/**
* 需要获取哪些信息,如果没有该字段则为群成员全部资料,成员信息字段详情请参见 群成员资料。
*/
@JsonProperty("MemberInfoFilter")
private List<String> memberInfoFilter;

/**
* 选填
* 拉取指定身份的群成员资料。如没有填写该字段,默认为所有身份成员资料,成员身份可以为:“Owner”,“Admin”,“Member”。
*/
@JsonProperty("MemberRoleFilter")
private List<String> memberRoleFilter;

/**
* 默认情况是没有的。该字段用来群成员维度的自定义字段过滤器,指定需要获取的群成员维度的自定义字段
*/
@JsonProperty("AppDefinedDataFilter_GroupMember")
private List<String> appDefinedDataFilterGroupMember;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<MemberProfile> memberList;

Expand Down
16 changes: 8 additions & 8 deletions src/test/java/io/github/doocs/im/core/GroupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e6a0f2

Please sign in to comment.