-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathBanExample.java
More file actions
59 lines (47 loc) · 1.33 KB
/
BanExample.java
File metadata and controls
59 lines (47 loc) · 1.33 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.user;
import io.rong.CenterEnum;
import io.rong.RongCloud;
import io.rong.methods.user.chat.Ban;
import io.rong.models.Result;
import io.rong.models.response.BanListResult;
import io.rong.models.user.BanListModel;
import io.rong.models.user.BanModel;
/**
* Demo class
*
* @author RongCloud
*/
public class BanExample {
/**
* Replace with your App Key
*/
private static final String appKey = "";
/**
* Replace with your App Secret
*/
private static final String appSecret = "";
public static void main(String[] args) throws Exception {
RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret, CenterEnum.BJ);
Ban ban = rongCloud.user.ban;
/**
*
* Set user mute
*/
BanModel model = new BanModel()
.setUserId(new String[]{"CHIQ1", "CHIQ2"})
.setState(1)
.setType("PERSON");
Result result = ban.set(model);
System.out.println("set: " + result.toString());
BanListModel blModel = new BanListModel()
.setType("PERSON");
/**
*
*
*
* Query muted user list
*/
BanListResult blResult = ban.getList(blModel);
System.out.println("getList: " + blResult.toString());
}
}