-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathBanAllMemberExample.java
More file actions
59 lines (50 loc) · 1.86 KB
/
BanAllMemberExample.java
File metadata and controls
59 lines (50 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package io.rong.example.chatroom;
import io.rong.CenterEnum;
import io.rong.RongCloud;
import io.rong.methods.chatroom.ban.BanAllMember;
import io.rong.models.chatroom.ChatroomModel;
import io.rong.models.response.ChatroomBanListResult;
import io.rong.models.response.ResponseResult;
import io.rong.models.response.StatusResult;
/**
* Chatroom Mute All Members
* @author RongCloud
*/
public class BanAllMemberExample {
/**
* Replace with your App Key
* */
private static final String appKey = "appKey";
/**
* Replace with your App Secret
* */
private static final String appSecret = "appSecret";
public static void main(String[] args) throws Exception {
RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret, CenterEnum.BJ);
BanAllMember banAllMember = rongCloud.chatroom.banAllMember;
/**
*
* Mute all members in a chatroom
* */
ChatroomModel chatroom = new ChatroomModel();
chatroom.setId("RC_Test_chatroom1");
ResponseResult result = banAllMember.add(chatroom);
System.out.println("addBanAllMember: " + result.toString());
/**
* Check the mute status of all members in a chatroom
* */
StatusResult statusResult = banAllMember.check(chatroom);
System.out.println("checkBanAllMember: " + statusResult.toString());
/**
* Get the list of all muted members in the chatroom
*/
ChatroomBanListResult chatroomBanListResult = banAllMember.getList(10,1);
System.out.println("listBanAllMember: " + chatroomBanListResult.toString());
/**
*
* Remove the mute for all members in the chatroom
*/
ResponseResult removeResult = banAllMember.remove(chatroom);
System.out.println("removeBanAllMember: " + removeResult.toString());
}
}