代码拉取完成,页面将自动刷新
package io.rong.example.user;
import io.rong.CenterEnum;
import io.rong.RongCloud;
import io.rong.methods.user.mute.MuteChatrooms;
import io.rong.models.chatroom.ChatroomMember;
import io.rong.models.chatroom.ChatroomModel;
import io.rong.models.response.ListGagChatroomUserResult;
import io.rong.models.response.ResponseResult;
/**
* Global chatroom mute example
* @author RongCloud
*/
public class MuteChatroomsExample {
/**
* Replace with your appKey
*/
private static final String appKey = "appKey";
/**
* Replace with your appSecret
*/
private static final String appSecret = "appSecret";
public static void main(String[] args) throws Exception {
//RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret);
//Custom API endpoint
RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret, CenterEnum.BJ);
MuteChatrooms muteChatrooms = rongCloud.user.muteChatrooms;
/**
*
* Add global mute for chatroom
*/
ChatroomMember[] members = {
new ChatroomMember().setId("qawr34h"), new ChatroomMember().setId("qawr35h")
};
ChatroomModel chatroom = new ChatroomModel()
.setMembers(members)
.setMinute(5);
ResponseResult result = muteChatrooms.add(chatroom);
System.out.println("addGagUser: " + result.toString());
/**
*
* Get global mute list for chatroom
*/
ListGagChatroomUserResult chatroomListGagUserResult = muteChatrooms.getList();
System.out.println("ListGagUser: " + chatroomListGagUserResult.toString());
/**
*
*
* Remove global mute for chatroom
*/
chatroom = new ChatroomModel()
.setMembers(members);
ResponseResult removeResult = muteChatrooms.remove(chatroom);
System.out.println("removeBanUser: " + removeResult.toString());
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。