diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-client/pom.xml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-client/pom.xml
deleted file mode 100644
index 5c57808384..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-client/pom.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
- epmet-openapi-adv
- com.epmet
- 2.0.0
- ../pom.xml
-
- 4.0.0
-
- epmet-openapi-adv-client
-
-
-
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/Dockerfile b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/Dockerfile
deleted file mode 100644
index d15b865820..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/Dockerfile
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM java:8
-
-RUN export LANG="zh_CN.UTF-8"
-RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
-RUN echo 'Asia/Shanghai' > /etc/timezone
-
-COPY ./target/*.jar ./epmet-openapi-adv.jar
-
-EXPOSE 8115
-
-ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"]
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-dev.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-dev.yml
deleted file mode 100644
index 55c505363d..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-dev.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: "3.7"
-services:
- epmet-openapi-adv-server:
- container_name: epmet-openapi-adv-server-dev
- image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-adv-server:version_placeholder
- ports:
- - "8015:8015"
- network_mode: host # 不会创建新的网络
- volumes:
- - "/opt/epmet-cloud-logs/dev:/logs"
- environment:
- RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-openapi-adv.jar"
- restart: "unless-stopped"
- deploy:
- resources:
- limits:
- cpus: '0.1'
- memory: 300M
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-prod.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-prod.yml
deleted file mode 100644
index b5a13e04e3..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-prod.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: "3.7"
-services:
- epmet-openapi-adv-server:
- container_name: epmet-openapi-adv-server-prod
- image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-openapi-adv-server:0.3.3
- ports:
- - "8015:8015"
- network_mode: host # 不会创建新的网络
- volumes:
- - "/opt/epmet-cloud-logs/prod:/logs"
- environment:
- RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-openapi-adv.jar"
- restart: "unless-stopped"
- deploy:
- resources:
- limits:
- cpus: '0.1'
- memory: 600M
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-test.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-test.yml
deleted file mode 100644
index 45d536cb2f..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-test.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: "3.7"
-services:
- epmet-openapi-adv-server:
- container_name: epmet-openapi-adv-server-test
- image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-openapi-adv-server:version_placeholder
- ports:
- - "8015:8015"
- network_mode: host # 不会创建新的网络
- volumes:
- - "/opt/epmet-cloud-logs/test:/logs"
- environment:
- RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-openapi-adv.jar"
- restart: "unless-stopped"
- deploy:
- resources:
- limits:
- cpus: '0.1'
- memory: 300M
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/pom.xml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/pom.xml
deleted file mode 100644
index 8dd1602e70..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/pom.xml
+++ /dev/null
@@ -1,227 +0,0 @@
-
-
-
- 0.3.3
-
- epmet-openapi-adv
- com.epmet
- 2.0.0
- ../pom.xml
-
- 4.0.0
-
- epmet-openapi-adv-server
-
-
-
- com.epmet
- epmet-commons-mybatis
- 2.0.0
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework
- spring-context-support
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-nacos-discovery
-
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-nacos-config
-
-
-
- io.github.openfeign
- feign-httpclient
- 10.3.0
-
-
-
-
- ${project.artifactId}
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- true
-
-
-
-
- ${project.basedir}/src/main/java
-
-
- true
- ${basedir}/src/main/resources
-
-
-
-
-
-
- dev
-
- 8115
- dev
-
-
-
-
-
- epmet_adv_user
- EpmEt-db-UsEr
-
- 0
- 192.168.1.130
- 6379
- 123456
-
- true
- 192.168.1.130:8848
- 6ceab336-d004-4acf-89c6-e121d06f4988
-
-
- false
-
-
- false
-
-
- https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c
-
- SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
-
-
-
-
- local
-
- true
-
-
- 8115
- local
-
-
-
-
-
- epmet_adv_user
- EpmEt-db-UsEr
-
- 0
- 118.190.150.119
- 47379
- 123456
-
- false
- 192.168.1.130:8848
- 6ceab336-d004-4acf-89c6-e121d06f4988
-
-
- false
-
-
- false
-
-
- https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c
-
- SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
-
- https://epmet-dev.elinkservice.cn/api/epmetscan/api
-
-
-
- test
-
-
- 8115
- test
-
-
-
-
-
- epmet
- elink@833066
-
- 0
- r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com
- 6379
- EpmEtrEdIs!q@w
-
- true
- 192.168.10.150:8848
- 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae
-
-
- false
-
-
- true
-
-
- https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c
-
- SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
-
-
-
-
- prod
-
- 8115
- prod
-
-
-
-
-
- epmet_adv_user
- EpmEt-db-UsEr
-
- 0
- r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com
- 6379
- EpmEtclOUdrEdIs!Q2w
-
- true
- 192.168.11.180:8848
- bd205d23-e696-47be-b995-916313f86e99
-
-
- false
-
-
- true
-
-
-
- https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c
-
- SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1
-
-
-
-
-
-
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/AdvApplication.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/AdvApplication.java
deleted file mode 100644
index 61c5d3b4b8..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/AdvApplication.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.epmet;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.openfeign.EnableFeignClients;
-
-@SpringBootApplication
-@EnableDiscoveryClient
-@EnableFeignClients
-public class AdvApplication {
- public static void main(String[] args) {
- SpringApplication.run(AdvApplication.class, args);
- }
-}
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/aspect/RequestLogAspect.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/aspect/RequestLogAspect.java
deleted file mode 100644
index e06fdc2c95..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/aspect/RequestLogAspect.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.epmet.adv.aspect;
-
-import com.epmet.commons.tools.aspect.BaseRequestLogAspect;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。
- */
-@Aspect
-@Component
-@Order(0)
-public class RequestLogAspect extends BaseRequestLogAspect {
-
- @Override
- @Around(value = "execution(* com.epmet.adv.controller.*Controller*.*(..)) ")
- public Object proceed(ProceedingJoinPoint point) throws Throwable {
- return super.proceed(point, getRequest());
- }
-
- /**
- * 获取Request对象
- *
- * @return
- */
- private HttpServletRequest getRequest() {
- RequestAttributes ra = RequestContextHolder.getRequestAttributes();
- ServletRequestAttributes sra = (ServletRequestAttributes) ra;
- return sra.getRequest();
- }
-
-}
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/config/ModuleConfigImpl.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/config/ModuleConfigImpl.java
deleted file mode 100644
index 8d88549b66..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/config/ModuleConfigImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Copyright (c) 2018 人人开源 All rights reserved.
- *
- * https://www.renren.io
- *
- * 版权所有,侵权必究!
- */
-
-package com.epmet.adv.config;
-
-import com.epmet.commons.tools.config.ModuleConfig;
-import org.springframework.stereotype.Service;
-
-/**
- * 模块配置信息
- *
- * @author Mark sunlightcs@gmail.com
- * @since 1.0.0
- */
-@Service
-public class ModuleConfigImpl implements ModuleConfig {
- @Override
- public String getName() {
- return "adv";
- }
-}
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/controller/AdvVideoController.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/controller/AdvVideoController.java
deleted file mode 100644
index 5c032ad562..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/controller/AdvVideoController.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.epmet.adv.controller;
-
-import com.epmet.adv.entity.AdvVedioEntity;
-import com.epmet.adv.service.AdvVedioService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.io.IOException;
-
-@Controller
-@RequestMapping("video")
-public class AdvVideoController {
-
- @Autowired
- private AdvVedioService advVedioService;
-
- @GetMapping("company-adv")
- public String toVedio() throws IOException {
- AdvVedioEntity enableAdvVedioEntity = advVedioService.getEnableAdvVedioEntity();
- String redirectUrl = enableAdvVedioEntity != null ? enableAdvVedioEntity.getPath() : "404";
- return String.format("redirect:%s", redirectUrl);
- //response.sendRedirect("www.baidu.com");
- }
-
-}
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/dao/AdvVedioDao.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/dao/AdvVedioDao.java
deleted file mode 100644
index c14da09d52..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/dao/AdvVedioDao.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.adv.dao;
-
-import com.epmet.adv.entity.AdvVedioEntity;
-import com.epmet.commons.mybatis.dao.BaseDao;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 宣传视频
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-12-30
- */
-@Mapper
-public interface AdvVedioDao extends BaseDao {
- AdvVedioEntity getEnableAdvVedioEntity();
-}
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/entity/AdvVedioEntity.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/entity/AdvVedioEntity.java
deleted file mode 100644
index a25c6ea77e..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/entity/AdvVedioEntity.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.adv.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.util.Date;
-
-/**
- * 宣传视频
- *
- * @author generator generator@elink-cn.com
- * @since v1.0.0 2020-12-30
- */
-@Data
-@EqualsAndHashCode(callSuper=false)
-@TableName("adv_vedio")
-public class AdvVedioEntity extends BaseEpmetEntity {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 存储路径
- */
- private String path;
-
- /**
- * 存储类型。aliyun_oss,local
- */
- private String storeType;
-
- /**
- * 是否启用
- */
- private Integer enable;
-
-}
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/AdvVedioService.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/AdvVedioService.java
deleted file mode 100644
index 38091ee496..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/AdvVedioService.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.epmet.adv.service;
-
-import com.epmet.adv.entity.AdvVedioEntity;
-
-public interface AdvVedioService {
- AdvVedioEntity getEnableAdvVedioEntity();
-}
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/impl/AdvVedioServiceImpl.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/impl/AdvVedioServiceImpl.java
deleted file mode 100644
index cecc710c39..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/impl/AdvVedioServiceImpl.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.epmet.adv.service.impl;
-
-import com.epmet.adv.dao.AdvVedioDao;
-import com.epmet.adv.entity.AdvVedioEntity;
-import com.epmet.adv.service.AdvVedioService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class AdvVedioServiceImpl implements AdvVedioService {
- @Autowired
- private AdvVedioDao advVedioDao;
-
- public AdvVedioEntity getEnableAdvVedioEntity() {
- return advVedioDao.getEnableAdvVedioEntity();
- }
-
-}
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml
deleted file mode 100644
index 0bd40dcca7..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml
+++ /dev/null
@@ -1,140 +0,0 @@
-server:
- port: @server.port@
- version: @version@
- servlet:
- context-path: /adv
-
-spring:
- main:
- allow-bean-definition-overriding: true
- application:
- name: epmet-openapi-adv-server
- #环境 dev|test|prod
- profiles:
- active: @spring.profiles.active@
- messages:
- encoding: UTF-8
- basename: i18n/messages_common
- jackson:
- time-zone: GMT+8
- date-format: yyyy-MM-dd HH:mm:ss
- redis:
- database: @spring.redis.index@
- host: @spring.redis.host@
- port: @spring.redis.port@
- password: @spring.redis.password@
- timeout: 30s
- datasource:
- druid:
- #MySQL
- driver-class-name: com.mysql.cj.jdbc.Driver
- url: @spring.datasource.druid.url@
- username: @spring.datasource.druid.username@
- password: @spring.datasource.druid.password@
- initial-size: 10
- max-active: 100
- min-idle: 10
- max-wait: 60000
- pool-prepared-statements: true
- max-pool-prepared-statement-per-connection-size: 20
- time-between-eviction-runs-millis: 60000
- min-evictable-idle-time-millis: 300000
- #Oracle需要打开注释
- #validation-query: SELECT 1 FROM DUAL
- test-while-idle: true
- test-on-borrow: false
- test-on-return: false
- filter:
- stat:
- log-slow-sql: true
- slow-sql-millis: 1000
- merge-sql: false
- wall:
- config:
- multi-statement-allow: true
- # 数据迁移工具flyway
- flyway:
- enabled: @spring.flyway.enabled@
- locations: classpath:db/migration
- url: @spring.datasource.druid.url@
- user: @spring.datasource.druid.username@
- password: @spring.datasource.druid.password@
- baseline-on-migrate: true
- baseline-version: 0
- cloud:
- nacos:
- discovery:
- server-addr: @nacos.server-addr@
- #nacos的命名空间ID,默认是public
- namespace: @nacos.discovery.namespace@
- #不把自己注册到注册中心的地址
- register-enabled: @nacos.register-enabled@
- ip: @nacos.ip@
- config:
- enabled: @nacos.config-enabled@
- server-addr: @nacos.server-addr@
- namespace: @nacos.config.namespace@
- group: @nacos.config.group@
- file-extension: yaml
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: ALWAYS
-
-mybatis-plus:
- mapper-locations: classpath:/mapper/**/*.xml
- #实体扫描,多个package用逗号或者分号分隔
- typeAliasesPackage: com.epmet.entity
- global-config:
- #数据库相关配置
- db-config:
- #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
- id-type: ID_WORKER
- #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
- field-strategy: NOT_NULL
- #驼峰下划线转换
- column-underline: true
- banner: false
- #原生配置
- configuration:
- map-underscore-to-camel-case: true
- cache-enabled: false
- call-setters-on-nulls: true
- jdbc-type-for-null: 'null'
-
-feign:
- hystrix:
- enabled: true
- client:
- config:
- default:
- loggerLevel: BASIC
- okhttp:
- enabled: true
-
-
-hystrix:
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 60000 #缺省为1000
-
-ribbon:
- ReadTimeout: 300000
- ConnectTimeout: 300000
-
-#pageHelper分页插件
-pagehelper:
- helper-dialect: mysql
- reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1
-
-dingTalk:
- robot:
- webHook: @dingTalk.robot.webHook@
- secret: @dingTalk.robot.secret@
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/db/migration/V0.0.1__createAdvVedio.sql b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/db/migration/V0.0.1__createAdvVedio.sql
deleted file mode 100644
index 007c12b55f..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/db/migration/V0.0.1__createAdvVedio.sql
+++ /dev/null
@@ -1,18 +0,0 @@
--- create database epmet_adv default character set utf8mb4;
-
--- CREATE USER epmet_adv_user@'%' IDENTIFIED BY 'EpmEt-db-UsEr';
--- GRANT ALL ON `epmet_adv%`.* TO 'epmet_adv_user'@'%';
--- flush privileges;
-
-CREATE TABLE `adv_vedio` (
- `ID` varchar(64) NOT NULL COMMENT 'id' primary key ,
- `PATH` varchar(255) NOT NULL COMMENT '存储路径',
- `STORE_TYPE` varchar(30) NOT NULL COMMENT '存储类型。aliyun_oss,local',
- `ENABLE` tinyint(1) NOT NULL COMMENT '是否启用',
- `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
- `DEL_FLAG` int(11) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除',
- `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者',
- `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
- `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者',
- `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间'
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='宣传视频'
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/logback-spring.xml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/logback-spring.xml
deleted file mode 100644
index 06a21d317c..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/logback-spring.xml
+++ /dev/null
@@ -1,169 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- ${appname}
-
-
-
-
-
-
-
-
- debug
-
-
- ${CONSOLE_LOG_PATTERN}
-
- UTF-8
-
-
-
-
-
-
-
- ${log.path}/debug.log
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n
- UTF-8
-
-
-
-
- ${log.path}/debug-%d{yyyy-MM-dd}.%i.log
-
- 100MB
-
-
- 15
-
-
-
- debug
- ACCEPT
- DENY
-
-
-
-
-
-
- ${log.path}/info.log
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n
- UTF-8
-
-
-
-
- ${log.path}/info-%d{yyyy-MM-dd}.%i.log
-
- 100MB
-
-
- 15
-
-
-
- info
- ACCEPT
- DENY
-
-
-
-
-
-
- ${log.path}/warn.log
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n
- UTF-8
-
-
-
- ${log.path}/warn-%d{yyyy-MM-dd}.%i.log
-
- 100MB
-
-
- 15
-
-
-
- warn
- ACCEPT
- DENY
-
-
-
-
-
-
- ${log.path}/error.log
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n
- UTF-8
-
-
-
- ${log.path}/error-%d{yyyy-MM-dd}.%i.log
-
- 100MB
-
-
- 15
-
-
-
- ERROR
- ACCEPT
- DENY
- ${webHook}
- ${secret}
- ${appname}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/mapper/AdvVedioDao.xml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/mapper/AdvVedioDao.xml
deleted file mode 100644
index 92a4993b9f..0000000000
--- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/mapper/AdvVedioDao.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- select id,
- path,
- store_type,
- enable,
- revision,
- del_flag,
- created_by,
- created_time,
- updated_by,
- updated_time
- from adv_vedio
- where ENABLE = 1
- limit 1;
-
-
-
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-adv/pom.xml b/epmet-openapi/epmet-openapi-adv/pom.xml
deleted file mode 100644
index 13490687d1..0000000000
--- a/epmet-openapi/epmet-openapi-adv/pom.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- epmet-openapi
- com.epmet
- 2.0.0
-
- pom
- 4.0.0
-
- epmet-openapi-adv
-
-
- epmet-openapi-adv-client
- epmet-openapi-adv-server
-
-
-
-
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/Dockerfile b/epmet-openapi/epmet-openapi-scan/Dockerfile
deleted file mode 100644
index 868fc70ac1..0000000000
--- a/epmet-openapi/epmet-openapi-scan/Dockerfile
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM java:8
-
-RUN export LANG="zh_CN.UTF-8"
-RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
-RUN echo 'Asia/Shanghai' > /etc/timezone
-
-COPY ./target/*.jar ./epmet-openapi-scan.jar
-
-EXPOSE 8107
-
-ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"]
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml
deleted file mode 100644
index 4e86ab5e89..0000000000
--- a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: "3.7"
-services:
- epmet-openapi-scan:
- container_name: epmet-openapi-scan-dev
- image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-scan:version_placeholder
- ports:
- - "8107:8107"
- network_mode: host # 不会创建新的网络
- volumes:
- - "/opt/epmet-cloud-logs/dev:/logs"
- environment:
- RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-openapi-scan.jar"
- restart: "unless-stopped"
- deploy:
- resources:
- limits:
- cpus: '0.1'
- memory: 300M
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-prod.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-prod.yml
deleted file mode 100644
index 69873777e7..0000000000
--- a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-prod.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: "3.7"
-services:
- epmet-openapi-scan:
- container_name: epmet-openapi-scan-prod
- image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-openapi-scan:0.3.24
- ports:
- - "8107:8107"
- network_mode: host # 不会创建新的网络
- volumes:
- - "/opt/epmet-cloud-logs/prod:/logs"
- environment:
- RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-openapi-scan.jar"
- restart: "unless-stopped"
- deploy:
- resources:
- limits:
- cpus: '0.1'
- memory: 600M
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml
deleted file mode 100644
index 49ce30a8c1..0000000000
--- a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: "3.7"
-services:
- epmet-openapi-scan:
- container_name: epmet-openapi-scan-test
- image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-openapi-scan:version_placeholder
- ports:
- - "8107:8107"
- network_mode: host # 不会创建新的网络
- volumes:
- - "/opt/epmet-cloud-logs/test:/logs"
- environment:
- RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-openapi-scan.jar"
- restart: "unless-stopped"
- deploy:
- resources:
- limits:
- cpus: '0.1'
- memory: 300M
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml
deleted file mode 100644
index b80b8a843e..0000000000
--- a/epmet-openapi/epmet-openapi-scan/pom.xml
+++ /dev/null
@@ -1,208 +0,0 @@
-
-
-
- 4.0.0
- 0.3.24
- epmet-openapi-scan
- jar
-
-
- epmet-openapi
- com.epmet
- 2.0.0
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework
- spring-context-support
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-nacos-discovery
-
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-nacos-config
-
-
- com.epmet
- epmet-commons-tools
- 2.0.0
-
-
-
- com.aliyun
- aliyun-java-sdk-core
- 4.1.1
-
-
- com.aliyun
- aliyun-java-sdk-green
- 3.5.1
-
-
-
- org.apache.httpcomponents
- httpclient
- 4.5.2
-
-
-
-
- ${project.artifactId}
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- true
-
-
-
-
- ${project.basedir}/src/main/java
-
-
- true
- ${basedir}/src/main/resources
-
-
-
-
-
-
- dev
-
- 8107
- dev
-
-
-
- 0
- 192.168.1.130
- 6379
- 123456
-
- true
- 192.168.1.130:8848
- 6ceab336-d004-4acf-89c6-e121d06f4988
-
-
- false
-
-
-
- https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c
-
- SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
-
-
-
-
- local
-
- true
-
-
- 8107
- dev
-
-
-
- 0
- 192.168.1.130
- 6379
- 123456
-
- false
- 192.168.1.130:8848
- 6ceab336-d004-4acf-89c6-e121d06f4988
-
-
- false
-
-
-
- https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c
-
- SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
-
-
-
-
- test
-
- 8107
- test
-
-
- 0
- r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com
- 6379
- EpmEtrEdIs!q@w
-
- true
- 192.168.10.150:8848
- 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae
-
-
- false
-
-
-
- https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c
-
- SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19
-
-
-
-
-
- prod
-
-
- 8107
- prod
-
-
- 0
- r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com
- 6379
- EpmEtclOUdrEdIs!Q2w
-
- true
- 192.168.11.180:8848
- bd205d23-e696-47be-b995-916313f86e99
-
-
- false
-
-
-
-
-
- https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c
-
- SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1
-
-
-
-
-
-
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java
deleted file mode 100644
index 38f55211d2..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Copyright (c) 2018 人人开源 All rights reserved.
- *
- * https://www.renren.io
- *
- * 版权所有,侵权必究!
- */
-
-package com.epmet.openapi.scan;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.ComponentScan;
-
-/**
- * 管理后台
- *
- * @author Mark sunlightcs@gmail.com
- * @since 1.0.0
- */
-
-@SpringBootApplication
-@ComponentScan(basePackages = "com.epmet")
-public class ScanApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(ScanApplication.class, args);
- }
-
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java
deleted file mode 100644
index ae6960a52d..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.epmet.openapi.scan.aspect;
-
-import com.epmet.commons.tools.aspect.BaseRequestLogAspect;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。
- */
-@Aspect
-@Component
-@Order(0)
-public class RequestLogAspect extends BaseRequestLogAspect {
-
- @Override
- @Around(value = "execution(* com.epmet.openapi.scan.controller.*Controller*.*(..)) ")
- public Object proceed(ProceedingJoinPoint point) throws Throwable {
- return super.proceed(point, getRequest());
- }
-
- /**
- * 获取Request对象
- *
- * @return
- */
- private HttpServletRequest getRequest() {
- RequestAttributes ra = RequestContextHolder.getRequestAttributes();
- ServletRequestAttributes sra = (ServletRequestAttributes) ra;
- return sra.getRequest();
- }
-
-}
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
deleted file mode 100644
index 387294c23b..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.epmet.openapi.scan.common.constant;
-
-/**
- * 系统常量
- *
- * @author jianjun liu
- * @date 2020-06-05 10:42
- **/
-public class SysConstant {
-
- public static final String UTF8 = "utf-8";
- /**
- * 文本审核最大任务数
- */
- public static final Integer MAX_TASK_SIZE = 100;
-
- /**
- * 图片审核最大任务数
- */
- public static final Integer MAX_SCAN_IMG_TASK_SIZE = 10;
-
- 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/CommonErrorCodeEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/CommonErrorCodeEnum.java
deleted file mode 100644
index 8ebed5781f..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/CommonErrorCodeEnum.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.epmet.openapi.scan.common.enu;
-
-import com.epmet.commons.tools.constant.StrConstant;
-
-/**
- * 公共错误码
- *
- * @author yinzuomei@elink-cn.com
- * @date 2021/1/10 19:43
- */
-public enum CommonErrorCodeEnum {
- OK(200, "请求成功。"),
- PROCESSING(280, "任务正在执行中,建议您等待一段时间(例如5s)后再查询结果。"),
- BAD_REQUEST(400, "请求有误,通常由于请求参数不正确导致,请仔细检查请求参数。"),
- NOT_ALLOWED(401, "请求失败,通常是由于使用了不安全的图片、视频、语音链接地址。"),
- FORBIDDEN(403, "请求访问失败,通常由于您的图片、视频、语音链接无法访问导致,请确认公网是否可访问,并且无防盗链策略。"),
- NOT_FOUND(404, "待检测内容未找到,通常是由于您的图片、视频、语音内容无法下载导致,请确认内容可通过公网访问到。"),
- DOWNLOAD_FAILED(480, "下载失败,请确认待检测内容的大小、分辨率(如果有)在API的限制范围内。"),
- GENERAL_ERROR(500, "一般是服务端临时出错。建议重试,若持续返回该错误码,请通过工单联系我们。"),
- DB_FAILED(580, "数据库操作失败。建议重试,若持续返回该错误码,请通过工单联系我们。"),
- TIMEOUT(581, "超时。建议重试,若持续返回该错误码,请通过工单联系我们。"),
- CACHE_FAILED(585, "缓存出错。建议重试,若持续返回该错误码,请通过工单联系我们。"),
- ALGO_FAILED(586, "算法出错。请通过工单联系我们。"),
- MQ_FAILED(587, "中间件出错。请通过工单联系我们。"),
- EXCEED_QUOTA(588, "请求频率超出配额。默认配额:图片检测50张/秒,视频检测20路/秒,语音检测20路/秒,文本检测100条/秒。如果需要调整配额,请通过工单联系我们。"),
- TOO_LARGE(589, "待检测内容过大,请确保检测的内容在API的限制范围内。建议重试,若持续返回该错误码,请通过工单联系我们。"),
- BAD_FORMAT(590, "待检测内容格式错误,请确保检测的内容在API的限制范围内。"),
- CONNECTION_POOL_FULL(591, "连接池满。请通过工单联系我们。"),
- DOWNLOAD_TIMEOUT(592, "下载超时,下载时间限制为3s,请确保检测的内容大小在API的限制范围内。"),
- EXPIRED(594, "任务过期,如taskId过期。"),
- CATCH_FRAME_FAILED(595, "截帧失败,请通过工单联系我们。"),
- PERMISSION_DENY(596, "账号未授权、账号欠费、账号未开通、账号被禁等原因,具体可以参考返回的msg。");
-
-
- private Integer code;
- private String desc;
-
- CommonErrorCodeEnum(Integer code, String desc) {
- this.code = code;
- this.desc = desc;
- }
-
- public Integer getCode() {
- return code;
- }
-
- public void setCode(Integer code) {
- this.code = code;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
- public static String getErrorMsg(Integer value) {
- CommonErrorCodeEnum[] codeEnums = values();
- for (CommonErrorCodeEnum commonErrorCodeEnum : codeEnums) {
- if (commonErrorCodeEnum.getCode().equals(value)) {
- return commonErrorCodeEnum.getDesc();
- }
- }
- return StrConstant.EPMETY_STR;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java
deleted file mode 100644
index cfb8d77ac2..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.epmet.openapi.scan.common.enu;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * desc:图片检测场景
- * @author jianjun liu
- * @date 2020-06-04 21:39
- **/
-public enum ImgSceneEnum {
- PORN("porn", "图片智能鉴黄"),
- TERRORISM("terrorism", "图片暴恐涉政识别");
-
- private String code;
- private String desc;
-
- ImgSceneEnum(String code, String desc) {
- this.code = code;
- this.desc = desc;
- }
-
- public static List getImgSceneList() {
- List result = new ArrayList<>();
- ImgSceneEnum[] values = ImgSceneEnum.values();
- for (ImgSceneEnum v : values) {
- result.add(v.getCode());
- }
- return result;
- }
-
- 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/common/enu/LabelEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/LabelEnum.java
deleted file mode 100644
index 7ad96f3171..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/LabelEnum.java
+++ /dev/null
@@ -1,66 +0,0 @@
-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/common/enu/RegionIdEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java
deleted file mode 100644
index e1dbd5897b..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.epmet.openapi.scan.common.enu;
-
-/**
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-04 21:39
- **/
-public enum RegionIdEnum {
- SHANG_HAI("cn-shanghai","green.cn-shanghai.aliyuncs.com"),
- BEI_JING("cn-beijing","green.cn-beijing.aliyuncs.com"),
- AP_SOUTHEAST_1("ap-southeast-1","green.ap-southeast-1.aliyuncs.com"),
- US_WEST_1("us-west-1","green.us-west-1.aliyuncs.com");
-
- private String regionId;
- private String domain;
- RegionIdEnum(String regionId, String domain){
- this.regionId = regionId;
- this.domain = domain;
- }
-
- public static String getDoMain(String regionId){
- if (regionId == null) {
- return SHANG_HAI.getDomain();
- }
- RegionIdEnum[] values = RegionIdEnum.values();
- for (RegionIdEnum v : values) {
- if (regionId.equals(v.getDomain())) {
- return v.getDomain();
- }
- }
- return SHANG_HAI.getDomain();
- }
-
- public String getRegionId() {
- return regionId;
- }
-
- public void setRegionId(String regionId) {
- this.regionId = regionId;
- }
-
- public String getDomain() {
- return domain;
- }
-
- public void setDomain(String domain) {
- this.domain = domain;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SuggestionEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SuggestionEnum.java
deleted file mode 100644
index 3881508341..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SuggestionEnum.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.epmet.openapi.scan.common.enu;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * desc:检测建议
- * @author jianjun liu
- * @date 2020-06-04 21:39
- **/
-public enum SuggestionEnum {
- PASS("pass", "正常"),
- REVIEW("review", "需要人工审核"),
- BLOCK("block", "内容违规");
-
- private String code;
- private String desc;
-
- SuggestionEnum(String code, String desc) {
- this.code = code;
- this.desc = desc;
- }
-
- public static List getImgSceneList() {
- List result = new ArrayList<>();
- SuggestionEnum[] values = SuggestionEnum.values();
- for (SuggestionEnum v : values) {
- result.add(v.getCode());
- }
- return result;
- }
-
- 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/common/enu/SysResponseEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SysResponseEnum.java
deleted file mode 100644
index f906186333..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SysResponseEnum.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.epmet.openapi.scan.common.enu;
-
-/**
- * @author jianjun liu
- * @date 2020-06-04 21:39
- **/
-public enum SysResponseEnum {
- /**
- *
- * 业务代码枚举类
- *
- * 编码样式:【CCCBBOOXX】
- * 编码示例说明:
- * CCC 中心编码&业务系统 (110-内容扫描服务中心服务)
- * BB 业务类型(00-默认 )
- * OO 操作类型(00-默认)
- * XX 具体编码(00-成功,01-失败,02-参数错误,10-异常 99-系统错误)
- *
- */
- /*通用枚举 */
- EXCEPTION(10001,"系统异常"),
- THIRD_PLATFORM_SERVER_ERROR(10002,"第三方检测服务异常,请稍候重试"),
- THIRD_PLATFORM_RESP_STATUS_ERROR(10003,"第三方检测服务响应异常,请稍候重试"),
- THIRD_PLATFORM_RESP_CODE_ERROR(10004,"第三方检测服务检测异常,请稍候重试"),
-
-
- /*审核内容 业务 01*/
- SCAN_TASK_LIST_PARAM_ERROR(110010001,"任务列表长度超过限制"),
- SCAN_PARAM_ERROR(110010002,"参数格式不正确"),
- ;
-
- private Integer code;
- private String msg;
- SysResponseEnum(Integer code, String msg){
- this.code = code;
- this.msg = msg;
- }
-
- public Integer getCode() {
- return code;
- }
-
- public String getMsg() {
- return msg;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/TextSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/TextSceneEnum.java
deleted file mode 100644
index 263d6e25ed..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/TextSceneEnum.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.epmet.openapi.scan.common.enu;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * desc:文本检测场景
- * @author jianjun liu
- * @date 2020-06-04 21:39
- **/
-public enum TextSceneEnum {
- ANTISPAM("antispam", "文本垃圾内容检测");
-
- private String code;
- private String desc;
-
- TextSceneEnum(String code, String desc) {
- this.code = code;
- this.desc = desc;
- }
-
- public static List getTextSceneList() {
- List result = new ArrayList<>();
- TextSceneEnum[] values = TextSceneEnum.values();
- for (TextSceneEnum v : values) {
- result.add(v.getCode());
- }
- return result;
- }
-
- 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/common/enu/VideoSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VideoSceneEnum.java
deleted file mode 100644
index 864d137dd2..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VideoSceneEnum.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.epmet.openapi.scan.common.enu;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * desc:视频检测场景
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/29 13:47
- **/
-public enum VideoSceneEnum {
- PORN("porn", "视频智能鉴黄"),
- TERRORISM("terrorism", "视频暴恐涉政"),
- LIVE("live","视频不良场景"),
- LOGO("logo","视频logo"),
- AD("ad","视频图文违规");
-
- private String code;
- private String desc;
-
- VideoSceneEnum(String code, String desc) {
- this.code = code;
- this.desc = desc;
- }
-
- public static List getVideoSceneList() {
- List result = new ArrayList<>();
- VideoSceneEnum[] values = VideoSceneEnum.values();
- for (VideoSceneEnum v : values) {
- result.add(v.getCode());
- }
- return result;
- }
-
- 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/common/enu/VoiceSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VoiceSceneEnum.java
deleted file mode 100644
index 777b92f0d7..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VoiceSceneEnum.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.epmet.openapi.scan.common.enu;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 语音异步检测场景
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/9 10:12
- */
-public enum VoiceSceneEnum {
- ANTISPAM("antispam", "检测场景,取值:antispam");
-
- private String code;
- private String desc;
-
- VoiceSceneEnum(String code, String desc) {
- this.code = code;
- this.desc = desc;
- }
-
- public static List getVoiceSceneList() {
- List result = new ArrayList<>();
- VoiceSceneEnum[] values = VoiceSceneEnum.values();
- for (VoiceSceneEnum v : values) {
- result.add(v.getCode());
- }
- return result;
- }
-
- 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/common/exception/ExecuteHttpException.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExecuteHttpException.java
deleted file mode 100644
index a5694da79c..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExecuteHttpException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.epmet.openapi.scan.common.exception;
-
-import com.epmet.openapi.scan.common.enu.SysResponseEnum;
-
-/**
- * @author jianjun liu
- * @date 2020-06-05 10:31
- **/
-public class ExecuteHttpException extends RuntimeException {
- private int code;
- private String msg;
-
- public ExecuteHttpException(String msg) {
- this(SysResponseEnum.EXCEPTION.getCode(), msg);
- }
-
- public ExecuteHttpException(int code, String msg) {
- this.code = code;
- this.msg = msg;
- }
-
- public int getCode() {
- return code;
- }
-
- public String getMsg() {
- return msg;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java
deleted file mode 100644
index 2939bd62eb..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2018 人人开源 All rights reserved.
- *
- * https://www.renren.io
- *
- * 版权所有,侵权必究!
- */
-
-package com.epmet.openapi.scan.common.redis;
-
-/**
- * @author Mark sunlightcs@gmail.com
- * @since 1.0.0
- */
-public class RedisKeys {
-
- /**
- * 党群e事通redis前缀
- */
- private static String rootPrefix = "epmet:";
-
- /**
- * desc:白名单Key
- * @return
- */
- public static String getWhiteList () {
- return rootPrefix.concat("openapi:scan:whitelist");
- }
-
- /**
- * desc: 语音检测任务,异步回调,需要根据taskId获取存储seed的Key
- * @param taskId 提交检测任务API接口返回的taskId eg:1001
- * @return epmet:openapi:scan:voice:seed:1001
- */
- public static String getVoiceScanSeedKey(String taskId){
- return rootPrefix.concat("openapi:scan:voice:seed:").concat(taskId);
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/HttpClientManager.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/HttpClientManager.java
deleted file mode 100644
index 7ca0302331..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/HttpClientManager.java
+++ /dev/null
@@ -1,171 +0,0 @@
-package com.epmet.openapi.scan.common.util;
-
-import com.alibaba.fastjson.JSON;
-import com.epmet.commons.tools.utils.Result;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-import org.apache.http.HttpStatus;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.methods.HttpRequestBase;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.EntityUtils;
-import org.springframework.util.CollectionUtils;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * desc: http 工具类
- * date: 2020/6/4 22:27
- *
- * @author: jianjun liu
- */
-@Slf4j
-public class HttpClientManager {
- private static int connectionTimeout = 3000;// 连接超时时间,毫秒
- private static int soTimeout = 10000;// 读取数据超时时间,毫秒
- /**
- * HttpClient对象
- */
- private static CloseableHttpClient httpclient = HttpClients.custom().disableAutomaticRetries().build();
-
- /*** 超时设置 ****/
- private static RequestConfig requestConfig = RequestConfig.custom()
- .setSocketTimeout(soTimeout)
- .setConnectTimeout(connectionTimeout)
- .build();//设置请求和传输超时时间
-
- public static HttpClientManager getInstance() {
- return SingleClass.instance;
- }
-
- private static class SingleClass {
- private final static HttpClientManager instance = new HttpClientManager();
- }
-
- /**
- * desc: 发送json post 请求
- * param: url,jsonStrParam
- * return: Result
- * date: 2019/2/21 9:12
- *
- * @author: jianjun liu
- */
- public Result sendPost(String url, Map paramsMap) {
-
- try {
- HttpPost httppost = new HttpPost(url);
- httppost.setConfig(requestConfig);
- httppost.addHeader("Content-Type", "application/x-www-form-urlencoded charset=utf-8");
-
- List list = new ArrayList();
- for (String key : paramsMap.keySet()) {
- list.add(new BasicNameValuePair(key, String.valueOf(paramsMap.get(key))));
- }
- UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, "utf-8");
- httppost.setEntity(urlEncodedFormEntity);
-
- return execute(httppost);
- } catch (Exception e) {
- e.printStackTrace();
- log.error("send exception", e);
- return new Result().error(8000, e.getMessage());
- }
-
- }
-
- /**
- * desc: 发送json post 请求
- * param: url,jsonStrParam
- * return: Result
- * date: 2019/2/21 9:12
- *
- * @author: jianjun liu
- */
- public Result sendPostByJSON(String url, String jsonStrParam) {
-
- try {
- HttpPost httppost = new HttpPost(url);
- httppost.setConfig(requestConfig);
- httppost.addHeader("Content-Type", "application/json; charset=utf-8");
- if (StringUtils.isNotEmpty(jsonStrParam)) {
- StringEntity se = new StringEntity(jsonStrParam, "utf-8");
- httppost.setEntity(se);
- }
- return execute(httppost);
- } catch (Exception e) {
- e.printStackTrace();
- log.error("send exception", e);
- return new Result().error(8000, e.getMessage());
- }
-
- }
-
- /**
- * desc: 发送get请求
- * param:url, params
- * return: Result
- * date: 2019/2/21 9:16
- *
- * @author: jianjun liu
- */
- public Result sendGet(String url, Map params) {
-
- try {
- URIBuilder builder = new URIBuilder(url);
- if (!CollectionUtils.isEmpty(params)) {
- Set set = params.keySet();
- for (String key : set) {
- builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key)));
- }
- }
- HttpGet httpGet = new HttpGet(builder.build());
- httpGet.setConfig(requestConfig);
- return execute(httpGet);
- } catch (Exception e) {
- log.error("sendGet exception", e);
- return new Result().error(8000, e.getMessage());
- }
- }
-
- private Result execute(HttpRequestBase httpMethod) {
- CloseableHttpResponse response = null;
- try {
- response = httpclient.execute(httpMethod);
- log.debug("http send response:{}", JSON.toJSONString(response));
- if (response != null && response.getStatusLine() != null) {
- if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
- String result = EntityUtils.toString(response.getEntity());
- return new Result().ok(result);
- } else {
- log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode());
- }
- }
- } catch (Exception e) {
- log.error("execute exception", e);
- } finally {
- httpMethod.releaseConnection();
- try {
- if (response != null) {
- response.close();
- }
- } catch (IOException e) {
- }
- }
- return new Result().error(8000, "系统异常");
- }
-}
-
-
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/IAcsClientUtil.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/IAcsClientUtil.java
deleted file mode 100644
index c0c8362727..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/IAcsClientUtil.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.epmet.openapi.scan.common.util;
-
-/**
- * @author jianjun liu
- * @date 2020-06-05 10:03
- **/
-
-import com.aliyuncs.DefaultAcsClient;
-import com.aliyuncs.IAcsClient;
-import com.aliyuncs.exceptions.ClientException;
-import com.aliyuncs.profile.DefaultProfile;
-import com.aliyuncs.profile.IClientProfile;
-import com.epmet.openapi.scan.common.enu.RegionIdEnum;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-
-@Slf4j
-@Component
-public class IAcsClientUtil {
- private static String accessKeyId;
- private static String secret;
- private static String product = "Green";
-
- private static String regionId;
- private static String endpointName = "";
-
- private static IClientProfile profile;
-
-
- @PostConstruct
- private void initProFile() {
- profile = DefaultProfile.getProfile(regionId, accessKeyId, secret);
- try {
- DefaultProfile.addEndpoint(endpointName, regionId, product, RegionIdEnum.getDoMain(regionId));
- } catch (ClientException e) {
- log.error("initProFile exception", e.getMessage());
- }
- }
-
-
- public static IAcsClient getIAcsClient() {
- return new DefaultAcsClient(profile);
- }
-
- @Value("${aliyun.green.accessKeyId}")
- public void setAccessKeyId(String accessKeyId) {
- IAcsClientUtil.accessKeyId = accessKeyId;
- }
-
- @Value("${aliyun.green.accessKeySecret}")
- public void setSecret(String secret) {
- IAcsClientUtil.secret = secret;
- }
-
- @Value("${aliyun.green.regionId}")
- public void setRegionId(String regionId) {
- IAcsClientUtil.regionId = regionId;
- }
-
- @Value("${aliyun.green.regionId}")
- public void setEndpointName(String endpointName) {
- IAcsClientUtil.endpointName = endpointName;
- }
-}
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/MapUtil.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/MapUtil.java
deleted file mode 100644
index e98dbfd7a2..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/MapUtil.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.epmet.openapi.scan.common.util;
-
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author jianjun liu
- * @date 2020-06-05 16:44
- **/
-public class MapUtil {
- /**
- * 将url参数转换成map
- *
- * @param param aa=11&bb=22&cc=33
- * @return
- */
- public static Map getUrlParams(String param) {
- Map map = new HashMap<>(0);
- if (StringUtils.isBlank(param)) {
- return map;
- }
- String[] params = param.split("&");
- for (int i = 0; i < params.length; i++) {
- String[] p = params[i].split("=");
- if (p.length == 2) {
- map.put(p[0], p[1]);
- }
- }
- return map;
- }
-
- /**
- * 将map转换成url
- *
- * @param map
- * @return
- */
- public static String getUrlParamsByMap(Map map) {
- if (map == null) {
- return "";
- }
- StringBuffer sb = new StringBuffer();
- for (Map.Entry entry : map.entrySet()) {
- sb.append(entry.getKey() + "=" + entry.getValue());
- sb.append("&");
- }
- String s = sb.toString();
- if (s.endsWith("&")) {
- s = StringUtils.substringBeforeLast(s, "&");
- }
- return s;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/ModuleConfigImpl.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/ModuleConfigImpl.java
deleted file mode 100644
index 68532b7819..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/ModuleConfigImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Copyright (c) 2018 人人开源 All rights reserved.
- *
- * https://www.renren.io
- *
- * 版权所有,侵权必究!
- */
-
-package com.epmet.openapi.scan.config;
-
-import com.epmet.commons.tools.config.ModuleConfig;
-import org.springframework.stereotype.Service;
-
-/**
- * 模块配置信息
- *
- * @author Mark sunlightcs@gmail.com
- * @since 1.0.0
- */
-@Service
-public class ModuleConfigImpl implements ModuleConfig {
- @Override
- public String getName() {
- return "epmetscan";
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java
deleted file mode 100644
index c955a7f555..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.epmet.openapi.scan.config;
-
-import com.epmet.openapi.scan.interceptor.ScanApiAuthInterceptor;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-/**
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-08 14:30
- **/
-
- @Configuration
- public class WebAppConfig implements WebMvcConfigurer{
- @Autowired
- private ScanApiAuthInterceptor scanApiAuthInterceptor;
-
- // 多个拦截器组成一个拦截器链
- // addPathPatterns 用于添加拦截规则
- // excludePathPatterns 用户排除拦截
-
- @Override
- public void addInterceptors(InterceptorRegistry registry) {
- registry.addInterceptor(scanApiAuthInterceptor)//添加拦截器
- .addPathPatterns("/**") //拦截所有请求
- .excludePathPatterns("/opback/**");//对应的不拦截的请求
- }
- }
-
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/BackDoorController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/BackDoorController.java
deleted file mode 100644
index 433ff1b06d..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/BackDoorController.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.epmet.openapi.scan.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.epmet.openapi.scan.common.redis.RedisKeys;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.SetOperations;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Set;
-
-/**
- * @author jianjun liu
- * @date 2020-06-04 20:39
- **/
-@RestController
-@RequestMapping("opback")
-public class BackDoorController {
- @Autowired
- private RedisTemplate redisTemplate;
-
- @RequestMapping("addWhite")
- public String addWhite(@RequestParam String ip) {
- SetOperations setOperations = redisTemplate.opsForSet();
- String whiteList = RedisKeys.getWhiteList();
- Long add = setOperations.add(whiteList, ip);
- Set members = setOperations.members(whiteList);
- return "ip:" + ip + "添加" + (add > 0 ? "成功" : "失败") + ",当前所有列表:" + JSON.toJSONString(members);
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java
deleted file mode 100644
index cee27d28b8..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package com.epmet.openapi.scan.controller;
-
-import com.epmet.commons.tools.utils.Result;
-import com.epmet.commons.tools.validator.ValidatorUtils;
-import com.epmet.openapi.scan.common.constant.SysConstant;
-import com.epmet.openapi.scan.common.enu.SysResponseEnum;
-import com.epmet.openapi.scan.service.impl.ScanService;
-import com.epmet.openapi.scan.support.param.ImgScanParam;
-import com.epmet.openapi.scan.support.param.TextScanParam;
-import com.epmet.openapi.scan.support.param.VoiceAsyncScanParam;
-import com.epmet.openapi.scan.support.param.video.VideoAsyncScanParam;
-import com.epmet.openapi.scan.support.result.ImgAsyncScanResult;
-import com.epmet.openapi.scan.support.result.SyncScanResult;
-import com.epmet.openapi.scan.support.result.VoiceAsyncScanResult;
-import com.epmet.openapi.scan.support.result.VoiceAsyncScanTaskResult;
-import com.epmet.openapi.scan.support.result.video.VideoAsyncScanTaskResultDTO;
-import com.epmet.openapi.scan.support.result.video.VideoResultDTO;
-import org.apache.commons.collections4.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-05 10:39
- **/
-@RestController
-@RequestMapping("api")
-public class ScanController {
-
- @Autowired
- private ScanService scanService;
-
- /**
- * desc:图片同步检测接口
- *
- * @param param
- * @return
- */
- @RequestMapping("imgSyncScan")
- public Result ImgSyncScan(@RequestBody ImgScanParam param) {
- ValidatorUtils.validateEntity(param);
- return scanService.sendSyncImgScan(param);
- }
-
- /**
- * desc:文本同步检测接口
- *
- * @param param
- * @return
- */
- @RequestMapping("textSyncScan")
- public Result textSyncScan(@RequestBody TextScanParam param) {
- ValidatorUtils.validateEntity(param);
- return scanService.sendTextScan(param);
- }
-
- //@RequestMapping("imgAsyncScan")
- public Result ImgAsyncScan(@RequestBody ImgScanParam param) {
- return null;//scanService.sendASyncImgScan(param);
- }
-
-
- /**
- * @description 语音异步检测
- * @Date 2020/12/9 9:14
- **/
- @PostMapping("voiceAsyncScan")
- public Result voiceAsyncScan(@RequestBody VoiceAsyncScanParam param){
- ValidatorUtils.validateEntity(param);
- return scanService.sendVoiceAsyncScan(param);
- }
-
- /**
- * @param taskIds 要查询的异步检测任务的taskId列表。数组中的元素个数不超过100个
- * @author yinzuomei
- * @description 语音异步检测结果查询
- * @Date 2020/12/9 11:16
- **/
- @PostMapping("voiceResults")
- public Result> voiceResults(@RequestBody List taskIds){
- return scanService.voiceResults(taskIds);
- }
-
- /**
- * @author yinzuomei
- * @description 视频检测-异步检测
- **/
- @PostMapping("videoAsyncScan")
- public Result videoAsyncScan(@RequestBody VideoAsyncScanParam param) {
- ValidatorUtils.validateEntity(param);
- return scanService.videoAsyncScan(param);
- }
-
- /**
- * @author yinzuomei
- * @description 视频异步检测结果查询接口
- **/
- @PostMapping("videoResults")
- public Result videoResults(@RequestBody List taskIds) {
- if (CollectionUtils.isEmpty(taskIds)) {
- return new Result<>();
- }
- //检测对象不能为空,且最多支持100个元素
- if (org.springframework.util.CollectionUtils.isEmpty(taskIds) || taskIds.size() > SysConstant.MAX_TASK_SIZE) {
- return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(),
- SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg().concat(SysConstant.MAX_TASK_SIZE.toString()));
- }
- return scanService.videoResults(taskIds);
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java
deleted file mode 100644
index 6ce851a45e..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.epmet.openapi.scan.interceptor;
-
-import com.alibaba.fastjson.JSON;
-import com.epmet.commons.tools.exception.EpmetErrorCode;
-import com.epmet.commons.tools.utils.IpUtils;
-import com.epmet.commons.tools.utils.Result;
-import com.epmet.openapi.scan.common.redis.RedisKeys;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.SetOperations;
-import org.springframework.stereotype.Component;
-import org.springframework.web.servlet.HandlerInterceptor;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-/**
- * @author jianjun liu
- * @date 2020-06-05 16:36
- **/
-@Component
-public class ScanApiAuthInterceptor implements HandlerInterceptor {
- private static final Logger log = LoggerFactory.getLogger(ScanApiAuthInterceptor.class);
- @Autowired
- private RedisTemplate redisTemplate;
-
- @Override
- public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
- String ip = IpUtils.getIpAddr(request);
- SetOperations setOperations = redisTemplate.opsForSet();
- if (!setOperations.isMember(RedisKeys.getWhiteList(), ip)) {
- log.warn("preHandle ip:{} is not in whitelist", ip);
- String result = JSON.toJSONString(new Result<>().error(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg()));
- responseJson(response, result);
- return false;
- }
- return true;
- }
-
- private void responseJson(HttpServletResponse response, String json) throws Exception {
- PrintWriter writer = null;
- response.setCharacterEncoding("UTF-8");
- response.setContentType("text/json; charset=utf-8");
- try {
- writer = response.getWriter();
- writer.print(json);
- } catch (IOException e) {
- log.error(e.toString());
- } finally {
- if (writer != null) {
- writer.close();
- }
- }
- }
-
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java
deleted file mode 100644
index 4a3e734893..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.epmet.openapi.scan.service.impl;
-
-import com.epmet.commons.tools.utils.Result;
-import com.epmet.openapi.scan.support.param.ImgScanParam;
-import com.epmet.openapi.scan.support.param.TextScanParam;
-import com.epmet.openapi.scan.support.param.VoiceAsyncScanParam;
-import com.epmet.openapi.scan.support.param.video.VideoAsyncScanParam;
-import com.epmet.openapi.scan.support.result.SyncScanResult;
-import com.epmet.openapi.scan.support.result.VoiceAsyncScanResult;
-import com.epmet.openapi.scan.support.result.VoiceAsyncScanTaskResult;
-import com.epmet.openapi.scan.support.result.video.VideoAsyncScanTaskResultDTO;
-import com.epmet.openapi.scan.support.result.video.VideoResultDTO;
-
-import java.util.List;
-
-/**
- * desc:内容扫描接口
- *
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-05 13:12
- **/
-public interface ScanService {
- /**
- * desc:扫描文本内容 同步
- * @param textScanParam
- * @return ImgAsyncScanResult
- */
- public Result sendTextScan(TextScanParam textScanParam);
-
-
- /**
- * desc:扫描图片内容 同步
- * @param imgScanParam
- * @return
- */
- public Result sendSyncImgScan(ImgScanParam imgScanParam);
-
- /**
- * 语音异步检测
- *
- * @param param
- * @return com.epmet.openapi.scan.support.result.VoiceAsyncScanTaskResult
- */
- Result sendVoiceAsyncScan(VoiceAsyncScanParam param);
-
- /**
- * 语音异步检测结果查询
- *
- * @param taskIds 要查询的异步检测任务的taskId列表。数组中的元素个数不超过100个
- * @return com.epmet.openapi.scan.support.result.VoiceAsyncScanResult
- */
- Result> voiceResults(List taskIds);
-
- /**
- * desc:视频检测-异步检测
- * @param videoAsyncScanParam
- * @return 异步检测)返回数据:taskId<=>dataId
- */
- Result videoAsyncScan(VideoAsyncScanParam videoAsyncScanParam);
-
- /**
- * @param taskIds
- * @author yinzuomei
- * @description 视频异步检测结果查询接口
- * @Date 2020/12/29 16:10
- **/
- Result videoResults(List taskIds);
-}
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
deleted file mode 100644
index 44dd0da3de..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java
+++ /dev/null
@@ -1,734 +0,0 @@
-package com.epmet.openapi.scan.service.impl;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.aliyuncs.AcsRequest;
-import com.aliyuncs.green.model.v20180509.*;
-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.aliyuncs.http.MethodType;
-import com.epmet.commons.tools.utils.Result;
-import com.epmet.openapi.scan.common.constant.SysConstant;
-import com.epmet.openapi.scan.common.enu.*;
-import com.epmet.openapi.scan.common.exception.ExecuteHttpException;
-import com.epmet.openapi.scan.common.redis.RedisKeys;
-import com.epmet.openapi.scan.common.util.IAcsClientUtil;
-import com.epmet.openapi.scan.support.param.*;
-import com.epmet.openapi.scan.support.param.video.VideoAsyncScanParam;
-import com.epmet.openapi.scan.support.param.video.VideoAsyncScanTask;
-import com.epmet.openapi.scan.support.result.*;
-import com.epmet.openapi.scan.support.result.video.*;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections4.ListUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpStatus;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.ValueOperations;
-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;
-
-/**
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-05 13:16
- **/
-@Slf4j
-@Service
-public class ScanServiceImpl implements ScanService {
- @Value("${aliyun.green.regionId}")
- private String regionId;
- @Value("${aliyun.green.bizType}")
- private String bizType;
- @Autowired
- private RedisTemplate redisTemplate;
- @Override
- public Result sendTextScan(TextScanParam textScanParam) {
- //默认参数
- // 鉴黄 暴恐涉政
- textScanParam.setScenes(TextSceneEnum.getTextSceneList());
- textScanParam.setBizType(bizType);
-
- List textTasks = textScanParam.getTasks();
- if (CollectionUtils.isEmpty(textTasks) || textTasks.size() > SysConstant.MAX_TASK_SIZE) {
- return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg().concat(SysConstant.MAX_TASK_SIZE.toString()));
- }
-
- TextScanRequest textScanRequest = getTextScanRequest();
-
- try {
- textScanRequest.setHttpContent(JSON.toJSONString(textScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON);
- } catch (UnsupportedEncodingException e) {
- log.error("sendTextScan parse param exception", e);
- return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg());
- }
-
- try {
- SyncScanResult textScanResult = executeSyncText(textScanRequest);
- return new Result().ok(textScanResult);
- } catch (ExecuteHttpException e) {
- log.error("sendTextScan execute Exception", e);
- return new Result().error(e.getCode(), e.getMsg());
- }
- }
-
- private TextScanRequest getTextScanRequest() {
- TextScanRequest textScanRequest = new TextScanRequest();
- textScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
- textScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
- textScanRequest.setEncoding(SysConstant.UTF8);
- textScanRequest.setRegionId(regionId);
- textScanRequest.setConnectTimeout(3000);
- textScanRequest.setReadTimeout(6000);
- return textScanRequest;
- }
-
- @Override
- public Result sendSyncImgScan(ImgScanParam imgScanParam) {
- //默认参数
- // 鉴黄 暴恐涉政
- imgScanParam.setScenes(ImgSceneEnum.getImgSceneList());
- imgScanParam.setBizType(bizType);
-
- List imgTasks = imgScanParam.getTasks();
- if (CollectionUtils.isEmpty(imgTasks) || imgTasks.size() > SysConstant.MAX_TASK_SIZE) {
- return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg().concat(SysConstant.MAX_TASK_SIZE.toString()));
- }
- if (imgTasks.size() <= SysConstant.MAX_SCAN_IMG_TASK_SIZE) {
- return doScanImg(imgScanParam);
- }
- log.info("sendSyncImgScan tasks size:{} over 10", imgTasks.size());
- List> partition = ListUtils.partition(imgTasks, SysConstant.MAX_SCAN_IMG_TASK_SIZE);
- SyncScanResult finalResult = new SyncScanResult();
- for (List tasks : partition) {
- ImgScanParam scanParam = new ImgScanParam();
- scanParam.setBizType(imgScanParam.getBizType());
- scanParam.setScenes(imgScanParam.getScenes());
- scanParam.setTasks(tasks);
- scanParam.setCallback(imgScanParam.getCallback());
- scanParam.setSeed(imgScanParam.getSeed());
- Result partResult = doScanImg(scanParam);
- try {
- Thread.sleep(5L);
- } catch (InterruptedException e) {
- log.error("sendSyncImgScan InterruptedException");
- }
- if (partResult.success()) {
- SyncScanResult data = partResult.getData();
- finalResult.getSuccessDataIds().addAll(data.getSuccessDataIds());
- finalResult.getFailDataIds().addAll(data.getFailDataIds());
- finalResult.getDetails().addAll(data.getDetails());
- } else {
- return partResult;
- }
- }
- return new Result().ok(finalResult);
-
-
- }
-
- private Result doScanImg(ImgScanParam imgScanParam) {
- ImageSyncScanRequest imageSyncScanRequest = getImgScanRequest();
- try {
- imageSyncScanRequest.setHttpContent(JSON.toJSONString(imgScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON);
- } catch (UnsupportedEncodingException e) {
- log.error("sendSyncImgScan parse param exception", e);
- return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg());
- }
-
- try {
- SyncScanResult scanResult = executeSyncImg(imageSyncScanRequest);
- return new Result().ok(scanResult);
- } catch (ExecuteHttpException e) {
- log.error("sendImgScan execute exception,param:{},fail msg:{}", JSON.toJSONString(imgScanParam), e.getMsg());
- return new Result().error(e.getCode(), e.getMsg());
- }
- }
-
- private ImageSyncScanRequest getImgScanRequest() {
- ImageSyncScanRequest imageSyncScanRequest = new ImageSyncScanRequest();
- imageSyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
- imageSyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
- imageSyncScanRequest.setEncoding(SysConstant.UTF8);
- imageSyncScanRequest.setRegionId(regionId);
- imageSyncScanRequest.setConnectTimeout(3000);
- imageSyncScanRequest.setReadTimeout(6000);
- return imageSyncScanRequest;
- }
-
- public SyncScanResult executeSyncText(AcsRequest> textScanRequest) {
- SyncScanResult result = new SyncScanResult();
- try {
- HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(textScanRequest);
-
- if (httpResponse.isSuccess()) {
- JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), SysConstant.UTF8));
- if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) {
- //任务 列表
- List scanTaskResults = scrResponse.getJSONArray(SysConstant.DATA).toJavaList(ScanTaskResult.class);
- for (ScanTaskResult taskResult : scanTaskResults) {
- result.getDetails().add(taskResult);
- //又根据场景不同
- if (HttpStatus.SC_OK != taskResult.getCode()) {
- if (!result.getFailDataIds().contains(taskResult.getDataId())) {
- result.getFailDataIds().add(taskResult.getDataId());
- log.warn("executeSyncText task process fail:code:{},result:{}", taskResult.getCode(), JSON.toJSONString(taskResult));
- }
- continue;
- }
- //如果是多个场景 则为对个 BaseScanResult
- List sceneResults = taskResult.getResults();
- //是文本检测 目前就一种场景
- boolean isSuccess = true;
- for (SceneDetailResult sceneResult : sceneResults) {
- String suggestion = sceneResult.getSuggestion();
- if (SuggestionEnum.BLOCK.getCode().equals(suggestion)) {
- isSuccess = false;
- break;
- }
- }
- if (isSuccess) {
- result.getSuccessDataIds().add(taskResult.getDataId());
- } else {
- log.warn("executeSyncText dataId:{} block:{}", taskResult.getDataId(), JSON.toJSONString(taskResult.getResults()));
- result.getFailDataIds().add(taskResult.getDataId());
- }
- }
- return result;
- } else {
- log.warn("executeSyncText response 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());
- }
- } else {
- log.warn("executeSyncText response status is not success. httpResponse:{}", JSON.toJSONString(httpResponse));
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus());
- }
- } catch (Exception e) {
- log.error("executeSyncText exception IAcsClientUtil do action exception", e);
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg());
- }
- }
-
- private SyncScanResult executeSyncImg(AcsRequest> request) {
- SyncScanResult result = new SyncScanResult();
- try {
- HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(request);
- if (httpResponse.isSuccess()) {
- JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), SysConstant.UTF8));
- if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) {
- JSONArray taskResults = scrResponse.getJSONArray(SysConstant.DATA);
- List scanTaskResults = taskResults.toJavaList(ScanTaskResult.class);
- for (ScanTaskResult taskResult : scanTaskResults) {
- result.getDetails().add(taskResult);
- if (HttpStatus.SC_OK != taskResult.getCode()) {
- if (!result.getFailDataIds().contains(taskResult.getDataId())) {
- result.getFailDataIds().add(taskResult.getDataId());
- log.warn("executeSyncImg detect not success. code:{},result:{}", taskResult.getCode(), JSON.toJSONString(taskResult));
- }
- continue;
- }
- //如果是多个场景 则为对个 BaseScanResult
- List sceneResults = taskResult.getResults();
-
- boolean isSuccess = true;
- for (SceneDetailResult sceneResult : sceneResults) {
- String suggestion = sceneResult.getSuggestion();
- if (SuggestionEnum.BLOCK.getCode().equals(suggestion)) {
- isSuccess = false;
- break;
- }
- }
- if (isSuccess) {
- result.getSuccessDataIds().add(taskResult.getDataId());
- } else {
- log.warn("executeSyncImg dataId:{} block:{}", taskResult.getDataId(), JSON.toJSONString(taskResult.getResults()));
- result.getFailDataIds().add(taskResult.getDataId());
- }
- }
- return result;
- } else {
- log.warn("executeSyncImg 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());
- }
- } else {
- log.warn("executeSyncImg response status is not success. httpResponse:{}", JSON.toJSONString(httpResponse));
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus());
- }
- } catch (Exception e) {
- log.error("executeSyncImg exception IAcsClientUtil do action exception", e);
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg());
- }
- }
-
- /**
- * @author yinzuomei
- * @description 语音异步检测
- * @Date 2020/12/9 10:02
- */
- @Override
- public Result sendVoiceAsyncScan(VoiceAsyncScanParam voiceAsyncScanParam) {
- //检测对象不能为空,且最多支持100个元素
- List voiceTasks = voiceAsyncScanParam.getTasks();
- if (CollectionUtils.isEmpty(voiceTasks) || voiceTasks.size() > SysConstant.MAX_TASK_SIZE) {
- return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(),
- SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg().concat(SysConstant.MAX_TASK_SIZE.toString()));
- }
-
- //默认参数
- voiceAsyncScanParam.setScenes(VoiceSceneEnum.getVoiceSceneList());
- voiceAsyncScanParam.setBizType(bizType);
- // 如果是语音流检测,则修改为true。现在默认为音频文件检测false
- voiceAsyncScanParam.setLive(false);
- voiceAsyncScanParam.setSeed(UUID.randomUUID().toString().replace("-", ""));
-
- VoiceAsyncScanRequest voiceAsyncScanRequest=getVoiceAsyncScanRequest();
-
- try {
- voiceAsyncScanRequest.setHttpContent(JSON.toJSONString(voiceAsyncScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON);
- } catch (UnsupportedEncodingException e) {
- log.error("sendVoiceAsyncScan parse param exception", e);
- return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg());
- }
- log.info("语音异步检测入参:"+JSON.toJSONString(voiceAsyncScanParam,true));
- List taskList;
- try {
- taskList = executeSyncVoice(voiceAsyncScanRequest);
- log.info("语音异步检测返参taskList:"+JSON.toJSONString(taskList,true));
- } catch (ExecuteHttpException e) {
- log.error("sendVoiceAsyncScan execute Exception", e);
- return new Result().error(e.getCode(), e.getMsg());
- }
- //成功返回
- VoiceAsyncScanTaskResult resultDto=new VoiceAsyncScanTaskResult();
- resultDto.setSeed(voiceAsyncScanParam.getSeed());
- 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的关系");
- ValueOperations valueOperations=redisTemplate.opsForValue();
- taskList.forEach(task -> {
- String seedKey = RedisKeys.getVoiceScanSeedKey(task.getTaskId());
- valueOperations.set(seedKey,voiceAsyncScanParam.getSeed());
- });
- }
- return new Result().ok(resultDto);
- }
-
- /**
- * @param
- * @author yinzuomei
- * @description 构造语音异步检测请求对象
- * @Date 2020/12/9 10:44
- **/
- private VoiceAsyncScanRequest getVoiceAsyncScanRequest() {
- VoiceAsyncScanRequest voiceAsyncScanRequest = new VoiceAsyncScanRequest();
- // 指定api返回格式
- voiceAsyncScanRequest.setAcceptFormat(FormatType.JSON);
- // 指定请求方法
- voiceAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST);
- voiceAsyncScanRequest.setEncoding(SysConstant.UTF8);
- voiceAsyncScanRequest.setRegionId(regionId);
- voiceAsyncScanRequest.setConnectTimeout(3000);
- voiceAsyncScanRequest.setReadTimeout(6000);
- return voiceAsyncScanRequest;
- }
-
- /**
- * @param voiceAsyncScanRequest
- * @author yinzuomei
- * @description 解析返参
- * @Date 2020/12/9 10:44
- **/
- private List executeSyncVoice(AcsRequest> voiceAsyncScanRequest) {
- try {
- HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(voiceAsyncScanRequest);
-
- if (httpResponse.isSuccess()) {
-
- JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- //后面注释掉此日志
- log.info("VoiceAsyncScanRequest原生接口返参:" + JSON.toJSONString(scrResponse, true));
-
- if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) {
-
- //获取data列表
- JSONArray dataResults = scrResponse.getJSONArray(SysConstant.DATA);
- List resultList = dataResults.toJavaList(VoiceAsyncScanTaskDataDTO.class);
- //成功返回
- return resultList;
-
- } else {
-
- log.warn("executeSyncVoice 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());
- }
-
- } else {
- log.warn("executeSyncVoice response status is not success. httpResponse:{}", JSON.toJSONString(httpResponse));
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(),
- SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus());
- }
-
- } catch (Exception e) {
- log.error("executeSyncVoice exception IAcsClientUtil do action exception", e);
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg());
- }
- }
-
-
- /**
- * @param taskIds 要查询的异步检测任务的taskId列表。数组中的元素个数不超过100个
- * @author yinzuomei
- * @description 语音异步检测结果查询
- * @Date 2020/12/9 11:17
- **/
- @Override
- public Result> voiceResults(List taskIds) {
- //检测对象不能为空,且最多支持100个元素
- if (CollectionUtils.isEmpty(taskIds) || taskIds.size() > SysConstant.MAX_TASK_SIZE) {
- return new Result>().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(),
- SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg().concat(SysConstant.MAX_TASK_SIZE.toString()));
- }
-
- VoiceAsyncScanResultsRequest request=getVoiceAsyncScanResultsRequest();
- try {
- request.setHttpContent(JSON.toJSONString(taskIds).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON);
- } catch (UnsupportedEncodingException 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));
-
- try {
- HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(request);
- if (httpResponse.isSuccess()) {
-
- JSONObject scrResponse=JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- //后面注释掉此返参
- log.info("VoiceAsyncScanResultsRequest原生接口返参:"+JSON.toJSONString(scrResponse, true));
- if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) {
- //获取data列表
- JSONArray dataResults = scrResponse.getJSONArray(SysConstant.DATA);
- List resultList = dataResults.toJavaList(VoiceAsyncScanResult.class);
- List resultData=processVoiceAsyncScanResult(resultList);
- //成功返回
- return new Result>().ok(resultData);
-
- }else{
-
- 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());
- }
-
- } else {
- log.warn("语音异步检测结果查询预警 getVoiceAsyncScanResult response status is not success. httpResponse:{}", JSON.toJSONString(httpResponse));
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(),
- SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus());
- }
- } catch (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返回格式。
- getResultsRequest.setAcceptFormat(FormatType.JSON);
- // 指定请求方法。
- getResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST);
- getResultsRequest.setEncoding(SysConstant.UTF8);
- getResultsRequest.setRegionId(regionId);
- /**
- * 请务必设置超时时间。
- */
- getResultsRequest.setConnectTimeout(3000);
- getResultsRequest.setReadTimeout(6000);
- return getResultsRequest;
- }
-
- /**
- * desc:视频检测-异步检测
- *
- * @param videoAsyncScanParam
- * @return
- */
- @Override
- public Result videoAsyncScan(VideoAsyncScanParam videoAsyncScanParam) {
- //一次至多提交100个检测对象
- List videoTasks = videoAsyncScanParam.getTasks();
- if (CollectionUtils.isEmpty(videoTasks) || videoTasks.size() > SysConstant.MAX_TASK_SIZE) {
- return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg().concat(SysConstant.MAX_TASK_SIZE.toString()));
- }
- //默认参数赋值
- videoAsyncScanParam.setScenes(VideoSceneEnum.getVideoSceneList());
- videoAsyncScanParam.setBizType(bizType);
- videoAsyncScanParam.setAudioScenes(VoiceSceneEnum.getVoiceSceneList());
- videoAsyncScanParam.setSeed(UUID.randomUUID().toString().replace("-", ""));
- //API文档没写限制多少最大多少,应该与图片一致
- if (videoTasks.size() <= SysConstant.MAX_SCAN_IMG_TASK_SIZE) {
- return doScanVideo(videoAsyncScanParam);
- }
- log.info("videoAsyncScan tasks size:{} over 10", videoTasks.size());
- //分组调用,一次提交10个
- List> partition = ListUtils.partition(videoTasks, SysConstant.MAX_SCAN_IMG_TASK_SIZE);
- VideoAsyncScanTaskResultDTO finalResult = new VideoAsyncScanTaskResultDTO();
- for (List tasks : partition) {
- VideoAsyncScanParam videParam = new VideoAsyncScanParam();
- videParam.setBizType(videoAsyncScanParam.getBizType());
- videParam.setScenes(videoAsyncScanParam.getScenes());
- videParam.setTasks(tasks);
- videParam.setCallback(videoAsyncScanParam.getCallback());
- videParam.setSeed(videoAsyncScanParam.getSeed());
- videParam.setAudioScenes(videoAsyncScanParam.getAudioScenes());
- Result partResult = doScanVideo(videParam);
- try {
- Thread.sleep(5L);
- } catch (InterruptedException e) {
- log.error("videoAsyncScan InterruptedException");
- }
- if (partResult.success()) {
- VideoAsyncScanTaskResultDTO data = partResult.getData();
- finalResult.setSeed(data.getSeed());
- finalResult.getSuccessTasks().addAll(data.getSuccessTasks());
- finalResult.getFailTasks().addAll(data.getFailTasks());
- } else {
- return partResult;
- }
- }
- return new Result().ok(finalResult);
- }
-
- private Result doScanVideo(VideoAsyncScanParam videoAsyncScanParam) {
- VideoAsyncScanRequest videoAsyncScanRequest = getVideoAsyncScanRequest();
- try {
- videoAsyncScanRequest.setHttpContent(JSON.toJSONString(videoAsyncScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON);
- } catch (UnsupportedEncodingException e) {
- log.error("doScanVideo parse param exception", e);
- return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg());
- }
-
- try {
- VideoAsyncScanTaskResultDTO scanResult = executeAsyncVideo(videoAsyncScanRequest);
- scanResult.setSeed(videoAsyncScanParam.getSeed());
- return new Result().ok(scanResult);
- } catch (ExecuteHttpException e) {
- log.error("doScanVideo execute exception,param:{},fail msg:{}", JSON.toJSONString(videoAsyncScanParam), e.getMsg());
- return new Result().error(e.getCode(), e.getMsg());
- }
- }
-
- private VideoAsyncScanRequest getVideoAsyncScanRequest() {
- VideoAsyncScanRequest videoAsyncScanRequest = new VideoAsyncScanRequest();
- videoAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定API返回格式。
- videoAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法。
- /**
- * 请务必设置超时时间。
- */
- videoAsyncScanRequest.setConnectTimeout(3000);
- videoAsyncScanRequest.setReadTimeout(6000);
- return videoAsyncScanRequest;
- }
-
- private VideoAsyncScanTaskResultDTO executeAsyncVideo(VideoAsyncScanRequest videoAsyncScanRequest) {
- try {
- HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(videoAsyncScanRequest);
- if (httpResponse.isSuccess()) {
- JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) {
- //获取data列表
- JSONArray dataResults = scrResponse.getJSONArray(SysConstant.DATA);
- List dataList = dataResults.toJavaList(VideoAsyncScanTaskDataDTO.class);
- VideoAsyncScanTaskResultDTO result=new VideoAsyncScanTaskResultDTO();
- dataList.forEach(data->{
- if (HttpStatus.SC_OK == data.getCode()) {
- result.getSuccessTasks().add(data);
- } else {
- result.getFailTasks().add(data);
- }
- });
- return result;
- } else {
- log.warn("executeAsyncVideo 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());
- }
- } else {
- log.warn("executeAsyncVideo response status is not success. httpResponse:{}", JSON.toJSONString(httpResponse));
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(),
- SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus());
- }
- } catch (Exception e) {
- log.error("executeAsyncVideo exception IAcsClientUtil do action exception", e);
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg());
- }
- }
-
- /**
- * @param taskIds
- * @author yinzuomei
- * @description 视频异步检测结果查询接口
- * @Date 2020/12/29 16:10
- **/
- @Override
- public Result videoResults(List taskIds) {
- VideoAsyncScanResultsRequest videoAsyncScanResultsRequest = new VideoAsyncScanResultsRequest();
- videoAsyncScanResultsRequest.setAcceptFormat(FormatType.JSON);
- videoAsyncScanResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST);
- videoAsyncScanResultsRequest.setConnectTimeout(3000);
- videoAsyncScanResultsRequest.setReadTimeout(6000);
- try {
- videoAsyncScanResultsRequest.setHttpContent(JSON.toJSONString(taskIds).getBytes("UTF-8"), "UTF-8", FormatType.JSON);
- } catch (UnsupportedEncodingException e) {
- log.error("videoResults parse param exception", e);
- return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg());
- }
- try {
- HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(videoAsyncScanResultsRequest);
- if (httpResponse.isSuccess()) {
- JSONObject responseObject = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- log.info("查询视频检测结果返参"+JSON.toJSONString(responseObject));
- if (HttpStatus.SC_OK == responseObject.getInteger(SysConstant.CODE)) {
- //获取data列表
- JSONArray dataResults = responseObject.getJSONArray(SysConstant.DATA);
- List resultList = dataResults.toJavaList(VideoScanOriginalResultDTO.class);
- //解析数据
- VideoResultDTO resultDTO = processVideoResults(resultList);
- //成功返回
- return new Result().ok(resultDTO);
- } else {
- log.warn("查询视频检测结果,接口返回code=" + responseObject.getInteger(SysConstant.CODE));
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getCode(),
- SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getMsg() + ",status:" + httpResponse.getStatus());
- }
- } else {
- log.warn("查询视频检测结果,API返回失败");
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(),
- SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus());
- }
- } catch (Exception e) {
- log.error("videoResults exception ", e);
- throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg());
- }
- }
-
- /**
- * @author yinzuomei
- * @description
- **/
- private VideoResultDTO processVideoResults(List resultList) {
- VideoResultDTO videoResultDTO = new VideoResultDTO();
- resultList.forEach(result -> {
- result.setCodeDesc(CommonErrorCodeEnum.getErrorMsg(result.getCode()));
- if (result.getCode().equals(CommonErrorCodeEnum.PROCESSING.getCode())) {
- //任务正在检测中,继续轮询
- } else if (result.getCode().equals(CommonErrorCodeEnum.OK.getCode())) {
- //成功=>分析结果
- boolean videoPassFlag = getVideoFlag(result.getResults());
- boolean voicePassFlag = getVoiceFlag(result.getAudioScanResults());
- if (videoPassFlag && voicePassFlag) {
- videoResultDTO.getPassDataIds().add(result.getDataId());
- videoResultDTO.getPassTaskIds().add(result.getTaskId());
- } else {
- videoResultDTO.getNoPassDataIds().add(result.getDataId());
- videoResultDTO.getNoPassTaskIds().add(result.getTaskId());
- }
- } else {
- //检测结果走丢了.... (*^▽^*) 默认失败
- videoResultDTO.getNoPassDataIds().add(result.getDataId());
- videoResultDTO.getNoPassTaskIds().add(result.getTaskId());
- }
- });
- videoResultDTO.setDetails(resultList);
- return videoResultDTO;
- }
-
- /**
- * @return boolean
- * @author yinzuomei
- * @description 视频检测结果判断
- **/
- private boolean getVideoFlag(List results) {
- for(VideoScanOriginDetail videoRes:results){
- if (!SuggestionEnum.PASS.getCode().equals(videoRes.getSuggestion())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * @return boolean true:内容通过; 建议为内容违规或者需要人工审核的统一视为不通过,返回false
- * @author yinzuomei
- * @description 返回视频语音检测结果
- **/
- private boolean getVoiceFlag(List audioScanResults) {
- if (CollectionUtils.isEmpty(audioScanResults)) {
- return true;
- }
- for(VoiceAsyncScanResultDTO m:audioScanResults){
- //人工审核或者内容违规,统一视为不通过
- if (!SuggestionEnum.PASS.getCode().equals(m.getSuggestion())) {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgScanParam.java
deleted file mode 100644
index 82036797e3..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgScanParam.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.epmet.openapi.scan.support.param;
-
-import lombok.Data;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotEmpty;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 审查参数
- *
- * @author jianjun liu
- * @date 2020-06-04 21:57
- **/
-@Data
-public class ImgScanParam implements Serializable {
-
- private static final long serialVersionUID = 958801658335909745L;
- /**
- * 业务类型
- */
- private String bizType;
- /**
- * 场景 必填
- *
- * @see com.epmet.openapi.scan.common.enu.ImgSceneEnum;
- */
- private List scenes;
-
- /**
- * 要检测的内容列表,必填
- * remark:一组任务列表中的taskId不能相同
- */
- @Valid
- @NotEmpty(message = "任务列表不能为空")
- private List tasks;
-
- /**
- * 异步检测结果回调地址,执行异步审查内容时 必填
- */
- private String callback;
-
- /**
- * 随机字符串,该值用于回调通知请求中的签名,使用callback时 必填
- */
- private String seed;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java
deleted file mode 100644
index 487485b7fc..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.epmet.openapi.scan.support.param;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-
-/**
- * 任务参数
- *
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-04 22:13
- **/
-@Data
-public class ImgTask implements Serializable {
-
- private static final long serialVersionUID = -747206284930578105L;
- /**
- * 要检测的数据id 非必填
- *
- * */
- @NotBlank(message = "dataId不能为空")
- private String dataId;
-
- /**
- * 图片url 必填
- */
- @NotBlank(message = "图片URL不能为空")
- private String url;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java
deleted file mode 100644
index 2b05d34e20..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.epmet.openapi.scan.support.param;
-
-import lombok.Data;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotEmpty;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 文本审查参数
- *
- * @author jianjun liu
- * @date 2020-06-05 11:17
- **/
-@Data
-public class TextScanParam implements Serializable {
- private static final long serialVersionUID = -3568903097975113166L;
-
- /**
- * 业务类型
- */
- private String bizType;
- /**
- * 场景 必填
- *
- * @see com.epmet.openapi.scan.common.enu.ImgSceneEnum;
- */
- private List scenes;
-
- /**
- * 要检测的内容列表,必填
- * remark:一组任务列表中的taskId不能相同
- */
- @Valid
- @NotEmpty(message = "任务列表不能为空")
- private List tasks;
-
- /**
- * 异步检测结果回调地址,执行异步审查内容时 必填
- */
- private String callback;
-
- /**
- * 随机字符串,该值用于回调通知请求中的签名,使用callback时 必填
- */
- private String seed;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java
deleted file mode 100644
index 08215e3e5b..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.epmet.openapi.scan.support.param;
-
-import lombok.Data;
-import org.hibernate.validator.constraints.Length;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-
-/**
- * 任务参数
- *
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-04 22:13
- **/
-@Data
-public class TextTask implements Serializable {
-
- private static final long serialVersionUID = 6957195274696018630L;
- /**
- * 要检测的数据id 非必填
- *
- * */
- @NotBlank(message = "dataId不能为空")
- private String dataId;
-
- /**
- * 文本内容 必填 最多不能超过10000
- */
- @NotBlank(message = "待检测文本不能为空")
- @Length(max = 10000,message = "待检测文本最大为10000")
- private String content;
-}
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
deleted file mode 100644
index baa8e51be0..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceAsyncScanParam.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.epmet.openapi.scan.support.param;
-
-import lombok.Data;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotEmpty;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 音频审查 入参
- * 参考文档:https://help.aliyun.com/document_detail/89630.html?spm=a2c4g.11186623.2.12.51a32dbfW6AdqV#reference-bcf-3nk-z2b
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/9 9:07
- */
-@Data
-public class VoiceAsyncScanParam implements Serializable {
- private static final long serialVersionUID = 3408043673247901184L;
-
- /**
- * 是否开启回调
- */
- private Boolean openCallBack;
-
- /**
- * 不必填
- * 该字段用于标识您的业务场景。您可以通过内容安全控制台创建业务场景(具体操作,请参见自定义机审标准),或者提交工单联系我们帮助您创建业务场景。
- */
- private String bizType;
-
- /**
- * 必填
- * 检测场景,取值:antispam。
- */
- private List scenes;
-
- /**
- * 不必填
- * 是否为语音流(例如直播流)检测。取值:
- * true:表示语音流检测。
- * false(默认):表示音频文件检测。
- */
- private Boolean live;
-
- /**
- * 不必填
- * 是否为近线检测模式。 取值:
- * true:表示近线检测模式。近线检测模式下,您提交的任务不保证能够实时处理,但是可以排队并在24小时内开始检测。
- * false(默认):表示实时检测模式。对于超过了并发路数限制的检测请求会直接拒绝。
- * 说明 该参数仅适用于音频文件检测,不适用于语音流检测。
- */
- private Boolean offline;
-
- /**
- * 异步检测结果回调地址,执行异步审查内容时 必填
- */
- private String callback;
-
- /**
- * 随机字符串,该值用于回调通知请求中的签名,使用callback时 必填
- */
- private String seed;
-
- @Valid
- @NotEmpty(message = "任务列表不能为空")
- private List tasks;
-
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceTask.java
deleted file mode 100644
index 89f4333bba..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceTask.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.epmet.openapi.scan.support.param;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-
-/**
- * 语音异步检测 对象
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/9 10:16
- */
-@Data
-public class VoiceTask implements Serializable {
- /**
- * 不必填
- * 要检测的数据id 非必填
- * 检测对象对应的数据ID。
- * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。
- * */
- @NotBlank(message = "dataId不能为空")
- private String dataId;
-
- /**
- * 必填
- * 需要检测的音频文件或语音流的下载地址。
- */
- @NotBlank(message = "音频URL不能为空")
- private String url;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanParam.java
deleted file mode 100644
index c0315f8c17..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanParam.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.epmet.openapi.scan.support.param.video;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotEmpty;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 视频审核-异步检测入参DTO
- *
- * @author yinzuomei@elink-cn.com
- */
-@Data
-public class VideoAsyncScanParam implements Serializable {
- private static final long serialVersionUID = -7635290200099445362L;
-
- /**
- * 是否开启回调
- */
- private Boolean openCallBack;
-
- /**
- * 不必填
- * 该字段用于标识您的业务场景。您可以通过内容安全控制台创建业务场景(具体操作,请参见自定义机审标准),或者提交工单联系我们帮助您创建业务场景。
- */
- private String bizType;
-
- /**
- * 不必填
- * 是否为语音流(例如直播流)检测。取值:
- * true:表示语音流检测。
- * false(默认):表示音频文件检测。
- */
- private Boolean live;
-
- /**
- * 不必填
- * 是否为近线检测模式。 取值:
- * true:表示近线检测模式。近线检测模式下,您提交的任务不保证能够实时处理,但是可以排队并在24小时内开始检测。
- * false(默认):表示实时检测模式。对于超过了并发路数限制的检测请求会直接拒绝。
- * 说明 该参数仅适用于音频文件检测,不适用于语音流检测。
- */
- private Boolean offline;
-
- /**
- * 必填
- * 指定视频检测场景。取值:
- * porn:视频智能鉴黄
- * terrorism:视频暴恐涉政
- * live:视频不良场景
- * logo:视频logo
- * ad:视频图文违规
- */
- private List scenes;
-
- /**
- * 不必填
- * 指定视频语音检测场景,唯一取值:antispam,表示语音反垃圾。不传入该参数时仅检测视频图像内容;如果传入该参数,则在检测视频中图像的同时,对视频中语音进行检测。
- * 说明 如果需要检测视频语音,则不支持通过上传视频截帧序列的方式(即在task中传入frames)进行检测,您必须传入视频或视频流的URL地址(即在task中传入url)进行检测。
- */
- private List audioScenes;
-
- /**
- * 异步检测结果回调地址,执行异步审查内容时 必填
- */
- private String callback;
-
- /**
- * 随机字符串,该值用于回调通知请求中的签名,使用callback时 必填
- */
- private String seed;
-
- @NotEmpty(message = "检测对象不能为空")
- private List tasks;
-}
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanTask.java
deleted file mode 100644
index 38a4584d94..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanTask.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.epmet.openapi.scan.support.param.video;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-
-/**
- * 视频审核-异步检测入参-检测对象
- *
- * @author yinzuomei@elink-cn.com
- */
-@Data
-public class VideoAsyncScanTask implements Serializable {
- /**
- * 建议必填
- * 要检测的数据id 非必填
- * 检测对象对应的数据ID。
- * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。
- * */
- @NotBlank(message = "dataId不能为空")
- private String dataId;
-
- /**
- * 必填
- * 待检测视频的URL。该字段不能和frames同时为空,也不能和frames同时有值。
- */
- @NotBlank(message = "音频URL不能为空")
- private String url;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ImgAsyncScanResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ImgAsyncScanResult.java
deleted file mode 100644
index d988cf7a88..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ImgAsyncScanResult.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * 检测结果
- *
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-05 10:52
- **/
-@Data
-public class ImgAsyncScanResult {
- /**
- * 执行成功的任务Id集合
- */
- private List successTaskIds;
- /**
- * 执行失败的任务Id集合
- */
- private List failTaskIds;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ScanTaskResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ScanTaskResult.java
deleted file mode 100644
index d358a570fa..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ScanTaskResult.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * desc:文本检测返回结果
- * @author jianjun liu
- * @email liujianjun@yunzongnet.com
- * @date 2020-06-05 14:24
- **/
-@Data
-public class ScanTaskResult implements Serializable {
-
- private static final long serialVersionUID = -7905091710384256911L;
- private Integer code;
-
-
- private String msg;
-
-
- private String dataId;
-
-
- private List results;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SceneDetailResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SceneDetailResult.java
deleted file mode 100644
index 4023153d10..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SceneDetailResult.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import lombok.Data;
-
-/**
- * desc:场景扫描结果
- * @author jianjun liu
- * @date 2020-06-05 14:24
- **/
-@Data
-public class SceneDetailResult {
- /**
- * 结果为该分类的概率
- */
- private Double rate;
-
- /**
- * 建议用户执行的操作
- */
- private String suggestion;
-
- /**
- * 场景
- */
- private String scene;
-
- /**
- * 标签
- */
- private String label;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SyncScanResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SyncScanResult.java
deleted file mode 100644
index 8dcb757f64..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SyncScanResult.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 检测结果
- *
- * @author jianjun liu
- * @date 2020-06-05 10:52
- **/
-@Data
-public class SyncScanResult implements Serializable {
- /**
- * 执行成功的任务Id集合
- */
- private List successDataIds = new ArrayList<>();
- /**
- * 执行失败的任务Id集合
- */
- private List failDataIds = new ArrayList<>();
-
- /**
- * desc:检测详情
- */
- private List details = new ArrayList<>();
-
- /**
- * 本地是否全部通过
- */
- private boolean isAllPass;
-
- public boolean isAllPass() {
- if (failDataIds.isEmpty() && !successDataIds.isEmpty()) {
- return true;
- }
- return isAllPass;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanDetailDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanDetailDTO.java
deleted file mode 100644
index 7e74caf5a6..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanDetailDTO.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * 语音异步检测结果查询结果返参 -data-result-detail详情
- * 语音对应的文本详情。每一句文本对应一个元素,包含一个或者多个元素。关于每个元素的结构描述
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/9 11:11
- */
-@Data
-public class VoiceAsyncScanDetailDTO implements Serializable {
- private static final long serialVersionUID = -2664219492371705160L;
- /**
- * 句子开始的时间,单位:秒。
- */
- private Integer startTime;
-
- /**
- * 句子结束的时间,单位:秒。
- */
- private Integer endTime;
-
- /**
- * 语音转换成文本的结果。
- */
- private String text;
-
- /**
- * 检测结果的分类。取值:
- * normal:正常文本
- * spam:含垃圾信息
- * ad:广告
- * politics:涉政
- * terrorism:暴恐
- * abuse:辱骂
- * porn:色情
- * flood:灌水
- * contraband:违禁
- * meaningless:无意义
- * customized:自定义(例如命中自定义关键词)
- */
- private String label;
-}
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
deleted file mode 100644
index 1cbf3dab4a..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResult.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 语音异步检测结果查询结果返参
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/9 10:56
- */
-@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;
-
- /**
- * labelDesc是对label的说明,包含两种特殊说明:
- * (1)如果检测任务失败labelDesc:智能检测任务失败,结果已失效,需要人工审核
- * (2)如果检测结果失效labelDesc:智能检测任务失败,需要人工审核
- */
- private String labelDesc;
-
- /**
- * 建议您执行的后续操作。取值:
- * pass:结果正常,无需进行其余操作。
- * review:结果不确定,需要进行人工审核。
- * block:结果违规,建议直接删除或者限制公开。
- */
- private String suggestion;
-
-
- /**
- * 错误码,和HTTP状态码一致。
- * 200:表示检测成功。
- * 280:表示处理中,需要继续轮询。
- * 其他:表示任务失败。
- * 更多信息,请参见公共错误码。
- */
- @JsonIgnore
- private Integer code;
- /**
- * 错误描述信息。
- */
- @JsonIgnore
- private String msg;
-
- /**
- * 暂时没用,所以返回忽略
- */
- @JsonIgnore
- private String url;
-
- /**
- * 检测成功(code=200)时,返回的检测结果。该结果包含一个或多个元素,每个元素是个结构体,对应一个场景。关于每个元素的结构描述,请参见result。
- * 暂时不展示审核结果明细
- */
- @JsonIgnore
- private List results;
-
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResultDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResultDTO.java
deleted file mode 100644
index 34f3280a6f..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResultDTO.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 语音异步检测结果查询结果返参 -data-result详情
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/9 11:07
- */
-@Data
-public class VoiceAsyncScanResultDTO implements Serializable {
- private static final long serialVersionUID = 4602226363259983753L;
- /**
- * 检测场景,和调用请求中的场景对应。取值:antispam。
- */
- private String scene;
-
- /**
- * 检测结果的分类。取值:
- * normal:正常文本
- * spam:含垃圾信息
- * ad:广告
- * politics:涉政
- * terrorism:暴恐
- * abuse:辱骂
- * porn:色情
- * flood:灌水
- * contraband:违禁
- * meaningless:无意义
- * customized:自定义(例如命中自定义关键词)
- */
- private String label;
-
- /**
- * 建议您执行的后续操作。取值:
- * pass:结果正常,无需进行其余操作。
- * review:结果不确定,需要进行人工审核。
- * block:结果违规,建议直接删除或者限制公开。
- */
- private String suggestion;
-
- /**
- * 置信度分数,取值范围:0(表示置信度最低)~100(表示置信度最高)。
- * 如果suggestion为pass,则置信度越高,表示内容正常的可能性越高;如果suggestion为review或block,则置信度越高,表示内容违规的可能性越高。
- * 注意 该值仅作为参考,强烈建议您不要在业务中使用。建议您参考suggestion和label(或者部分接口返回的sublabel)结果用于内容违规判定。
- */
- private Float rate;
-
- /**
- * 语音对应的文本详情。每一句文本对应一个元素,包含一个或者多个元素。关于每个元素的结构描述,
- */
- private List details;
-}
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
deleted file mode 100644
index ce43fec932..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskDataDTO.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * 语音异步检测,返回检测对象列表
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/9 16:38
- */
-@Data
-public class VoiceAsyncScanTaskDataDTO implements Serializable {
- /**
- * 错误码,和HTTP状态码一致。
- * 更多信息,请参见公共错误码。
- */
- private Integer code;
- /**
- * 错误描述信息。
- */
- private String msg;
- /**
- * 检测对象对应的数据ID。
- */
- private String dataId;
-
- /**
- * 检测任务的ID
- */
- private String taskId;
-
- /**
- * 暂时没用,所以返回忽略
- */
- @JsonIgnore
- private String url;
-}
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
deleted file mode 100644
index 2dcbecc398..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskResult.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.epmet.openapi.scan.support.result;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 语音异步检测,返参
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/9 9:23
- */
-@Data
-public class VoiceAsyncScanTaskResult implements Serializable {
- private static final long serialVersionUID = 8702129292884498023L;
- /**
- * 随机字符串,该值用于回调通知请求中的签名。
- */
- 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;
- }
-
-
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskDataDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskDataDTO.java
deleted file mode 100644
index 1d559a31cd..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskDataDTO.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.epmet.openapi.scan.support.result.video;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * 视频审核-异步检测任务提交返参详情
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/29 13:42
- */
-@Data
-public class VideoAsyncScanTaskDataDTO implements Serializable {
- private static final long serialVersionUID = 8430710131685814181L;
- /**
- * 错误码,和HTTP状态码一致。
- * 更多信息,请参见公共错误码。
- */
- private Integer code;
- /**
- * 错误描述信息。
- */
- private String msg;
- /**
- * 检测对象对应的数据ID。
- */
- private String dataId;
-
- /**
- * 检测任务的ID
- */
- private String taskId;
-
- /**
- * 暂时没用,所以返回忽略
- */
- @JsonIgnore
- private String url;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskResultDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskResultDTO.java
deleted file mode 100644
index 75ecd6e84f..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskResultDTO.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.epmet.openapi.scan.support.result.video;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 视频审核-异步检测任务提交返参
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/29 13:38
- */
-@Data
-public class VideoAsyncScanTaskResultDTO implements Serializable {
- private static final long serialVersionUID = -467990806428860191L;
-
- /**
- * 随机字符串,该值用于回调通知请求中的签名。
- */
- 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;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoResultDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoResultDTO.java
deleted file mode 100644
index 0e781bf463..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoResultDTO.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.epmet.openapi.scan.support.result.video;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 视频异步检测结果查询接口返参
- * 正在检测中的不返回,调用方继续轮询查询结果
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/29 15:37
- */
-@Data
-public class VideoResultDTO implements Serializable {
- private static final long serialVersionUID = -3451342817149956488L;
-
- /**
- * 执行成功的任务Id集合
- * code=200,且所有语音+视频所有场景返回结果都为pass时则为成功
- */
- private List passDataIds = new ArrayList<>();
- /**
- * 执行失败的任务Id集合
- */
- private List noPassDataIds = new ArrayList<>();
-
- private List passTaskIds = new ArrayList<>();
- private List noPassTaskIds = new ArrayList<>();
-
- /**
- * desc:阿里内容审核API返回结果详情
- */
- private List details = new ArrayList<>();
-
- /**
- * 本地是否全部通过
- */
- private Boolean isAllPass;
-
- public boolean isAllPass() {
- if (noPassTaskIds.isEmpty() && !passTaskIds.isEmpty()) {
- return true;
- }
- return isAllPass;
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginDetail.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginDetail.java
deleted file mode 100644
index 78916c1fe6..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginDetail.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.epmet.openapi.scan.support.result.video;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * 视频异步检测结果查询接口原生返参-视频检测结果
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/29 16:39
- */
-@Data
-public class VideoScanOriginDetail implements Serializable {
- private static final long serialVersionUID = 5547706236158849091L;
- /**
- * 视频检测场景,和调用请求中的场景对应。取值:
- * porn:视频智能鉴黄
- * terrorism:视频暴恐涉政
- * live:视频不良场景
- * logo:视频logo
- * ad:视频图文违规
- */
- private String scene;
-
- /**
- * 视频检测结果的分类。不同检测场景的结果分类不同,具体如下:
- * 视频智能鉴黄(porn)结果分类:
- * normal:正常
- * porn:色情
- * 视频暴恐涉政(terrorism)结果分类:
- * normal:正常
- * terrorism:暴恐涉政
- * 视频不良场景(live)结果分类:
- * normal:正常
- * live:包含不良场景
- * 视频logo(logo)结果分类:
- * normal:正常
- * logo:包含logo
- * 视频图文违规(ad)结果分类:
- * normal:正常
- * ad:包含广告或文字违规信息
- */
- private String label;
-
- /**
- * 建议您执行的后续操作。取值:
- * pass:结果正常,无需进行其余操作。
- * review:结果不确定,需要进行人工审核。
- * block:结果违规,建议直接删除或者限制公开。
- */
- private String suggestion;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginalResultDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginalResultDTO.java
deleted file mode 100644
index 8964d5fe00..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginalResultDTO.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.epmet.openapi.scan.support.result.video;
-
-import com.epmet.openapi.scan.support.result.VoiceAsyncScanResultDTO;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 视频异步检测结果查询接口原生返参
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/29 15:48
- */
-@Data
-public class VideoScanOriginalResultDTO implements Serializable {
- private static final long serialVersionUID = -1565008507757551616L;
-
- /**
- * 错误码,和HTTP状态码一致。
- * 更多信息,请参见公共错误码。
- */
- private Integer code;
-
- private String codeDesc;
-
- /**
- * 错误描述信息。
- */
- private String msg;
- /**
- * 检测对象对应的数据ID。
- */
- private String dataId;
-
- /**
- * 检测任务的ID
- */
- private String taskId;
-
- /**
- * 返回结果,调用成功时(code=200),返回结果中包含一个或多个元素。每个元素是个结构体,具体结构描述,请参见result。
- * 说明 视频流检测场景中,code返回280表示在检测中,返回200表示检测完成。在检测中状态时,检测结果中包含从开始检测到当前时间的检测到结果。
- */
- private List results;
-
- /**
- * 视频语音检测结果。具体结构描述,请参见audioScanResult。
- */
- private List audioScanResults;
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml
deleted file mode 100644
index 0aa0583c97..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml
+++ /dev/null
@@ -1,91 +0,0 @@
-server:
- port: @server.port@
- version: @version@
- servlet:
- context-path: /epmetscan
-
-spring:
- main:
- allow-bean-definition-overriding: true
- application:
- name: epmet-openapi-scan
- #环境 dev|test|prod
- profiles:
- active: @spring.profiles.active@
- messages:
- encoding: UTF-8
- basename: i18n/messages_common
- jackson:
- time-zone: GMT+8
- date-format: yyyy-MM-dd HH:mm:ss
- redis:
- database: @spring.redis.index@
- host: @spring.redis.host@
- port: @spring.redis.port@
- password: @spring.redis.password@
- timeout: 30s
- cloud:
- nacos:
- discovery:
- server-addr: @nacos.server-addr@
- #nacos的命名空间ID,默认是public
- namespace: @nacos.discovery.namespace@
- #不把自己注册到注册中心的地址
- register-enabled: @nacos.register-enabled@
- ip: @nacos.ip@
- config:
- enabled: @nacos.config-enabled@
- server-addr: @nacos.server-addr@
- namespace: @nacos.config.namespace@
- group: @nacos.config.group@
- file-extension: yaml
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: ALWAYS
-
-feign:
- hystrix:
- enabled: true
- client:
- config:
- default:
- loggerLevel: BASIC
- okhttp:
- enabled: true
-
-
-hystrix:
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 60000 #缺省为1000
-
-ribbon:
- ReadTimeout: 300000
- ConnectTimeout: 300000
-
-aliyun:
- green:
- accessKeyId: LTAI4G6Fv6uTzQbpsayATHq4
- accessKeySecret: QevMw1RYCwQUG3RSMPq1J6EAfmSblo
- regionId: cn-shanghai
- bizType: epmet_img_text
-
-dingTalk:
- robot:
- webHook: @dingTalk.robot.webHook@
- secret: @dingTalk.robot.secret@
-
-# 停机选项
-shutdown:
- graceful:
- enable: true #是否开启优雅停机
- waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警
-
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml b/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml
deleted file mode 100644
index 9d2ad51e14..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml
+++ /dev/null
@@ -1,169 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- ${appname}
-
-
-
-
-
-
-
-
- debug
-
-
- ${CONSOLE_LOG_PATTERN}
-
- UTF-8
-
-
-
-
-
-
-
- ${log.path}/debug.log
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n
- UTF-8
-
-
-
-
- ${log.path}/debug-%d{yyyy-MM-dd}.%i.log
-
- 100MB
-
-
- 15
-
-
-
- debug
- ACCEPT
- DENY
-
-
-
-
-
-
- ${log.path}/info.log
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n
- UTF-8
-
-
-
-
- ${log.path}/info-%d{yyyy-MM-dd}.%i.log
-
- 100MB
-
-
- 15
-
-
-
- info
- ACCEPT
- DENY
-
-
-
-
-
-
- ${log.path}/warn.log
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n
- UTF-8
-
-
-
- ${log.path}/warn-%d{yyyy-MM-dd}.%i.log
-
- 100MB
-
-
- 15
-
-
-
- warn
- ACCEPT
- DENY
-
-
-
-
-
-
- ${log.path}/error.log
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n
- UTF-8
-
-
-
- ${log.path}/error-%d{yyyy-MM-dd}.%i.log
-
- 100MB
-
-
- 15
-
-
-
- ERROR
- ACCEPT
- DENY
- ${webHook}
- ${secret}
- ${appname}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/readme b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme
deleted file mode 100644
index 384fca6dfc..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/main/resources/readme
+++ /dev/null
@@ -1,7 +0,0 @@
-#访问openApi 需要向redis中 添加白名单
-sadd epmet:openapi:scan:whitelist "客户端ip地址"
-#eg:
-sadd epmet:openapi:scan:whitelist "\"192.168.1.1\""
-
-#del
-srem 'epmet:openapi:scan:whitelist' "\"116.179.32.197\"" "\"27.219.156.47\""
\ No newline at end of file
diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java
deleted file mode 100644
index 8c0774030d..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java
+++ /dev/null
@@ -1,50 +0,0 @@
-import java.io.IOException;
-import java.util.Properties;
-
-/**
- * Created by liuhai.lh on 17/01/12.
- */
-public class BaseSample {
-
- protected static String accessKeyId = "123";
- protected static String accessKeySecret = "456";
-
- protected static String regionId = "cn-shanghai";
-
- static {
- Properties properties = new Properties();
-
- try {
- properties.load(BaseSample.class.getResourceAsStream("bootstrap.yml"));
- accessKeyId = properties.getProperty("aliyun.green.accessKeyId");
- accessKeySecret = properties.getProperty("aliyun.green.accessKeySecret");
- regionId = properties.getProperty("aliyun.green.url");
- } catch(IOException e) {
- e.printStackTrace();
- }
-
- }
- protected static String getDomain(){
- if("cn-shanghai".equals(regionId)){
- return "green.cn-shanghai.aliyuncs.com";
- }
-
- if ("cn-beijing".equals(regionId)) {
- return "green.cn-beijing.aliyuncs.com";
- }
-
- if ("ap-southeast-1".equals(regionId)) {
- return "green.ap-southeast-1.aliyuncs.com";
- }
-
- if ("us-west-1".equals(regionId)) {
- return "green.us-west-1.aliyuncs.com";
- }
-
- return "green.cn-shanghai.aliyuncs.com";
- }
- protected static String getEndPointName(){
- return regionId;
- }
-
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java
deleted file mode 100644
index acba42e763..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java
+++ /dev/null
@@ -1,95 +0,0 @@
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.aliyuncs.DefaultAcsClient;
-import com.aliyuncs.IAcsClient;
-import com.aliyuncs.exceptions.ClientException;
-import com.aliyuncs.exceptions.ServerException;
-import com.aliyuncs.green.model.v20180509.ImageAsyncScanRequest;
-import com.aliyuncs.http.FormatType;
-import com.aliyuncs.http.HttpResponse;
-import com.aliyuncs.profile.DefaultProfile;
-import com.aliyuncs.profile.IClientProfile;
-import com.epmet.openapi.scan.common.enu.RegionIdEnum;
-
-import java.util.*;
-
-/**
- * Created by liuhai.lh on 2017/2/17.
- * 图片异步检测接口
- * @author liuhai.lh
- * @date 2017/02/17
- */
-public class ImageAsyncScanRequestSample extends BaseSample{
-
- public static void main(String[] args) throws Exception {
- //请替换成你自己的accessKeyId、accessKeySecret
- IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
- DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", RegionIdEnum.getDoMain(regionId));
- IAcsClient client = new DefaultAcsClient(profile);
-
- ImageAsyncScanRequest imageAsyncScanRequest = new ImageAsyncScanRequest();
- imageAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
- imageAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
- imageAsyncScanRequest.setEncoding("utf-8");
- imageAsyncScanRequest.setRegionId(regionId);
-
-
- List> tasks = new ArrayList>();
- Map task1 = new LinkedHashMap();
- task1.put("dataId", UUID.randomUUID().toString());
- task1.put("url", "https://img.alicdn.com/tfs/TB1Xk_qvwmTBuNjy1XbXXaMrVXa-550-407.jpg");
- task1.put("time", new Date());
-
- tasks.add(task1);
- JSONObject data = new JSONObject();
- /**
- * porn: 色情
- * terrorism: 暴恐
- * qrcode: 二维码
- * ad: 图片广告
- * ocr: 文字识别
- */
- data.put("scenes", Arrays.asList("porn", "ocr", "qrcode", "sface"));
- data.put("tasks", tasks);
-
- imageAsyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
-
- /**
- * 请务必设置超时时间
- */
- imageAsyncScanRequest.setConnectTimeout(3000);
- imageAsyncScanRequest.setReadTimeout(6000);
-
- try {
- HttpResponse httpResponse = client.doAction(imageAsyncScanRequest);
-
- if(httpResponse.isSuccess()){
- JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- System.out.println(JSON.toJSONString(scrResponse, true));
- if (200 == scrResponse.getInteger("code")) {
- JSONArray taskResults = scrResponse.getJSONArray("data");
- for (Object taskResult : taskResults) {
- if(200 == ((JSONObject)taskResult).getInteger("code")){
- String taskId = ((JSONObject)taskResult).getString("taskId");
- // 将taskId 保存下来,间隔一段时间来轮询结果, 参照ImageAsyncScanResultsRequest
- System.out.println("args = [" + taskId + "]");
- }else{
- System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code"));
- }
- }
- } else {
- System.out.println("detect not success. code:" + scrResponse.getInteger("code"));
- }
- }else{
- System.out.println("response not success. status:" + httpResponse.getStatus());
- }
- } catch (ServerException e) {
- e.printStackTrace();
- } catch (ClientException e) {
- e.printStackTrace();
- } catch (Exception e){
- e.printStackTrace();
- }
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java
deleted file mode 100644
index 27e0b6e233..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java
+++ /dev/null
@@ -1,83 +0,0 @@
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.aliyuncs.DefaultAcsClient;
-import com.aliyuncs.IAcsClient;
-import com.aliyuncs.exceptions.ClientException;
-import com.aliyuncs.exceptions.ServerException;
-import com.aliyuncs.green.model.v20180509.ImageAsyncScanResultsRequest;
-import com.aliyuncs.http.FormatType;
-import com.aliyuncs.http.HttpResponse;
-import com.aliyuncs.profile.DefaultProfile;
-import com.aliyuncs.profile.IClientProfile;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by liuhai.lh on 2017/2/17.
- * 获取图片异步检测结果接口
- * @author liuhai.lh
- * @date 2017/02/17
- */
-public class ImageAsyncScanResultsSample extends BaseSample{
-
- public static void main(String[] args) throws Exception {
- //请替换成你自己的accessKeyId、accessKeySecret
- IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
- DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", getDomain());
- IAcsClient client = new DefaultAcsClient(profile);
-
- ImageAsyncScanResultsRequest imageAsyncScanResultsRequest = new ImageAsyncScanResultsRequest();
- imageAsyncScanResultsRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
- imageAsyncScanResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
- imageAsyncScanResultsRequest.setEncoding("utf-8");
- imageAsyncScanResultsRequest.setRegionId(regionId);
-
-
- List taskIds = new ArrayList();
- taskIds.add("img1hdP5Wn0QC@7wW0n$VX0R@-1p3mnZ");
- imageAsyncScanResultsRequest.setHttpContent(JSON.toJSONString(taskIds).getBytes("UTF-8"), "UTF-8", FormatType.JSON);
-
- /**
- * 请务必设置超时时间
- */
- imageAsyncScanResultsRequest.setConnectTimeout(3000);
- imageAsyncScanResultsRequest.setReadTimeout(6000);
-
- try {
- HttpResponse httpResponse = client.doAction(imageAsyncScanResultsRequest);
-
- if(httpResponse.isSuccess()){
- JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- System.out.println(JSON.toJSONString(scrResponse, true));
- if (200 == scrResponse.getInteger("code")) {
- JSONArray taskResults = scrResponse.getJSONArray("data");
- for (Object taskResult : taskResults) {
- if(200 == ((JSONObject)taskResult).getInteger("code")){
- JSONArray sceneResults = ((JSONObject)taskResult).getJSONArray("results");
- for (Object sceneResult : sceneResults) {
- String scene = ((JSONObject)sceneResult).getString("scene");
- String suggestion = ((JSONObject)sceneResult).getString("suggestion");
- //根据scene和suggetion做相关的处理
- //do something
- }
- }else{
- System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code"));
- }
- }
- } else {
- System.out.println("detect not success. code:" + scrResponse.getInteger("code"));
- }
- }else{
- System.out.println("response not success. status:" + httpResponse.getStatus());
- }
- } catch (ServerException e) {
- e.printStackTrace();
- } catch (ClientException e) {
- e.printStackTrace();
- } catch (Exception e){
- e.printStackTrace();
- }
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java
deleted file mode 100644
index ec418154d9..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java
+++ /dev/null
@@ -1,101 +0,0 @@
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.aliyuncs.DefaultAcsClient;
-import com.aliyuncs.IAcsClient;
-import com.aliyuncs.exceptions.ClientException;
-import com.aliyuncs.exceptions.ServerException;
-import com.aliyuncs.green.model.v20180509.ImageSyncScanRequest;
-import com.aliyuncs.http.FormatType;
-import com.aliyuncs.http.HttpResponse;
-import com.aliyuncs.profile.DefaultProfile;
-import com.aliyuncs.profile.IClientProfile;
-
-import java.util.*;
-
-/**
- * Created by liuhai.lh on 2017/2/17.
- * 图片同步检测接口
- * @author liuhai.lh
- * @date 2017/02/17
- */
-public class ImageSyncScanRequestSample extends BaseSample {
-
-
- public static void main(String[] args) throws Exception {
- //请替换成你自己的accessKeyId、accessKeySecret
- IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
- DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", getDomain());
- IAcsClient client = new DefaultAcsClient(profile);
-
- ImageSyncScanRequest imageSyncScanRequest = new ImageSyncScanRequest();
- imageSyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式
- imageSyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法
- imageSyncScanRequest.setEncoding("utf-8");
- imageSyncScanRequest.setRegionId(regionId);
-
-
- List> tasks = new ArrayList>();
- Map task = new LinkedHashMap();
- task.put("dataId", UUID.randomUUID().toString());
- task.put("url", "http://f.hiphotos.baidu.com/image/pic/item/aa18972bd40735fa13899ac392510fb30f24084b.jpg");
- task.put("time", new Date());
-
- tasks.add(task);
- JSONObject data = new JSONObject();
- /**
- * porn: 色情
- * terrorism: 暴恐
- * qrcode: 二维码
- * ad: 图片广告
- * ocr: 文字识别
- */
- data.put("scenes", Arrays.asList("porn","terrorism"));
- data.put("tasks", tasks);
-
- imageSyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
-
- /**
- * 请务必设置超时时间
- */
- imageSyncScanRequest.setConnectTimeout(3000);
- imageSyncScanRequest.setReadTimeout(10000);
-
- try {
- HttpResponse httpResponse = client.doAction(imageSyncScanRequest);
-
- if (httpResponse.isSuccess()) {
- JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- System.out.println(JSON.toJSONString(scrResponse, true));
- if (200 == scrResponse.getInteger("code")) {
- JSONArray taskResults = scrResponse.getJSONArray("data");
- for (Object taskResult : taskResults) {
- if(200 == ((JSONObject)taskResult).getInteger("code")){
- JSONArray sceneResults = ((JSONObject)taskResult).getJSONArray("results");
- for (Object sceneResult : sceneResults) {
- String scene = ((JSONObject)sceneResult).getString("scene");
- String suggestion = ((JSONObject)sceneResult).getString("suggestion");
- //根据scene和suggetion做相关的处理
- //do something
- System.out.println("args = [" + scene + "]");
- System.out.println("args = [" + suggestion + "]");
- }
- }else{
- System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code"));
- }
- }
- } else {
- System.out.println("detect not success. code:" + scrResponse.getInteger("code"));
- }
- } else {
- System.out.println("response not success. status:" + httpResponse.getStatus());
- }
- } catch (ServerException e) {
- e.printStackTrace();
- } catch (ClientException e) {
- e.printStackTrace();
- } catch (Exception e){
- e.printStackTrace();
- }
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanRequestSample.java
deleted file mode 100644
index 617e6246d1..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanRequestSample.java
+++ /dev/null
@@ -1,90 +0,0 @@
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.aliyuncs.DefaultAcsClient;
-import com.aliyuncs.IAcsClient;
-import com.aliyuncs.green.model.v20180509.VoiceAsyncScanRequest;
-import com.aliyuncs.http.FormatType;
-import com.aliyuncs.http.HttpResponse;
-import com.aliyuncs.profile.DefaultProfile;
-import com.aliyuncs.profile.IClientProfile;
-
-import java.util.*;
-
-/**
- * 提交语音异步检测任务 demo
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/8 21:51
- */
-public class VoiceAsyncScanRequestSample extends BaseSample {
-
-
-
- public static void main(String[] args) throws Exception {
-
- //请替换成您自己的AccessKey ID、AccessKey Secret。
- IClientProfile profile = DefaultProfile.getProfile("cn-shanghai",
- "LTAI4G6Fv6uTzQbpsayATHq4", //您自己的AccessKey ID
- "QevMw1RYCwQUG3RSMPq1J6EAfmSblo");//您自己的AccessKey Secret
- final IAcsClient client = new DefaultAcsClient(profile);
-
- VoiceAsyncScanRequest asyncScanRequest = new VoiceAsyncScanRequest(); //class different vs common
- asyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定API返回格式。
- asyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法。
- asyncScanRequest.setRegionId("cn-shanghai");
- asyncScanRequest.setConnectTimeout(3000);
- asyncScanRequest.setReadTimeout(6000);
-
- List> tasks = new ArrayList>();
- Map task1 = new LinkedHashMap();
- // 请将下面的地址修改为要检测的语音文件的地址。
- task1.put("dataId","voice1");
- task1.put("url", "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201208/6480bd6be9f14a458162218cea84dfa5.aac");
-
- Map task2 = new LinkedHashMap();
- task2.put("dataId","voice2");
- task2.put("url", "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201208/b566d94fd7114ffb9a203e80c22ebb96.aac");
-
- tasks.add(task1);
- tasks.add(task2);
-
- JSONObject data = new JSONObject();
-
- System.out.println("==========Task count:" + tasks.size());
- data.put("scenes", Arrays.asList("antispam"));
- data.put("tasks", tasks);
- // 如果是语音流检测,则修改为true。
- data.put("live", false);
- asyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
- System.out.println("接口入参:"+JSON.toJSONString(data, true));
-
- try {
- HttpResponse httpResponse = client.doAction(asyncScanRequest);
-
- if (httpResponse.isSuccess()) {
- JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- System.out.println("接口返参:"+JSON.toJSONString(scrResponse, true));
- if (200 == scrResponse.getInteger("code")) {
- JSONArray taskResults = scrResponse.getJSONArray("data");
- for (Object taskResult : taskResults) {
- Integer code = ((JSONObject) taskResult).getInteger("code");
- if (200 == code) {
- final String taskId = ((JSONObject) taskResult).getString("taskId");
- System.out.println("submit async task success, taskId = [" + taskId + "]");
- } else {
- System.out.println("task process fail: " + code);
- }
- }
- } else {
- System.out.println("detect not success. code: " + scrResponse.getInteger("code"));
- }
- } else {
- System.out.println("response not success. status: " + httpResponse.getStatus());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-}
diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanResultsRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanResultsRequestSample.java
deleted file mode 100644
index 85d268f175..0000000000
--- a/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanResultsRequestSample.java
+++ /dev/null
@@ -1,113 +0,0 @@
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.aliyuncs.DefaultAcsClient;
-import com.aliyuncs.IAcsClient;
-import com.aliyuncs.green.model.v20180509.VoiceAsyncScanResultsRequest;
-import com.aliyuncs.http.FormatType;
-import com.aliyuncs.http.HttpResponse;
-import com.aliyuncs.profile.DefaultProfile;
-import com.aliyuncs.profile.IClientProfile;
-
-import java.util.*;
-
-/**
- * 查询异步语音检测结果。
- *
- * @author yinzuomei@elink-cn.com
- * @date 2020/12/8 22:08
- */
-public class VoiceAsyncScanResultsRequestSample extends BaseSample {
-
-
- public static void main(String[] args) throws Exception {
- // 请替换成您自己的AccessKey ID、AccessKey Secret。
- IClientProfile profile = DefaultProfile
- .getProfile("cn-shanghai",
- "LTAI4G6Fv6uTzQbpsayATHq4",
- "QevMw1RYCwQUG3RSMPq1J6EAfmSblo");
- final IAcsClient client = new DefaultAcsClient(profile);
- //提交语音异步检测任务后返回的taskId
- pollingScanResult(client, Arrays.asList("vc_f_7WZZ01BCH0q6ZnM3g1OKGG-1tAaZ7", "vc_f_6AKaBxy4HdG5bruQ0JwweV-1tAaJi"));
- // pollingScanResult(client, "vc_f_6AKaBxy4HdG5bruQ0JwweV-1tAaJi");
- }
-
- public static void pollingScanResult(IAcsClient client, List taskIdList) throws InterruptedException {
- int failCount = 0;
- boolean stop = false;
- do {
- // 设置每10秒查询一次。
- Thread.sleep(10 * 1000);
- JSONObject scanResult = getScanResult(client, taskIdList);
- System.out.println("接口完整返参:"+JSON.toJSONString(scanResult, true));
- if (scanResult == null || 200 != scanResult.getInteger("code")) {
- failCount++;
- System.out.println("请求失败,get result fail, failCount=" + failCount);
- if (scanResult != null) {
- System.out.println("请求失败,错误信息errorMsg:" + scanResult.getString("msg"));
- }
- if (failCount > 20) {
- break;
- }
- continue;
- }
-
- JSONArray taskResults = scanResult.getJSONArray("data");
- if (taskResults.isEmpty()) {
- System.out.println("请求成功,but data is empty");
- break;
- }
- System.out.println("data.size=" + taskResults.size());
- for (Object taskResult : taskResults) {
- JSONObject result = (JSONObject) taskResult;
- Integer code = result.getInteger("code");
- String taskId = result.getString("taskId");
- if (280 == code) {
- System.out.println("taskId=" + taskId + ": processing status: " + result.getString("msg"));
- } else if (200 == code) {
- System.out.println("taskId=" + taskId + "请求成功,返参:" + JSON.toJSONString(taskResult, true));
- stop = true;
- } else {
- System.out.println("taskId=" + taskId + "请求失败,返参:" + JSON.toJSONString(taskResult, true));
- stop = true;
- }
- }
- } while (!stop);
- }
-
- private static JSONObject getScanResult(IAcsClient client, List taskIdList) {
- VoiceAsyncScanResultsRequest getResultsRequest = new VoiceAsyncScanResultsRequest();
- getResultsRequest.setAcceptFormat(FormatType.JSON); // 指定API返回格式。
- getResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法。
- getResultsRequest.setEncoding("utf-8");
- getResultsRequest.setRegionId("cn-shanghai");
-
-
- List> tasks = new ArrayList>();
- for (String taskId : taskIdList) {
- Map task1 = new LinkedHashMap();
- task1.put("taskId", taskId);
- tasks.add(task1);
- }
-
- /**
- * 请务必设置超时时间。
- */
- getResultsRequest.setConnectTimeout(3000);
- getResultsRequest.setReadTimeout(6000);
-
- try {
- getResultsRequest.setHttpContent(JSON.toJSONString(tasks).getBytes("UTF-8"), "UTF-8", FormatType.JSON);
-
- HttpResponse httpResponse = client.doAction(getResultsRequest);
- if (httpResponse.isSuccess()) {
- return JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8"));
- } else {
- System.out.println("response not success. status: " + httpResponse.getStatus());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/epmet-openapi/pom.xml b/epmet-openapi/pom.xml
deleted file mode 100644
index fd15705343..0000000000
--- a/epmet-openapi/pom.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- epmet-cloud
- com.epmet
- 2.0.0
-
- 4.0.0
- pom
-
- epmet-openapi
-
- epmet-openapi-scan
- epmet-openapi-adv
-
-
-
\ No newline at end of file