public class ModerationApi extends Object
构造器和说明 |
---|
ModerationApi(Context context) |
限定符和类型 | 方法和说明 |
---|---|
reactor.core.publisher.Mono<Path> |
download(String uuid,
Path dir,
String filename)
下载文件。
|
reactor.core.publisher.Mono<String> |
export(long beginTimestamp,
long endTimestamp,
String targetType,
String messageType,
String moderationResult,
String providerResult)
按查询条件导出文件。
|
reactor.core.publisher.Mono<ExportDetailsListResponse> |
get(int page,
int pageSize,
String uuid)
获取导出详情列表。
|
public ModerationApi(Context context)
public reactor.core.publisher.Mono<String> export(long beginTimestamp, long endTimestamp, String targetType, String messageType, String moderationResult, String providerResult)
API使用示例:
EMService service;
try {
String uuid = service.moderation().export(1646723027000, 1646733127000, "chat", "txt", "PASS", "PASS").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
beginTimestamp
- 查询起始时间,毫秒时间戳endTimestamp
- 查询截止时间,毫秒时间戳targetType
- 用判断单聊、群聊还是聊天室,chat: 单聊;groupchat: 群聊;chatroom: 聊天室messageType
- 消息类型,txt: 文本;img: 图片;video: 视频;audio: 音频moderationResult
- 处置结果,PASS: 通过;REJECT: 拒绝;EXCHANGE: 替换;RECALL: 撤回providerResult
- 审核结果,PASS: 正常内容;REVIEWED: 需要审核;REJECT: 违规内容;UNKNOWN: 异常public reactor.core.publisher.Mono<ExportDetailsListResponse> get(int page, int pageSize, String uuid)
API使用示例:
EMService service;
try {
String uuid = service.moderation().get(1, 10, "287c0730-9e97-11ec-ba62-139a925bb42e").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
page
- 导出哪页的详情pageSize
- 每页详情的数量uuid
- 导出文件的uuid,通过 "按查询条件导出文件" 的 api 获取public reactor.core.publisher.Mono<Path> download(String uuid, Path dir, String filename)
API使用示例:
EMService service;
try {
Path path = FileSystems.getDefault().getPath("/Users/xxx/");
Path path = service.moderation().download("287c0730-9e97-11ec-ba62-139a925bb42e", path, "record.txt").block();
} catch (EMException e) {
e.getErrorCode();
e.getMessage();
}
uuid
- 文件的uuid,通过 "按查询条件导出文件" 的 api 获取dir
- 下载到哪个目录,如果不存在会自动创建filename
- 下载到哪个文件,可以理解为带后缀的文件名,建议使用 .txt为后缀Copyright © 2024. All rights reserved.