Ai
2 Star 9 Fork 5

融云 RongCloud/server-sdk-java

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BanAllMemberExample.java 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
huhangtao 提交于 2025-03-14 09:57 +08:00 . FEAT(m-5337441553):translation
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());
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/rongcloud/server-sdk-java.git
git@gitee.com:rongcloud/server-sdk-java.git
rongcloud
server-sdk-java
server-sdk-java
master

搜索帮助