添加获取聊天室成员API接口

This commit is contained in:
heavyrain.lee
2020-03-09 16:24:00 +08:00
parent 9cd3fe6b8c
commit 4533c2aac6
4 changed files with 90 additions and 0 deletions
@@ -30,5 +30,13 @@ public class ChatroomAdmin {
InputGetChatroomInfo input = new InputGetChatroomInfo(chatroomId);
return AdminHttpUtils.httpJsonPost(path, input, OutputGetChatroomInfo.class);
}
public static IMResult<OutputStringList> getChatroomMembers(String chatroomId) throws Exception {
String path = APIPath.Chatroom_GetMembers;
InputGetChatroomInfo input = new InputGetChatroomInfo(chatroomId);
return AdminHttpUtils.httpJsonPost(path, input, OutputStringList.class);
}
}
@@ -545,6 +545,13 @@ public class Main {
System.exit(-1);
}
IMResult<OutputStringList> memberList = ChatroomAdmin.getChatroomMembers(chatroomId);
if (memberList != null && memberList.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
System.out.println("get chatroom member success");
} else {
System.out.println("get chatroom member failure: " + memberList.getErrorCode().msg);
}
IMResult<Void> voidIMResult = ChatroomAdmin.destroyChatroom(chatroomId);
if (voidIMResult != null && voidIMResult.getErrorCode() == ErrorCode.ERROR_CODE_SUCCESS) {
System.out.println("destroy chatroom done!");