Browse Source

test pass

dev
yinzuomei 5 years ago
parent
commit
375a16b19b
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoScanDetailDTO.java
  2. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java
  3. 12
      epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java
  4. 1
      epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanParam.java
  5. 2
      epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginalResultDTO.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoScanDetailDTO.java

@ -43,7 +43,7 @@ public class VideoScanDetailDTO implements Serializable {
/** /**
* 视频语音检测结果具体结构描述请参见audioScanResult * 视频语音检测结果具体结构描述请参见audioScanResult
*/ */
private ResultDetail audioScanResults; private List<ResultDetail> audioScanResults;
@Data @Data

8
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java

@ -205,9 +205,9 @@ public class ScanContentUtils {
//语音检测结果 //语音检测结果
// testVoiceResults(); // testVoiceResults();
//视频检测任务提交 //视频检测任务提交
testVideoAsyncScan(); // testVideoAsyncScan();
//查询视频检测结果 //查询视频检测结果
// testVideoResults(); testVideoResults();
} }
public static void testTextSyncScan(){ public static void testTextSyncScan(){
@ -269,7 +269,7 @@ public class ScanContentUtils {
String url = "http://localhost:8107/epmetscan/api/videoAsyncScan"; String url = "http://localhost:8107/epmetscan/api/videoAsyncScan";
VideoTaskDTO p = new VideoTaskDTO(); VideoTaskDTO p = new VideoTaskDTO();
p.setDataId("1"); p.setDataId("1");
p.setUrl("???"); p.setUrl("https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20210111/e996a68b9f0144a3843666c430f73086.mp4");
List<VideoTaskDTO> list = new ArrayList<>(); List<VideoTaskDTO> list = new ArrayList<>();
list.add(p); list.add(p);
VideoScanParamDTO param = new VideoScanParamDTO(); VideoScanParamDTO param = new VideoScanParamDTO();
@ -282,7 +282,7 @@ public class ScanContentUtils {
public static void testVideoResults(){ public static void testVideoResults(){
String url = "http://localhost:8107/epmetscan/api/videoResults"; String url = "http://localhost:8107/epmetscan/api/videoResults";
List<String> taskIds=new ArrayList<>(); List<String> taskIds=new ArrayList<>();
taskIds.add("???"); taskIds.add("vi6ZatqnJEkqf5m@FZ7Ka0AU-1tKYdk");
Result<VideoAsyncScanResultDTO> result = ScanContentUtils.videoResults(url, taskIds); Result<VideoAsyncScanResultDTO> result = ScanContentUtils.videoResults(url, taskIds);
System.out.println("================" + JSON.toJSONString(result)); System.out.println("================" + JSON.toJSONString(result));
} }

12
epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java

@ -718,13 +718,15 @@ public class ScanServiceImpl implements ScanService {
* @author yinzuomei * @author yinzuomei
* @description 返回视频语音检测结果 * @description 返回视频语音检测结果
**/ **/
private boolean getVoiceFlag(VoiceAsyncScanResultDTO audioScanResults) { private boolean getVoiceFlag(List<VoiceAsyncScanResultDTO> audioScanResults) {
if (null == audioScanResults) { if (CollectionUtils.isEmpty(audioScanResults)) {
return true; return true;
} }
//人工审核或者内容违规,统一视为不通过 for(VoiceAsyncScanResultDTO m:audioScanResults){
if (!SuggestionEnum.PASS.getCode().equals(audioScanResults.getSuggestion())) { //人工审核或者内容违规,统一视为不通过
return false; if (!SuggestionEnum.PASS.getCode().equals(m.getSuggestion())) {
return false;
}
} }
return true; return true;
} }

1
epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanParam.java

@ -52,7 +52,6 @@ public class VideoAsyncScanParam implements Serializable {
* logo视频logo * logo视频logo
* ad视频图文违规 * ad视频图文违规
*/ */
@NotEmpty(message = "视频检测场景不能为空")
private List<String> scenes; private List<String> scenes;
/** /**

2
epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginalResultDTO.java

@ -47,5 +47,5 @@ public class VideoScanOriginalResultDTO implements Serializable {
/** /**
* 视频语音检测结果具体结构描述请参见audioScanResult * 视频语音检测结果具体结构描述请参见audioScanResult
*/ */
private VoiceAsyncScanResultDTO audioScanResults; private List<VoiceAsyncScanResultDTO> audioScanResults;
} }

Loading…
Cancel
Save