public class BlockApi extends Object
限定符和类型 | 方法和说明 |
---|---|
reactor.core.publisher.Mono<Void> |
blockAllUserSendMsgToGroup(String groupId)
禁言群组全体成员。
|
reactor.core.publisher.Mono<Void> |
blockAllUserSendMsgToRoom(String roomId)
禁言聊天室全体成员。
|
reactor.core.publisher.Mono<Void> |
blockUserJoinGroup(String username,
String groupId)
阻止进群。
|
reactor.core.publisher.Mono<Void> |
blockUserJoinRoom(String username,
String roomId)
阻止进聊天室。
|
reactor.core.publisher.Mono<Void> |
blockUserLogin(String username)
用户账号禁用,阻止该用户登录。
|
reactor.core.publisher.Mono<Void> |
blockUserSendMsgToGroup(String username,
String groupId,
Duration duration)
添加群禁言。
|
reactor.core.publisher.Mono<Void> |
blockUserSendMsgToRoom(List<String> usernames,
String roomId,
Duration duration)
将多个用户添加聊天室禁言。
|
reactor.core.publisher.Mono<Void> |
blockUserSendMsgToRoom(String username,
String roomId,
Duration duration)
添加聊天室禁言。
|
reactor.core.publisher.Mono<Void> |
blockUserSendMsgToUser(String fromUser,
String toUser)
用户禁言,阻止向这个用户发消息。
|
reactor.core.publisher.Mono<Void> |
blockUsersSendMsgToGroup(List<String> usernames,
String groupId,
Duration duration)
添加群禁言,支持同时禁言多个用户。
|
reactor.core.publisher.Flux<EMBlock> |
getUsersBlockedFromSendMsgToUser(String username)
获取禁言列表,即这个用户禁言的其他用户。
|
reactor.core.publisher.Flux<EMBlock> |
getUsersBlockedJoinGroup(String groupId)
获取阻止进群的用户列表。
|
reactor.core.publisher.Flux<EMBlock> |
getUsersBlockedJoinRoom(String roomId)
获取阻止进聊天室的用户列表。
|
reactor.core.publisher.Flux<EMBlock> |
getUsersBlockedSendMsgToGroup(String groupId)
获取群禁言列表。
|
reactor.core.publisher.Flux<EMBlock> |
listUsersBlockedSendMsgToRoom(String roomId)
获取聊天室禁言列表。
|
reactor.core.publisher.Mono<Void> |
unblockAllUserSendMsgToGroup(String groupId)
解除群组全员禁言。
|
reactor.core.publisher.Mono<Void> |
unblockAllUserSendMsgToRoom(String roomId)
解除聊天室全员禁言。
|
reactor.core.publisher.Mono<Void> |
unblockUserJoinGroup(String username,
String groupId)
解除阻止进群。
|
reactor.core.publisher.Mono<Void> |
unblockUserJoinRoom(String username,
String roomId)
解除阻止进聊天室。
|
reactor.core.publisher.Mono<Void> |
unblockUserLogin(String username)
用户账号解禁,恢复该用户登录。
|
reactor.core.publisher.Mono<Void> |
unblockUserSendMsgToGroup(String username,
String groupId)
解除群禁言。
|
reactor.core.publisher.Mono<Void> |
unblockUserSendMsgToRoom(List<String> usernames,
String roomId)
将多个用户解除聊天室禁言。
|
reactor.core.publisher.Mono<Void> |
unblockUserSendMsgToRoom(String username,
String roomId)
解除聊天室禁言。
|
reactor.core.publisher.Mono<Void> |
unblockUserSendMsgToUser(String fromUser,
String toUser)
解除用户禁言,恢复向这个用户发消息。
|
public BlockApi(Context context)
public reactor.core.publisher.Flux<EMBlock> getUsersBlockedFromSendMsgToUser(String username)
API使用示例:
EMService service;
try {
List<EMBlock> blocks = service.block().getUsersBlockedFromSendMsgToUser("username").collectList().block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 发起禁言的用户名public reactor.core.publisher.Mono<Void> blockUserSendMsgToUser(String fromUser, String toUser)
要阻止 userA 给 userB发送消息:
API使用示例:
EMService service;
try {
service.block().blockUserSendMsgToUser("userA", "userB").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
fromUser
- 被阻止的用户的用户名toUser
- 接收消息的用户的用户名public reactor.core.publisher.Mono<Void> unblockUserSendMsgToUser(String fromUser, String toUser)
要恢复 userA 给 userB发送消息:
API使用示例:
EMService service;
try {
service.block().unblockUserSendMsgToUser("userA", "userB").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
fromUser
- 被阻止的用户的用户名toUser
- 接受消息的用户的用户名public reactor.core.publisher.Mono<Void> blockUserLogin(String username)
API使用示例:
EMService service;
try {
service.block().blockUserLogin("username").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被阻止的用户的用户名public reactor.core.publisher.Mono<Void> unblockUserLogin(String username)
API使用示例:
EMService service;
try {
service.block().unblockUserLogin("username").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被阻止的用户的用户名public reactor.core.publisher.Flux<EMBlock> getUsersBlockedJoinGroup(String groupId)
API使用示例:
EMService service;
try {
List<EMBlock> blocks = service.block().getUsersBlockedJoinGroup("groupId").collectList().block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
groupId
- 群idpublic reactor.core.publisher.Mono<Void> blockUserJoinGroup(String username, String groupId)
API使用示例:
EMService service;
try {
service.block().blockUserJoinGroup("username", "groupId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被阻止的用户的用户名groupId
- 群idpublic reactor.core.publisher.Mono<Void> unblockUserJoinGroup(String username, String groupId)
API使用示例:
EMService service;
try {
service.block().unblockUserJoinGroup("username", "groupId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
public reactor.core.publisher.Flux<EMBlock> getUsersBlockedJoinRoom(String roomId)
API使用示例:
EMService service;
try {
List<EMBlock> blocks = service.block().getUsersBlockedJoinRoom("roomId").collectList().block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
roomId
- 聊天室idpublic reactor.core.publisher.Mono<Void> blockUserJoinRoom(String username, String roomId)
API使用示例:
EMService service;
try {
service.block().blockUserJoinRoom("username", "roomId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被阻止的用户的用户名roomId
- 聊天室idpublic reactor.core.publisher.Mono<Void> unblockUserJoinRoom(String username, String roomId)
API使用示例:
EMService service;
try {
service.block().unblockUserJoinRoom("username", "roomId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被阻止的用户的用户名roomId
- 聊天室idpublic reactor.core.publisher.Flux<EMBlock> getUsersBlockedSendMsgToGroup(String groupId)
API使用示例:
EMService service;
try {
List<EMBlock> blocks = service.block().getUsersBlockedSendMsgToGroup("groupId").collectList().block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
groupId
- 群idpublic reactor.core.publisher.Mono<Void> blockUserSendMsgToGroup(String username, String groupId, Duration duration)
API使用示例:
EMService service;
try {
service.block().blockUserSendMsgToGroup("username", "groupId", Duration.ofMillis(6000)).block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被禁言的用户的用户名groupId
- 群idduration
- 禁言多长时间,为null则永久禁言public reactor.core.publisher.Mono<Void> blockUsersSendMsgToGroup(List<String> usernames, String groupId, Duration duration)
API使用示例:
EMService service;
try {
List<String> usernames = new ArrayList<>();
usernames.add("user1");
usernames.add("user2");
service.block().blockUsersSendMsgToGroup(usernames, "groupId", Duration.ofMillis(6000)).block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
usernames
- 被禁言的用户的用户名列表groupId
- 群idduration
- 禁言多长时间,为null则永久禁言public reactor.core.publisher.Mono<Void> unblockUserSendMsgToGroup(String username, String groupId)
API使用示例:
EMService service;
try {
service.block().unblockUserSendMsgToGroup("username", "groupId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被禁言的用户的用户名groupId
- 群idpublic reactor.core.publisher.Mono<Void> unblockAllUserSendMsgToGroup(String groupId)
API使用示例:
EMService service;
try {
service.block().unblockAllUserSendMsgToGroup("groupId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
groupId
- 群组idpublic reactor.core.publisher.Mono<Void> blockAllUserSendMsgToGroup(String groupId)
API使用示例:
EMService service;
try {
service.block().blockAllUserSendMsgToGroup("groupId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
groupId
- 群组idpublic reactor.core.publisher.Flux<EMBlock> listUsersBlockedSendMsgToRoom(String roomId)
API使用示例:
EMService service;
try {
List<EMBlock> blocks = service.block().listUsersBlockedSendMsgToRoom("roomId").collectList().block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
roomId
- 聊天室idpublic reactor.core.publisher.Mono<Void> blockUserSendMsgToRoom(String username, String roomId, Duration duration)
API使用示例:
EMService service;
try {
service.block().blockUserSendMsgToRoom("username", "roomId", Duration.ofMillis(6000)).block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被禁言的用户的用户名roomId
- 聊天室idduration
- 禁言时长,为null则永久禁言public reactor.core.publisher.Mono<Void> blockUserSendMsgToRoom(List<String> usernames, String roomId, Duration duration)
API使用示例:
EMService service;
try {
List<String> usernames = new ArrayList<>();
usernames.add("user1");
service.block().blockUserSendMsgToRoom(usernames, "roomId", Duration.ofMillis(6000)).block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
usernames
- 被禁言的用户名列表roomId
- 聊天室idduration
- 禁言时长,为null则永久禁言public reactor.core.publisher.Mono<Void> unblockUserSendMsgToRoom(String username, String roomId)
API使用示例:
EMService service;
try {
service.block().unblockUserSendMsgToRoom("username", "roomId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
username
- 被解除禁言的用户的用户名roomId
- 聊天室idpublic reactor.core.publisher.Mono<Void> unblockUserSendMsgToRoom(List<String> usernames, String roomId)
API使用示例:
EMService service;
try {
List<String> usernames = new ArrayList<>();
usernames.add("user1");
service.block().unblockUserSendMsgToRoom(usernames, "roomId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
usernames
- 被解除禁言的用户名列表roomId
- 聊天室idpublic reactor.core.publisher.Mono<Void> unblockAllUserSendMsgToRoom(String roomId)
API使用示例:
EMService service;
try {
service.block().unblockAllUserSendMsgToRoom("roomId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
roomId
- 聊天室idpublic reactor.core.publisher.Mono<Void> blockAllUserSendMsgToRoom(String roomId)
API使用示例:
EMService service;
try {
service.block().blockAllUserSendMsgToRoom("roomId").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
roomId
- 聊天室idCopyright © 2024. All rights reserved.