-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathRemarkExample.java
More file actions
56 lines (43 loc) · 1.48 KB
/
RemarkExample.java
File metadata and controls
56 lines (43 loc) · 1.48 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
package io.rong.example.user;
import com.alibaba.fastjson.JSON;
import io.rong.CenterEnum;
import io.rong.RongCloud;
import io.rong.models.Result;
import io.rong.models.response.GetTagResult;
import io.rong.models.user.BatchTagModel;
import io.rong.models.user.GetTagModel;
import io.rong.models.user.RemarkModel;
import io.rong.models.user.TagModel;
import io.rong.util.JsonUtil;
import java.util.ArrayList;
import java.util.List;
/**
* Demo class
*
* @author RongCloud
*
*/
public class RemarkExample {
/**
* Replace with your App Key here
*/
private static final String appKey = "appKey";
/**
* Replace with your App Secret here
*/
private static final String appSecret = "appSecret";
public static void main(String[] args) throws Exception {
RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret, CenterEnum.BJ);
List<RemarkModel> remarks = new ArrayList<>();
RemarkModel remarkModel = new RemarkModel();
remarkModel.setId("user1");
remarkModel.setRemark("remark1");
remarks.add(remarkModel);
Result result = rongCloud.user.remark.set("userId", JSON.toJSONString(remarks));
System.out.println("set remark: " + result.toString());
result = rongCloud.user.remark.del("userId", "user1");
System.out.println("del remark: " + result.toString());
result = rongCloud.user.remark.get("userId");
System.out.println("get remark: " + result.toString());
}
}