From 0278936321bc3e10af46259ac59718c5d406f1fb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 17 Dec 2020 17:51:47 +0800 Subject: [PATCH 1/5] =?UTF-8?q?/data/report/screen/agency/compartment?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=BF=94=E5=8F=82agencyagencyLevel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/AgencyDistributionResultDTO.java | 11 +++++++++++ .../screen/dto/result/CompartmentResultDTO.java | 5 ++--- .../screen/impl/AgencyServiceImpl.java | 4 ++-- .../mapper/screen/ScreenCustomerAgencyDao.xml | 5 +++-- .../resources/mapper/screen/ScreenCustomerGridDao.xml | 3 ++- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java index 3a91fdfbf7..e8822ea470 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java @@ -38,6 +38,17 @@ public class AgencyDistributionResultDTO implements Serializable { */ private String type; + /** + * 若果是组织,对应返回screen_customer_agency的 level + * 机关级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + */ + private String agencyLevel; + public AgencyDistributionResultDTO() { this.subAreaMarks = ""; this.subCenterMark = ""; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java index b959cf8ea7..c7c219d57a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java @@ -1,6 +1,5 @@ package com.epmet.evaluationindex.screen.dto.result; -import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -32,6 +31,7 @@ public class CompartmentResultDTO implements Serializable { private String areaMarks = ""; /** + * 当前组织的级别 * 机关级别 * 社区级:community, * 乡(镇、街道)级:street, @@ -39,8 +39,7 @@ public class CompartmentResultDTO implements Serializable { * 市级: city * 省级:province */ - @JsonIgnore - private String level; + private String agencyLevel; /** * 子级用户分布 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 3232cf7793..ff1fdaabd7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -195,7 +195,7 @@ public class AgencyServiceImpl implements AgencyService { if (null == agencyAreaInfo){ return new CompartmentResultDTO(); } - if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + if (agencyAreaInfo.getAgencyLevel().equals(ScreenConstant.COMMUNITY)){ // 当level为"community"时,查询screen_customer_grid表 List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); @@ -213,7 +213,7 @@ public class AgencyServiceImpl implements AgencyService { if (null == agencyAreaInfo){ return new CompartmentResultDTO(); } - if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + if (agencyAreaInfo.getAgencyLevel().equals(ScreenConstant.COMMUNITY)){ // 当level为"community"时,查询screen_customer_grid表 List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 9d5338ac65..f61667fb1c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -44,7 +44,7 @@ agency_id AS agencyId, agency_name AS name, area_marks AS areaMarks, - level AS level + level as agencyLevel FROM screen_customer_agency WHERE @@ -60,7 +60,8 @@ agency_name AS subName, area_marks AS subAreaMarks, center_mark AS subCenterMark, - 'agency' AS type + 'agency' AS type, + level as agencyLevel FROM screen_customer_agency WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 997ad03d98..0262675182 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -10,7 +10,8 @@ grid_name AS subName, area_marks AS subAreaMarks, center_mark AS subCenterMark, - 'grid' AS type + 'grid' AS type, + '' as agencyLevel FROM screen_customer_grid WHERE From e2df889b2931e2cd0987cadb93d4c2d2d50236b1 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 17 Dec 2020 23:47:26 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E8=BF=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fact/impl/FactIndexServiceImpl.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 01e0a69ac6..e352ba9937 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -77,12 +77,12 @@ public class FactIndexServiceImpl implements FactIndexService { } //4.根据组织级别判断查询哪类数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分数据 list = factIndexAgencyScoreDao.selectAgencyAblityWeightScoreIndex(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 list = factIndexCommunityScoreDao.selectCommunityAblityWeightScore(formDTO); } else { @@ -179,11 +179,11 @@ public class FactIndexServiceImpl implements FactIndexService { } //3.根据组织级别判断查询哪类数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { //3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 resultList = factIndexAgencyScoreDao.selectAgencyWeightScoreList(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { //3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 resultList = factIndexCommunityScoreDao.selectCommunityWeightScoreList(formDTO); } else { @@ -227,12 +227,12 @@ public class FactIndexServiceImpl implements FactIndexService { } //4.根据组织级别判断查询哪类数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 list = factIndexAgencyScoreDao.selectAgencyMonthWeightScoreList(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 list = factIndexCommunityScoreDao.selectCommunityMonthWeightScoreList(formDTO); } else { @@ -298,8 +298,8 @@ public class FactIndexServiceImpl implements FactIndexService { } //3.根据组织级别拼接查询条件,判断查询不同数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { - if ("district".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { + if ("district".equals(agency.getAgencyLevel())) { formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); } else { formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); @@ -307,7 +307,7 @@ public class FactIndexServiceImpl implements FactIndexService { resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); } else { @@ -366,10 +366,10 @@ public class FactIndexServiceImpl implements FactIndexService { } //4.根据组织级别拼接查询条件,判断查询不同数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); } else { //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); From 87faef26be7883598a45257a01ea4dc8850fea70 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Dec 2020 09:59:43 +0800 Subject: [PATCH 3/5] =?UTF-8?q?getAgencyAreaInfo=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E7=95=99level,=E6=B7=BB=E5=8A=A0agencyId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/result/CompartmentResultDTO.java | 3 +++ .../main/resources/mapper/screen/ScreenCustomerAgencyDao.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java index c7c219d57a..9e941152e4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.evaluationindex.screen.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -30,6 +31,8 @@ public class CompartmentResultDTO implements Serializable { */ private String areaMarks = ""; + @JsonIgnore + private String level; /** * 当前组织的级别 * 机关级别 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index f61667fb1c..e6aa6f262a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -44,6 +44,7 @@ agency_id AS agencyId, agency_name AS name, area_marks AS areaMarks, + level as level, level as agencyLevel FROM screen_customer_agency From 809225ffe11245fca2fa752e406742da0a8e39dd Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Dec 2020 12:58:46 +0800 Subject: [PATCH 4/5] =?UTF-8?q?ScanContentUtils=E6=96=B0=E5=A2=9EvoiceAsyn?= =?UTF-8?q?cScan=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/scan/param/VoiceScanParamDTO.java | 35 ++++++++++ .../tools/scan/param/VoiceTaskDTO.java | 31 +++++++++ .../tools/scan/result/AsyncScanResult.java | 49 ++++++++++++++ .../tools/scan/result/AsyncScanTaskDTO.java | 25 +++++++ .../commons/tools/utils/ScanContentUtils.java | 66 ++++++++++++++++++- .../scan/service/impl/ScanServiceImpl.java | 14 +++- .../support/param/VoiceAsyncScanParam.java | 5 ++ .../result/VoiceAsyncScanTaskDataDTO.java | 4 +- .../result/VoiceAsyncScanTaskResult.java | 28 +++++++- 9 files changed, 249 insertions(+), 8 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceScanParamDTO.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceTaskDTO.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanTaskDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceScanParamDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceScanParamDTO.java new file mode 100644 index 0000000000..e315848ec1 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceScanParamDTO.java @@ -0,0 +1,35 @@ +package com.epmet.commons.tools.scan.param; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 语音检测入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 10:15 + */ +@Data +public class VoiceScanParamDTO implements Serializable { + + /** + * 是否开启回调 + */ + @NotNull(message = "openCallBack必填,true开启;false不开启") + private Boolean openCallBack; + + /** + * 异步检测结果回调地址,执行异步审查内容时 必填 + * openCallBack=true时,callback必填 + */ + private String callback; + + @Valid + @NotEmpty(message = "任务列表不能为空") + private List tasks; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceTaskDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceTaskDTO.java new file mode 100644 index 0000000000..a0abe2303a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceTaskDTO.java @@ -0,0 +1,31 @@ +package com.epmet.commons.tools.scan.param; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 语音异步检测对象 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 10:21 + */ +@Data +public class VoiceTaskDTO implements Serializable { + /** + * 不必填 + * 要检测的数据id 非必填 + * 检测对象对应的数据ID。 + * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。 + * */ + @NotBlank(message = "dataId不能为空") + private String dataId; + + /** + * 必填 + * 需要检测的音频文件或语音流的下载地址。 + */ + @NotBlank(message = "音频URL不能为空") + private String url; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java new file mode 100644 index 0000000000..77cabbfed7 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java @@ -0,0 +1,49 @@ +package com.epmet.commons.tools.scan.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 语音异步检测 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 10:09 + */ +@Data +public class AsyncScanResult implements Serializable { + private static final long serialVersionUID = -939433332419948118L; + + /** + * 随机字符串,该值用于回调通知请求中的签名。 + */ + private String seed; + + /** + * 提交成功的失败对象 + */ + private List successTasks=new ArrayList<>(); + + /** + * 提交失败的检测对象 + */ + private List failTasks=new ArrayList<>(); + + /** + * 是否全部提交成功 + */ + private boolean isAllSuccess; + + public boolean isAllSuccess() { + if (failTasks.isEmpty() && !successTasks.isEmpty()) { + return true; + } + return isAllSuccess; + } + + public void setAllSuccess(boolean allSuccess) { + isAllSuccess = allSuccess; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanTaskDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanTaskDTO.java new file mode 100644 index 0000000000..e09ed9ae5d --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanTaskDTO.java @@ -0,0 +1,25 @@ +package com.epmet.commons.tools.scan.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 语音异步检测 -返回的task集合 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 10:31 + */ +@Data +public class AsyncScanTaskDTO implements Serializable { + /** + * 检测对象对应的数据ID。 + * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。 + */ + private String dataId; + + /** + * 任务id + */ + private String taskId; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index ef7a3257a6..2ab6e7dda6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -4,9 +4,8 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.scan.param.ImgScanParamDTO; -import com.epmet.commons.tools.scan.param.TextScanParamDTO; -import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.param.*; +import com.epmet.commons.tools.scan.result.AsyncScanResult; import com.epmet.commons.tools.scan.result.SyncScanResult; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -75,7 +74,44 @@ public class ScanContentUtils { } } + /** + * desc:语音异步检测任务提交 + * + * @return + */ + public static Result voiceAsyncScan(String url, VoiceScanParamDTO param){ + log.debug("voiceAsyncScan param:{}", JSON.toJSONString(param)); + if (StringUtils.isBlank(url) || param == null) { + throw new RenException("参数错误"); + } + if (param.getOpenCallBack() && StringUtils.isBlank(param.getCallback())) { + throw new RenException("参数错误,开启回调,callback必填"); + } + try { + Result result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); + log.debug("voiceAsyncScan result:{}", JSON.toJSONString(result)); + if (result.success()) { + return JSON.parseObject(result.getData(),new TypeReference>(){}); + } + Result resultResult = new Result<>(); + resultResult.error(result.getCode(),result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.error("voiceAsyncScan exception:", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + } + + public static void main(String[] args) { + //测试文本检测 + // testTextSyncScan(); + //测试语音检测 + testVoiceAsyncScan(); + } + + public static void testTextSyncScan(){ String url = "http://localhost:8107/epmetscan/api/textSyncScan"; TextTaskDTO p = new TextTaskDTO(); p.setDataId("1"); @@ -95,6 +131,30 @@ public class ScanContentUtils { result.getFailDataIds().addAll(imgSyncScanResultData.getFailDataIds()); System.out.println("================"+JSON.toJSONString(result)); } + } + } + + public static void testVoiceAsyncScan(){ + String url = "http://localhost:8107/epmetscan/api/voiceAsyncScan"; + VoiceTaskDTO p = new VoiceTaskDTO(); + p.setDataId("1"); + p.setUrl("https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201208/6480bd6be9f14a458162218cea84dfa5.aac"); + List list = new ArrayList<>(); + list.add(p); + VoiceScanParamDTO param = new VoiceScanParamDTO(); + param.setTasks(list); + param.setOpenCallBack(false); + Result asyncScanResultResult = ScanContentUtils.voiceAsyncScan(url, param); + System.out.println(JSON.toJSONString(asyncScanResultResult)); + AsyncScanResult result = new AsyncScanResult(); + if (asyncScanResultResult != null) { + AsyncScanResult asyncScanResult = asyncScanResultResult.getData(); + if (asyncScanResultResult.success()) { + result.setAllSuccess(asyncScanResult.isAllSuccess()); + result.getSuccessTasks().addAll(asyncScanResult.getSuccessTasks()); + result.getFailTasks().addAll(asyncScanResult.getFailTasks()); + System.out.println("================" + JSON.toJSONString(result)); } } + } } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java index 86897f5a9e..27e6ce3ea0 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java @@ -30,6 +30,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.io.UnsupportedEncodingException; +import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -306,7 +307,18 @@ public class ScanServiceImpl implements ScanService { //成功返回 VoiceAsyncScanTaskResult resultDto=new VoiceAsyncScanTaskResult(); resultDto.setSeed(voiceAsyncScanParam.getSeed()); - resultDto.setTaskList(taskList); + List successList = new ArrayList<>(); + List failedList = new ArrayList<>(); + taskList.forEach(taskDetail -> { + if (HttpStatus.SC_OK == taskDetail.getCode()) { + successList.add(taskDetail); + } else { + failedList.add(taskDetail); + } + }); + resultDto.setSuccessTasks(successList); + resultDto.setFailTasks(failedList); + resultDto.setAllSuccess(resultDto.isAllSuccess()); if (StringUtils.isNotBlank(voiceAsyncScanParam.getCallback())) { // 存储seed和 任务id、dataId的关系 用于回调鉴权 log.info("need to save seed and taskId、dataId的关系"); diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceAsyncScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceAsyncScanParam.java index d83b8784a0..baa8e51be0 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceAsyncScanParam.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceAsyncScanParam.java @@ -17,6 +17,11 @@ import java.util.List; public class VoiceAsyncScanParam implements Serializable { private static final long serialVersionUID = 3408043673247901184L; + /** + * 是否开启回调 + */ + private Boolean openCallBack; + /** * 不必填 * 该字段用于标识您的业务场景。您可以通过内容安全控制台创建业务场景(具体操作,请参见自定义机审标准),或者提交工单联系我们帮助您创建业务场景。 diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskDataDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskDataDTO.java index 6c94bfa757..ce43fec932 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskDataDTO.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskDataDTO.java @@ -6,7 +6,7 @@ import lombok.Data; import java.io.Serializable; /** - * 描述一下 + * 语音异步检测,返回检测对象列表 * * @author yinzuomei@elink-cn.com * @date 2020/12/9 16:38 @@ -17,7 +17,7 @@ public class VoiceAsyncScanTaskDataDTO implements Serializable { * 错误码,和HTTP状态码一致。 * 更多信息,请参见公共错误码。 */ - private String code; + private Integer code; /** * 错误描述信息。 */ diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskResult.java index 44d54fcf3a..2dcbecc398 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskResult.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskResult.java @@ -3,10 +3,11 @@ package com.epmet.openapi.scan.support.result; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** - * 音频审查返参,用于接收taskId + * 语音异步检测,返参 * * @author yinzuomei@elink-cn.com * @date 2020/12/9 9:23 @@ -18,5 +19,28 @@ public class VoiceAsyncScanTaskResult implements Serializable { * 随机字符串,该值用于回调通知请求中的签名。 */ private String seed; - private List taskList; + + /** + * 提交成功的失败对象 + */ + private List successTasks=new ArrayList<>(); + + /** + * 提交失败的检测对象 + */ + private List failTasks=new ArrayList<>(); + + /** + * 是否全部提交成功 + */ + private boolean isAllSuccess; + + public boolean isAllSuccess() { + if (failTasks.isEmpty() && !successTasks.isEmpty()) { + return true; + } + return isAllSuccess; + } + + } From e828d1d51f46fb7126e6ae34083e7dd9f7bfc0b1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Dec 2020 14:20:48 +0800 Subject: [PATCH 5/5] =?UTF-8?q?ScanContentUtils=E6=96=B0=E5=A2=9EvoiceResu?= =?UTF-8?q?lts=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/scan/result/VoiceResultDTO.java | 50 ++++++++++++++ .../commons/tools/utils/ScanContentUtils.java | 47 ++++++++++++- .../scan/common/constant/SysConstant.java | 6 ++ .../openapi/scan/common/enu/LabelEnum.java | 66 +++++++++++++++++++ .../scan/service/impl/ScanServiceImpl.java | 46 +++++++++++-- .../support/result/VoiceAsyncScanResult.java | 52 ++++++++++++--- 6 files changed, 250 insertions(+), 17 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VoiceResultDTO.java create mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/LabelEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VoiceResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VoiceResultDTO.java new file mode 100644 index 0000000000..c16a6a9536 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VoiceResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.commons.tools.scan.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 检测成功(检测成功+检测失败的)的任务详情 + * 处理中的该接口不返回,继续轮询即可 + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 13:10 + */ +@Data +public class VoiceResultDTO implements Serializable { + private static final long serialVersionUID = 8006827312407034344L; + /** + * 检测对象对应的数据ID。 + */ + private String dataId; + + /** + * 检测任务的ID + */ + private String taskId; + + /** + * 建议您执行的后续操作。取值: + * pass:结果正常,无需进行其余操作。 + * review:结果不确定,需要进行人工审核。 + * block:结果违规,建议直接删除或者限制公开。 + */ + private String suggestion; + + /** + * 检测结果的分类。取值: + * normal:正常文本 + * spam:含垃圾信息 + * ad:广告 + * politics:涉政 + * terrorism:暴恐 + * abuse:辱骂 + * porn:色情 + * flood:灌水 + * contraband:违禁 + * meaningless:无意义 + * customized:自定义(例如命中自定义关键词) + */ + private String label; + private String labelDesc; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index 2ab6e7dda6..effd25ccd6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -2,13 +2,16 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.*; import com.epmet.commons.tools.scan.result.AsyncScanResult; import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.scan.result.VoiceResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; @@ -77,7 +80,7 @@ public class ScanContentUtils { /** * desc:语音异步检测任务提交 * - * @return + * @return 返回检测对象对应的任务id */ public static Result voiceAsyncScan(String url, VoiceScanParamDTO param){ log.debug("voiceAsyncScan param:{}", JSON.toJSONString(param)); @@ -103,12 +106,44 @@ public class ScanContentUtils { } } + /** + * desc:语音异步检测结果查询 + * + * @param taskIds 数组中的元素个数不超过100个。 + * @return 注意该接口只返回检测任务完成的(即检测成功或失败的);任务正在处理中的不返回,继续轮询即可。 + */ + public static Result> voiceResults(String url, List taskIds) { + if (StringUtils.isBlank(url) || CollectionUtils.isEmpty(taskIds)) { + throw new RenException("参数错误"); + } + if (taskIds.size() > NumConstant.ONE_HUNDRED) { + throw new RenException("参数错误,查询检测任务最大不能超过100"); + } + try { + Result result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(taskIds)); + log.debug("voiceResults result:{}", JSON.toJSONString(result)); + if (result.success()) { + return JSON.parseObject(result.getData(), new TypeReference>>() { + }); + } + Result> resultResult = new Result<>(); + resultResult.error(result.getCode(), result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.error("voiceResults exception:", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + } + public static void main(String[] args) { //测试文本检测 // testTextSyncScan(); //测试语音检测 - testVoiceAsyncScan(); + // testVoiceAsyncScan(); + //语音检测结果 + testVoiceResults(); } public static void testTextSyncScan(){ @@ -157,4 +192,12 @@ public class ScanContentUtils { } } } + + public static void testVoiceResults(){ + String url = "http://localhost:8107/epmetscan/api/voiceResults"; + List taskIds=new ArrayList<>(); + taskIds.add("vc_f_6CXRk1VcAwM6u0FMA@CfoW-1tDgIp"); + Result> asyncScanResultResult = ScanContentUtils.voiceResults(url, taskIds); + System.out.println("================" + JSON.toJSONString(asyncScanResultResult)); + } } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java index 8d7aa5d4d0..387294c23b 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java @@ -21,4 +21,10 @@ public class SysConstant { public static final String CODE = "code"; public static final String DATA = "data"; + + + /** + * 任务正在执行中,建议您等待一段时间(例如5s)后再查询结果。 + */ + public static final int PROCESSING=280; } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/LabelEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/LabelEnum.java new file mode 100644 index 0000000000..7ad96f3171 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/LabelEnum.java @@ -0,0 +1,66 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * 阿里检测结果的分类字典 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 14:04 + */ +public enum LabelEnum { + NORMAL("normal", "正常文本"), + SPAM("spam", "含垃圾信息"), + AD("ad", "广告"), + POLITICS("politics","涉政"), + TERRORISM("terrorism","暴恐"), + ABUSE("abuse","辱骂"), + PORN("porn","色情"), + FLOOD("flood","灌水"), + CONTRABAND("contraband","违禁"), + MEANINGLESS("meaningless","无意义"), + CUSTOMIZED("customized","自定义"); + + private String code; + private String desc; + + LabelEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static List getLabelEnumList() { + List result = new ArrayList<>(); + LabelEnum[] values = LabelEnum.values(); + for (LabelEnum v : values) { + result.add(v.getCode()); + } + return result; + } + + public static String getDesc(String code) { + LabelEnum[] businessModeEnums = values(); + for (LabelEnum labelEnum : businessModeEnums) { + if (labelEnum.getCode().equals(code)) { + return labelEnum.getDesc(); + } + } + return ""; + } + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java index 27e6ce3ea0..6bd9caf156 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java @@ -10,6 +10,8 @@ import com.aliyuncs.green.model.v20180509.VoiceAsyncScanRequest; import com.aliyuncs.green.model.v20180509.VoiceAsyncScanResultsRequest; import com.aliyuncs.http.FormatType; import com.aliyuncs.http.HttpResponse; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.openapi.scan.common.constant.SysConstant; import com.epmet.openapi.scan.common.enu.*; @@ -412,11 +414,11 @@ public class ScanServiceImpl implements ScanService { try { request.setHttpContent(JSON.toJSONString(taskIds).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); } catch (UnsupportedEncodingException e) { - log.error("getVoiceAsyncScanResult parse param exception", e); + log.error("voiceResults parse param exception", e); return new Result>().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); } - log.info("语音异步检测结果查询入参:"+JSON.toJSONString(taskIds,true)); + // log.info("语音异步检测结果查询入参:"+JSON.toJSONString(taskIds,true)); try { HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(request); @@ -429,12 +431,13 @@ public class ScanServiceImpl implements ScanService { //获取data列表 JSONArray dataResults = scrResponse.getJSONArray(SysConstant.DATA); List resultList = dataResults.toJavaList(VoiceAsyncScanResult.class); + List resultData=processVoiceAsyncScanResult(resultList); //成功返回 - return new Result>().ok(resultList); + return new Result>().ok(resultData); }else{ - log.warn("getVoiceAsyncScanResult detect not success. code:{}", scrResponse.getInteger(SysConstant.CODE)); + log.warn("voiceResults detect not success. code:{}", scrResponse.getInteger(SysConstant.CODE)); throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); } @@ -445,12 +448,45 @@ public class ScanServiceImpl implements ScanService { SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); } } catch (Exception e) { - log.error("executeSyncVoice exception IAcsClientUtil do action exception", e); + log.error("voiceResults exception IAcsClientUtil do action exception", e); throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg()); } } + private List processVoiceAsyncScanResult(List resultList) { + List list = new ArrayList<>(); + for (VoiceAsyncScanResult voiceAsyncScanResult : resultList) { + if (SysConstant.PROCESSING == voiceAsyncScanResult.getCode()) { + //280:表示处理中,需要继续轮询 + continue; + } + VoiceAsyncScanResult dto = ConvertUtils.sourceToTarget(voiceAsyncScanResult, VoiceAsyncScanResult.class); + if (HttpStatus.SC_OK == voiceAsyncScanResult.getCode()) { + if (!CollectionUtils.isEmpty(voiceAsyncScanResult.getResults()) && voiceAsyncScanResult.getResults().size() > NumConstant.ZERO) { + //目前只有一个检测场景,所以只判断返回来的第一个场景 + VoiceAsyncScanResultDTO voiceAsyncScanResultDTO = voiceAsyncScanResult.getResults().get(NumConstant.ZERO); + if (null != voiceAsyncScanResultDTO) { + dto.setLabel(voiceAsyncScanResultDTO.getLabel()); + dto.setLabelDesc(LabelEnum.getDesc(voiceAsyncScanResultDTO.getLabel())); + dto.setSuggestion(voiceAsyncScanResultDTO.getSuggestion()); + } + } + } else if(HttpStatus.SC_NOT_FOUND == voiceAsyncScanResult.getCode()) { + dto.setSuggestion(SuggestionEnum.REVIEW.getCode()); + dto.setLabel(NumConstant.EMPTY_STR); + dto.setLabelDesc("智能检测任务失败,结果已失效," + SuggestionEnum.REVIEW.getDesc()); + }else{ + //其他:表示任务失败 + dto.setSuggestion(SuggestionEnum.REVIEW.getCode()); + dto.setLabel(NumConstant.EMPTY_STR); + dto.setLabelDesc("智能检测任务失败," + SuggestionEnum.REVIEW.getDesc()); + } + list.add(dto); + } + return list; + } + private VoiceAsyncScanResultsRequest getVoiceAsyncScanResultsRequest(){ VoiceAsyncScanResultsRequest getResultsRequest = new VoiceAsyncScanResultsRequest(); // 指定API返回格式。 diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResult.java index 09fd13ec73..df56e86a4c 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResult.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResult.java @@ -15,6 +15,43 @@ import java.util.List; @Data public class VoiceAsyncScanResult implements Serializable { private static final long serialVersionUID = 8702129292884498023L; + + /** + * 检测对象对应的数据ID。 + */ + private String dataId; + + /** + * 检测任务的ID + */ + private String taskId; + + /** + * 检测结果的分类。取值: + * normal:正常文本 + * spam:含垃圾信息 + * ad:广告 + * politics:涉政 + * terrorism:暴恐 + * abuse:辱骂 + * porn:色情 + * flood:灌水 + * contraband:违禁 + * meaningless:无意义 + * customized:自定义(例如命中自定义关键词) + */ + private String label; + private String labelDesc; + + /** + * 建议您执行的后续操作。取值: + * pass:结果正常,无需进行其余操作。 + * review:结果不确定,需要进行人工审核。 + * block:结果违规,建议直接删除或者限制公开。 + */ + private String suggestion; + + /** * 错误码,和HTTP状态码一致。 * 200:表示检测成功。 @@ -22,20 +59,13 @@ public class VoiceAsyncScanResult implements Serializable { * 其他:表示任务失败。 * 更多信息,请参见公共错误码。 */ - private String code; + @JsonIgnore + private Integer code; /** * 错误描述信息。 */ + @JsonIgnore private String msg; - /** - * 检测对象对应的数据ID。 - */ - private String dataId; - - /** - * 检测任务的ID - */ - private String taskId; /** * 暂时没用,所以返回忽略 @@ -45,7 +75,9 @@ public class VoiceAsyncScanResult implements Serializable { /** * 检测成功(code=200)时,返回的检测结果。该结果包含一个或多个元素,每个元素是个结构体,对应一个场景。关于每个元素的结构描述,请参见result。 + * 暂时不展示审核结果明细 */ + @JsonIgnore private List results; }