use of com.qcloud.cos.model.ciModel.auditing.TextAuditingRequest in project cos-java-sdk-v5 by tencentyun.
the class TextAuditingJobDemo method createAuditingTextJobs.
/**
* createAuditingTextJobs 接口用于创建文本审核任务。
*/
public static void createAuditingTextJobs(COSClient client) {
// 1.创建任务请求对象
TextAuditingRequest request = new TextAuditingRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("demo-1234567898");
// 2.1.1设置对象地址
// request.getInput().setObject("1.txt");
// 2.1.2或直接设置请求内容,文本内容的Base64编码
request.getInput().setContent("Base64Str");
// 2.2设置审核类型参数
request.getConf().setDetectType("all");
// 2.3设置审核模板(可选)
// request.getConf().setBizType("aa3e9d84a6a079556b0109a935c*****");
// 设置回调信息内容类型 simple精简 Detail详细
request.getConf().setCallbackVersion(CallbackVersion.Simple);
// 3.调用接口,获取任务响应对象
TextAuditingResponse response = client.createAuditingTextJobs(request);
// 4.调用工具类,获取各审核类型详情集合 (也可自行根据业务解析)
List<AuditingInfo> auditingInfoList = AuditingResultUtil.getAuditingInfoList(response.getJobsDetail());
}
use of com.qcloud.cos.model.ciModel.auditing.TextAuditingRequest in project cos-java-sdk-v5 by tencentyun.
the class TextAuditingJobDemo method describeAuditingTextJob.
/**
* DescribeAuditingJob 接口用于查询文本审核任务。
*
* @param client
*/
public static void describeAuditingTextJob(COSClient client) {
// 1.创建任务请求对象
TextAuditingRequest request = new TextAuditingRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("demo-123456789");
request.setJobId("st68d08596f35011eb9324525400*****");
// 3.调用接口,获取任务响应对象
TextAuditingResponse response = client.describeAuditingTextJob(request);
}
Aggregations