first commit
This commit is contained in:
		
						commit
						f8dfb4f52d
					
				
							
								
								
									
										35
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,35 @@ | |||||||
|  | HELP.md | ||||||
|  | target/ | ||||||
|  | !.mvn/wrapper/maven-wrapper.jar | ||||||
|  | !**/src/main/** | ||||||
|  | !**/src/test/** | ||||||
|  | .yml | ||||||
|  | ### STS ### | ||||||
|  | .apt_generated | ||||||
|  | .classpath | ||||||
|  | .factorypath | ||||||
|  | .project | ||||||
|  | .settings | ||||||
|  | .springBeans | ||||||
|  | .sts4-cache | ||||||
|  | 
 | ||||||
|  | ### IntelliJ IDEA ### | ||||||
|  | .idea | ||||||
|  | *.iws | ||||||
|  | *.iml | ||||||
|  | *.ipr | ||||||
|  | ### NetBeans ### | ||||||
|  | /nbproject/private/ | ||||||
|  | /nbbuild/ | ||||||
|  | /dist/ | ||||||
|  | /nbdist/ | ||||||
|  | /.nb-gradle/ | ||||||
|  | build/ | ||||||
|  | 
 | ||||||
|  | ### VS Code ### | ||||||
|  | .vscode/ | ||||||
|  | face-common/src/test/ | ||||||
|  | face-server/src/test/resources/ | ||||||
|  | 
 | ||||||
|  | /.idea/workspace.xml | ||||||
|  | /.idea/ | ||||||
							
								
								
									
										9
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | |||||||
|  | # 不不不不v | ||||||
|  | ``` | ||||||
|  | mvn install | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | #的点点滴滴 | ||||||
|  | ``` | ||||||
|  | mvn clean | ||||||
|  | ``` | ||||||
							
								
								
									
										9554
									
								
								doc/face.PDM
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9554
									
								
								doc/face.PDM
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										9530
									
								
								doc/face.pdb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9530
									
								
								doc/face.pdb
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										7
									
								
								doc/数据库变更字段-2020-01-07.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								doc/数据库变更字段-2020-01-07.sql
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,7 @@ | |||||||
|  | alter table face_camera add id_version VARCHAR(32) COMMENT "摄像头类型ID"; | ||||||
|  | 
 | ||||||
|  | 		ALTER TABLE face_camera CHANGE id_version id_brand  VARCHAR(32) COMMENT "摄像头品牌ID"; | ||||||
|  | 
 | ||||||
|  | 	ALTER TABLE face_camera CHANGE camerat_longitude camera_longitude  VARCHAR(100) COMMENT "摄像头经度"; | ||||||
|  | 
 | ||||||
|  | 	ALTER table face_camera add port VARCHAR(32) COMMENT "端口号"; | ||||||
							
								
								
									
										57
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,57 @@ | |||||||
|  | version: '3' | ||||||
|  | services: | ||||||
|  | 
 | ||||||
|  |   minio: | ||||||
|  |     image: minio/minio | ||||||
|  |     container_name: minio | ||||||
|  |     environment: | ||||||
|  |       MINIO_ACCESS_KEY: sunseaiot | ||||||
|  |       MINIO_SECRET_KEY: sunseaiot | ||||||
|  |     restart: always | ||||||
|  |     hostname: minio | ||||||
|  |     ports: | ||||||
|  |     - "9000:9000" | ||||||
|  |     volumes: | ||||||
|  |     - "./minio/data:/data" | ||||||
|  |     command: server /data | ||||||
|  |   minio_mc: | ||||||
|  |     image: minio/mc | ||||||
|  |     container_name: minio_mc | ||||||
|  |     entrypoint: /bin/sh | ||||||
|  |     command: mc config | ||||||
|  | 
 | ||||||
|  |   redis: | ||||||
|  |     image: redis | ||||||
|  |     container_name: redis | ||||||
|  |     hostname: redis | ||||||
|  |     restart: always | ||||||
|  | #    command: redis-server --requirepass ldjy@2019 | ||||||
|  |     ports: | ||||||
|  |     - "40008:6379" | ||||||
|  |     volumes: | ||||||
|  |     - "./redis/data:/data" | ||||||
|  |   mysql: | ||||||
|  |     image: mysql:5.7 | ||||||
|  |     container_name: mysql | ||||||
|  |     hostname: mysql | ||||||
|  |     restart: always | ||||||
|  |     ports: | ||||||
|  |     - "33060:3306" | ||||||
|  |     volumes: | ||||||
|  |     - "./mysql/conf:/etc/mysql/conf.d" | ||||||
|  |     - "./mysql/data:/var/lib/mysql" | ||||||
|  |     - "./mysql/logs:/logs" | ||||||
|  |     environment: | ||||||
|  |       MYSQL_ROOT_PASSWORD: "123456" | ||||||
|  |       MYSQL_USER: 'root' | ||||||
|  |       MYSQL_PASS: '123456' | ||||||
|  | 
 | ||||||
|  |   dkha-eureka: | ||||||
|  |     build: ./face-server | ||||||
|  |     volumes: | ||||||
|  |     - "./face-server/face.log:/face.log" | ||||||
|  |     container_name: face-server | ||||||
|  |     restart: always | ||||||
|  |     hostname: face-server | ||||||
|  |     ports: | ||||||
|  |     - "8899:8899" | ||||||
							
								
								
									
										77
									
								
								docker-compose1.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								docker-compose1.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,77 @@ | |||||||
|  | version: '3' | ||||||
|  | services: | ||||||
|  | 
 | ||||||
|  |   face_minio: | ||||||
|  |     image: face_minio | ||||||
|  |     container_name: face_minio | ||||||
|  |     restart: always | ||||||
|  |     hostname: face_minio | ||||||
|  |     ports: | ||||||
|  |     - "9000:9000" | ||||||
|  |     command: server /data | ||||||
|  |     volumes: | ||||||
|  |     - "./minio:/data" | ||||||
|  |     environment: | ||||||
|  |       MINIO_ACCESS_KEY: sunseaiot | ||||||
|  |       MINIO_SECRET_KEY: sunseaiot | ||||||
|  | 
 | ||||||
|  |   face_redis: | ||||||
|  |     image: face_redis | ||||||
|  |     container_name: face_redis | ||||||
|  |     hostname: face_redis | ||||||
|  |     restart: always | ||||||
|  |     command: redis-server --appendonly yes | ||||||
|  |     ports: | ||||||
|  |     - "6379:6379" | ||||||
|  |   face_mysql: | ||||||
|  |     image: face_mysql | ||||||
|  |     container_name: face_mysql | ||||||
|  |     hostname: face_mysql | ||||||
|  |     restart: always | ||||||
|  |     command: mysqld | ||||||
|  |     ports: | ||||||
|  |     - "3306:3306" | ||||||
|  |     volumes: | ||||||
|  |     - "./mysql/config:/etc/mysql/conf.d" | ||||||
|  |     - "./mysql/data:/var/lib/mysql" | ||||||
|  |     - "./mysql/logs:/logs" | ||||||
|  |     - "/etc/localtime:/etc/localtime" | ||||||
|  |     environment: | ||||||
|  |       MYSQL_ROOT_PASSWORD: "123456" | ||||||
|  |       MYSQL_USER: 'root' | ||||||
|  |       MYSQL_PASS: '123456' | ||||||
|  | 
 | ||||||
|  |   face_rabbitmq: | ||||||
|  |     image: face_rabbitmq | ||||||
|  |     container_name: face_rabbitmq | ||||||
|  |     hostname: face_rabbitmq | ||||||
|  |     restart: always | ||||||
|  |     command: rabbitmq-server | ||||||
|  |     ports: | ||||||
|  |     - "15672:15672" | ||||||
|  |     - "25672:25672" | ||||||
|  |     - "4369:4369" | ||||||
|  |     - "5671:5671" | ||||||
|  |     - "5672:5672" | ||||||
|  | 
 | ||||||
|  |   face_es: | ||||||
|  |     image: face_es | ||||||
|  |     container_name: face_es | ||||||
|  |     hostname: face_es | ||||||
|  |     restart: always | ||||||
|  |     command: eswrapper | ||||||
|  |     ports: | ||||||
|  |     - "9200:9200" | ||||||
|  |     - "9300:9300" | ||||||
|  | 
 | ||||||
|  |   face_nginx: | ||||||
|  |     image: face_nginx | ||||||
|  |     container_name: face_nginx | ||||||
|  |     hostname: face_nginx | ||||||
|  |     restart: always | ||||||
|  |     ports: | ||||||
|  |     - "80:80" | ||||||
|  |     volumes: | ||||||
|  |     - "./nginx/conf.d:/etc/nginx/conf.d" | ||||||
|  |     - "./nginx/face:/usr/share/nginx/html" | ||||||
|  |     - "./nginx/log:/var/log/nginx" | ||||||
							
								
								
									
										126
									
								
								face-common/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										126
									
								
								face-common/pom.xml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,126 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <project xmlns="http://maven.apache.org/POM/4.0.0" | ||||||
|  |          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||||
|  |          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||
|  |     <parent> | ||||||
|  |         <artifactId>face-application</artifactId> | ||||||
|  |         <groupId>com.dkha</groupId> | ||||||
|  |         <version>1.0-SNAPSHOT</version> | ||||||
|  |     </parent> | ||||||
|  |     <modelVersion>4.0.0</modelVersion> | ||||||
|  | 
 | ||||||
|  |     <artifactId>face-common</artifactId> | ||||||
|  | 
 | ||||||
|  |     <dependencies> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.springframework.boot</groupId> | ||||||
|  |             <artifactId>spring-boot-starter-web</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.apache.mina</groupId> | ||||||
|  |             <artifactId>mina-core</artifactId> | ||||||
|  |             <version>2.1.3</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.afterturn</groupId> | ||||||
|  |             <artifactId>easypoi-base</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.afterturn</groupId> | ||||||
|  |             <artifactId>easypoi-web</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>cn.afterturn</groupId> | ||||||
|  |             <artifactId>easypoi-annotation</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>redis.clients</groupId> | ||||||
|  |             <artifactId>jedis</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.springframework.boot</groupId> | ||||||
|  |             <artifactId>spring-boot-starter-data-redis</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>com.alibaba</groupId> | ||||||
|  |             <artifactId>fastjson</artifactId> | ||||||
|  |         </dependency> | ||||||
|  | 
 | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>io.minio</groupId> | ||||||
|  |             <artifactId>minio</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>com.github.axet</groupId> | ||||||
|  |             <artifactId>kaptcha</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>com.baomidou</groupId> | ||||||
|  |             <artifactId>mybatis-plus-generator</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>com.ecwid.consul</groupId> | ||||||
|  |             <artifactId>consul-api</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>com.auth0</groupId> | ||||||
|  |             <artifactId>java-jwt</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.jsoup</groupId> | ||||||
|  |             <artifactId>jsoup</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>commons-io</groupId> | ||||||
|  |             <artifactId>commons-io</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>io.springfox</groupId> | ||||||
|  |             <artifactId>springfox-swagger2</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>io.springfox</groupId> | ||||||
|  |             <artifactId>springfox-swagger-ui</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>mysql</groupId> | ||||||
|  |             <artifactId>mysql-connector-java</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.freemarker</groupId> | ||||||
|  |             <artifactId>freemarker</artifactId> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.projectlombok</groupId> | ||||||
|  |             <artifactId>lombok</artifactId> | ||||||
|  |         </dependency> | ||||||
|  | 
 | ||||||
|  |         <!-- poi office --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.apache.poi</groupId> | ||||||
|  |             <artifactId>poi</artifactId> | ||||||
|  |             <version>${poi.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.apache.poi</groupId> | ||||||
|  |             <artifactId>poi-ooxml</artifactId> | ||||||
|  |             <version>${poi.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.apache.poi</groupId> | ||||||
|  |             <artifactId>poi-ooxml-schemas</artifactId> | ||||||
|  |             <version>${poi.version}</version> | ||||||
|  |         </dependency> | ||||||
|  |     </dependencies> | ||||||
|  |     <build> | ||||||
|  |         <plugins> | ||||||
|  |             <plugin> | ||||||
|  |                 <groupId>org.springframework.boot</groupId> | ||||||
|  |                 <artifactId>spring-boot-maven-plugin</artifactId> | ||||||
|  |                 <configuration> | ||||||
|  |                     <classifier>exec</classifier> | ||||||
|  |                 </configuration> | ||||||
|  |             </plugin> | ||||||
|  |         </plugins> | ||||||
|  |     </build> | ||||||
|  | </project> | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | package com.dkha.common; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import org.springframework.boot.SpringApplication; | ||||||
|  | import org.springframework.boot.autoconfigure.SpringBootApplication; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author Spring | ||||||
|  |  */ | ||||||
|  | @SpringBootApplication(exclude = { | ||||||
|  |         org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class}) | ||||||
|  | 
 | ||||||
|  | public class CommonApplication { | ||||||
|  | 
 | ||||||
|  |     public static void main(String[] args) { | ||||||
|  |         SpringApplication.run(CommonApplication.class, args); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,71 @@ | |||||||
|  | package com.dkha.common.consul; | ||||||
|  | 
 | ||||||
|  | import com.ecwid.consul.v1.ConsulClient; | ||||||
|  | import com.ecwid.consul.v1.session.model.NewSession; | ||||||
|  | import com.ecwid.consul.v1.session.model.Session; | ||||||
|  | 
 | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | public class BaseLock { | ||||||
|  | 
 | ||||||
|  |     protected ConsulClient consulClient; | ||||||
|  |     private String sessionName; | ||||||
|  |     protected String sessionId = null; | ||||||
|  |     protected String keyPath;   // 互斥锁、信号量存储在consul中的基础key路径 | ||||||
|  | 
 | ||||||
|  |     protected CheckTtl checkTtl;  // Check Ttl | ||||||
|  |     /** | ||||||
|  |      * @param consulClient | ||||||
|  |      * @param lockKey       同步锁在consul的KV存储中的Key路径,会自动增加prefix前缀,方便归类查询 | ||||||
|  |      * @param | ||||||
|  |      */ | ||||||
|  | 
 | ||||||
|  |     protected BaseLock(ConsulClient consulClient, String sessionName, String lockKey) { | ||||||
|  |         this.consulClient = consulClient; | ||||||
|  |         this.keyPath = lockKey; | ||||||
|  |         this.sessionName=sessionName; | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * @param consulClient | ||||||
|  |      * @param lockKey       同步锁在consul的KV存储中的Key路径,会自动增加prefix前缀,方便归类查询 | ||||||
|  |      * @param checkTtl      对锁Session的TTL | ||||||
|  |      */ | ||||||
|  |     protected BaseLock(ConsulClient consulClient, String lockKey, CheckTtl checkTtl) { | ||||||
|  |         this.consulClient = consulClient; | ||||||
|  |         this.keyPath = lockKey; | ||||||
|  |         this.checkTtl = checkTtl; | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * 创建session | ||||||
|  |      * @param sessionName | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  | 
 | ||||||
|  |     protected String createSession(String sessionName) { | ||||||
|  |         NewSession newSession = new NewSession(); | ||||||
|  |         newSession.setName(sessionName); | ||||||
|  |         if(checkTtl != null) { | ||||||
|  |             checkTtl.start(); | ||||||
|  |             // 如果有CheckTtl,就为该Session设置Check相关信息 | ||||||
|  |             List<String> checks = new ArrayList<>(); | ||||||
|  |             checks.add(checkTtl.getCheckId()); | ||||||
|  |             newSession.setChecks(checks); | ||||||
|  |             newSession.setBehavior(Session.Behavior.DELETE); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         return consulClient.sessionCreate(newSession, null).getValue(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |      * 根据成员变量sessionId来销毁session | ||||||
|  |      */ | ||||||
|  | 
 | ||||||
|  |     protected void destroySession() { | ||||||
|  |         if (sessionId != null) { | ||||||
|  |             consulClient.sessionDestroy(sessionId, null); | ||||||
|  |             sessionId = null; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,89 @@ | |||||||
|  | package com.dkha.common.consul; | ||||||
|  | 
 | ||||||
|  | import com.ecwid.consul.v1.ConsulClient; | ||||||
|  | import com.ecwid.consul.v1.OperationException; | ||||||
|  | import com.ecwid.consul.v1.agent.model.NewCheck; | ||||||
|  | import lombok.Getter; | ||||||
|  | import lombok.extern.slf4j.Slf4j; | ||||||
|  | 
 | ||||||
|  | import java.util.Timer; | ||||||
|  | import java.util.TimerTask; | ||||||
|  | 
 | ||||||
|  | @Slf4j | ||||||
|  | /** | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | public class CheckTtl { | ||||||
|  | 
 | ||||||
|  |     private ConsulClient consulClient; | ||||||
|  | 
 | ||||||
|  |     @Getter | ||||||
|  |     private String checkId; | ||||||
|  |     private NewCheck check; | ||||||
|  |     private Timer timer; | ||||||
|  | 
 | ||||||
|  |     private int ttlDelay = 5000; | ||||||
|  |     private int ttlPeriod = 10000; | ||||||
|  | 
 | ||||||
|  |     public CheckTtl(String checkId, ConsulClient consulClient) { | ||||||
|  |         this.checkId = checkId; | ||||||
|  |         this.consulClient = consulClient; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void agentCheckRegister() { | ||||||
|  |         this.check = new NewCheck(); | ||||||
|  |         check.setId(checkId); | ||||||
|  |         check.setName(checkId); | ||||||
|  |         check.setTtl("30s"); | ||||||
|  |         check.setInterval("10s"); | ||||||
|  |         check.setTimeout("10s"); | ||||||
|  |         this.consulClient.agentCheckRegister(check); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void agentCheckDegister() { | ||||||
|  |         if (this.checkId != null) { | ||||||
|  |             this.consulClient.agentCheckDeregister(checkId); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public boolean isRunning() { | ||||||
|  |         if (this.timer == null) { | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void start() { | ||||||
|  |         if (!isRunning()) { | ||||||
|  |             agentCheckRegister(); | ||||||
|  |             consulClient.agentCheckPass(checkId); | ||||||
|  |             this.timer = new Timer(); | ||||||
|  |             timer.scheduleAtFixedRate(new TtlTask(), ttlDelay, ttlPeriod); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void stop() { | ||||||
|  |         if (this.timer != null) { | ||||||
|  |             agentCheckDegister(); | ||||||
|  |             timer.cancel(); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     class TtlTask extends TimerTask { | ||||||
|  | 
 | ||||||
|  |         @Override | ||||||
|  |         public void run() { | ||||||
|  |             try { | ||||||
|  |                 log.debug("{} run ttl...", checkId); | ||||||
|  |                 consulClient.agentCheckPass(checkId); | ||||||
|  |             } catch (OperationException e) { | ||||||
|  |                 e.printStackTrace(); | ||||||
|  |             } catch (Exception e) { | ||||||
|  |                 e.printStackTrace(); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
							
								
								
									
										84
									
								
								face-common/src/main/java/com/dkha/common/consul/Lock.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								face-common/src/main/java/com/dkha/common/consul/Lock.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,84 @@ | |||||||
|  | package com.dkha.common.consul; | ||||||
|  | 
 | ||||||
|  | import com.ecwid.consul.v1.ConsulClient; | ||||||
|  | import com.ecwid.consul.v1.kv.model.PutParams; | ||||||
|  | 
 | ||||||
|  | import java.time.LocalDateTime; | ||||||
|  | 
 | ||||||
|  | public class Lock extends BaseLock { | ||||||
|  | 
 | ||||||
|  |     private static final String prefix = "lock/";  // 同步锁参数前缀 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * @param consulClient | ||||||
|  |      * @param lockKey      同步锁在consul的KV存储中的Key路径,会自动增加prefix前缀,方便归类查询 | ||||||
|  |      */ | ||||||
|  | 
 | ||||||
|  |     public Lock(ConsulClient consulClient, String sessionName, String lockKey) { | ||||||
|  |         super(consulClient, sessionName, prefix + lockKey); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public Lock(ConsulClient consulClient, String sessionName, CheckTtl checkTtl) { | ||||||
|  |         super(consulClient, sessionName, checkTtl); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 获取同步锁 | ||||||
|  |      * | ||||||
|  |      * @param block 是否阻塞,直到获取到锁为止,默认尝试间隔时间为500ms。 | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  | 
 | ||||||
|  |     public Boolean lock(boolean block) throws InterruptedException { | ||||||
|  |         return lock(block, 500L, null); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 获取同步锁 | ||||||
|  |      * | ||||||
|  |      * @param block        是否阻塞,直到获取到锁为止 | ||||||
|  |      * @param timeInterval block=true时有效,再次尝试的间隔时间 | ||||||
|  |      * @param maxTimes     block=true时有效,最大尝试次数 | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  | 
 | ||||||
|  |     public Boolean lock(boolean block, Long timeInterval, Integer maxTimes) throws InterruptedException { | ||||||
|  |         if (sessionId != null) { | ||||||
|  |             throw new RuntimeException(sessionId + " - Already locked!"); | ||||||
|  |         } | ||||||
|  |         sessionId = createSession("lock-" + this.keyPath); | ||||||
|  |         int count = 1; | ||||||
|  |         while (true) { | ||||||
|  |             PutParams putParams = new PutParams(); | ||||||
|  |             putParams.setAcquireSession(sessionId); | ||||||
|  |             if (consulClient.setKVValue(keyPath, "lock:" + LocalDateTime.now(), putParams).getValue()) { | ||||||
|  |                 return true; | ||||||
|  |             } else if (block) { | ||||||
|  |                 if (maxTimes != null && count >= maxTimes) { | ||||||
|  |                     return false; | ||||||
|  |                 } else { | ||||||
|  |                     count++; | ||||||
|  |                     if (timeInterval != null) | ||||||
|  |                         Thread.sleep(timeInterval); | ||||||
|  |                     continue; | ||||||
|  |                 } | ||||||
|  |             } else { | ||||||
|  |                 return false; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 释放同步锁 | ||||||
|  |      * | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public Boolean unlock() { | ||||||
|  |         PutParams putParams = new PutParams(); | ||||||
|  |         putParams.setReleaseSession(sessionId); | ||||||
|  |         boolean result = consulClient.setKVValue(keyPath, "unlock:" + LocalDateTime.now(), putParams).getValue(); | ||||||
|  |         destroySession(); | ||||||
|  |         return result; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,42 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | import lombok.Getter; | ||||||
|  | import org.springframework.beans.factory.annotation.Value; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(请求api地址枚举维护类) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiUrl | ||||||
|  |  * @Package com.dkha.common.enums | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/10 10:37 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Getter | ||||||
|  | public enum ApiUrlEnum { | ||||||
|  | //    @Value("${api.server.prefix}")  请求前缀维护在face-common的faceApiUrl.properties 中 | ||||||
|  | //    String link; | ||||||
|  | 
 | ||||||
|  |     ALARM_POSTURL("alarm", "查看单个报警任务(业务场景卡口)post"), | ||||||
|  |     ALARMS_POSTURL("alarms", "查看批量报警post"), | ||||||
|  |     ALARMS_STATUS("taskStatus", "视频任务状态查询"), | ||||||
|  |     FACELIBS_POSTURL("faceLibs", "查看人脸"), | ||||||
|  |     FACELIB_POSTURL("faceLib", "添加人脸"), | ||||||
|  |     FACELIST_POSTURL("face", "添加人像"), | ||||||
|  |     FACE_POSTURL("face", "添加人像"), | ||||||
|  |     TASK_POSTURL("control", "任务操作"), | ||||||
|  |     TASK_VEDIO_POSTURL("controlVedio", "视频比对任务操作"), | ||||||
|  |     FACE_SEARCH_LIB("faceSearchLib", "人脸库检索"), | ||||||
|  |     FACE_SEARCH("faceSearch", "人脸检测"), | ||||||
|  |     FACE_GROUP("faceGroup", "分组检索"), | ||||||
|  |     FACE_COMPARISON("faceComparison", "一比一比对"), | ||||||
|  |     CAMERA("camera", "摄像头操作"); | ||||||
|  |     private String url; | ||||||
|  |     private String message; | ||||||
|  | 
 | ||||||
|  |     ApiUrlEnum(String url, String message) { | ||||||
|  |         this.url = url; | ||||||
|  |         this.message = message; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 住宿码表 | ||||||
|  |  */ | ||||||
|  | public enum BoardAndLodgingEnums { | ||||||
|  | 
 | ||||||
|  |     BOARD("0", "包吃"), | ||||||
|  |     LODGING("1", "包住"), | ||||||
|  |     BOARDANDLODGING("2", "包吃包住"); | ||||||
|  | 
 | ||||||
|  |     public String name; | ||||||
|  |     public String code; | ||||||
|  | 
 | ||||||
|  |     BoardAndLodgingEnums(String name, String code) { | ||||||
|  |         this.name = name; | ||||||
|  |         this.code = code; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,22 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Description: | ||||||
|  |  * @Author: yanping | ||||||
|  |  * @Date: 2019/9/30 18:44 | ||||||
|  |  */ | ||||||
|  | public enum CompanyCheckEnums { | ||||||
|  | 
 | ||||||
|  |     PASS("1", "已通过"), | ||||||
|  |     FAIL("2", "未通过"), | ||||||
|  |     PENDING("0", "待审核"); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     CompanyCheckEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Description: | ||||||
|  |  * @Author: yangjun | ||||||
|  |  * @Date: 2019/9/23 17:44 | ||||||
|  |  */ | ||||||
|  | public enum CompanyMessageEnums { | ||||||
|  |     SIGNED("2", "劳动人员同意岗位"), | ||||||
|  |     UNSIGNED("1", "劳动人员发起岗位申请"), | ||||||
|  |     RELIEVE("3", "劳动人员拒绝岗位"); | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     CompanyMessageEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 合同附件上传状态 | ||||||
|  |  */ | ||||||
|  | public enum ContractFileStausEnums { | ||||||
|  | 
 | ||||||
|  |     UPLOAD("1", "已上传"), | ||||||
|  |     UNUPLOAD("2", "待上传"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     ContractFileStausEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 合同状态枚举 | ||||||
|  |  */ | ||||||
|  | public enum ContractStatusEnums { | ||||||
|  | 
 | ||||||
|  |     SIGNED("2", "已签订"), | ||||||
|  |     UNSIGNED("1", "待签订"), | ||||||
|  |     RELIEVE("3", "已解除"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     ContractStatusEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 合同类型 | ||||||
|  |  */ | ||||||
|  | public enum ContractType  { | ||||||
|  | 
 | ||||||
|  |     ORG("1", "有组织就业"), | ||||||
|  |     SCATTERED("2", "自主零散就业"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     ContractType(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,44 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | import lombok.Getter; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(布控任务类型) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ContralEnums | ||||||
|  |  * @Package com.dkha.common.enums | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/11 17:27 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Getter | ||||||
|  | public enum  ContralEnums { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     ARREST(0,"抓捕类"), | ||||||
|  |     MONITOR(1,"监控类"), | ||||||
|  |     PROMPT(2,"提示类"); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     private Integer code; | ||||||
|  |     private String message; | ||||||
|  | 
 | ||||||
|  |     ContralEnums(Integer code, String message) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.message = message; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public static ContralEnums getTypeByValue(Integer code) | ||||||
|  |     { | ||||||
|  |         if (null==code){ | ||||||
|  |             return ARREST; | ||||||
|  |         } | ||||||
|  |         for (ContralEnums enums : ContralEnums.values()) { | ||||||
|  |             if (enums.getCode().intValue() == code.intValue()) { | ||||||
|  |                 return enums; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         return ARREST; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,42 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @ClassName: DictTypeEnums | ||||||
|  |  * @Description: (字典类型枚举) | ||||||
|  |  * @author: 严平 | ||||||
|  |  * @date: 2019-09-18 | ||||||
|  |  * @Copyright: 成都电科惠安 | ||||||
|  |  */ | ||||||
|  | public enum DictTypeEnums { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     UNIT_TYPE("unittype", "单位类型"), | ||||||
|  |     GENDER("gender", "性别"), | ||||||
|  |     REGION("region", "摄像头区域"), | ||||||
|  |     EDUCATION("education","教育程度"), | ||||||
|  |     NATION("nation","民族"), | ||||||
|  |     ACCOMMODATION("accommodation","食宿安排"), | ||||||
|  |     SALARY("salary","收入区间"), | ||||||
|  |     MARITALSTATUS("maritalstatus","婚姻状况"), | ||||||
|  |     POLITICAL("political","政治面貌"), | ||||||
|  |     ACCOUNT("account","户口性质"), | ||||||
|  |     POST_SKILL("postSkill","职业技能"), | ||||||
|  |     INDUSTRY("industry","所属行业"), | ||||||
|  |     STAFF_SCALE("staffScale","公司人员规模"), | ||||||
|  |     WORKING_SYSTEM("workingSystem","工作制度"), | ||||||
|  |     EMPLOYEE_CHANNEL("employeeChannel","就业渠道"), | ||||||
|  |     ACADEMIC("academic","学历要求"), | ||||||
|  |     EMPLOYMENT_METHOD("employmentMethod","用工方式"), | ||||||
|  |     TRAINING_TYPE("trainingType","培训类型"), | ||||||
|  |     ORGANIZED_EMPLOYMENT("organizedEmployment","有组织就业"), | ||||||
|  |     SELF_EMPLOYMENT("selfEmployment","自主零散就业"), | ||||||
|  |     AREA("area","全国地区"), | ||||||
|  |     LABOR_STATUS("laborStatus","劳动力状况"); | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     DictTypeEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,39 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 就业渠道 | ||||||
|  |  */ | ||||||
|  | public enum EmployeeChannel { | ||||||
|  | 
 | ||||||
|  |     NEARBY("1", "就近就地就业"), | ||||||
|  |     ACROSS("2", "疆内跨地州就业"), | ||||||
|  |     INLAND("3", "内地省市就业"), | ||||||
|  |     CORPS("4", "兵团就业"), | ||||||
|  |     TRANSFER("5", "有组织转移就业"), | ||||||
|  | 
 | ||||||
|  |     SMALLBUSINESS("6", "“十小”服务业"), | ||||||
|  | 
 | ||||||
|  |     PARK("7", "园区企业就业"), | ||||||
|  |     SPIN("8", "纺织服装产业就业"), | ||||||
|  |     ELECTRONIC("9", "电子装配、假发、玩具等部分劳动密集型就业"), | ||||||
|  |     VILLAGE_WORKSHOP("10", "乡村生产车间就业就业"), | ||||||
|  |     TOURISM_SERVICE("11", "旅游服务就业"), | ||||||
|  |     FIXED_INVESTMENT("12", "固定资产投资项目建设领域就业"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     EmployeeChannel(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public static EmployeeChannel getByCode(String code) { | ||||||
|  |         for(EmployeeChannel employeeChannel : EmployeeChannel.values()){ | ||||||
|  |             if(code.equals(employeeChannel.code)){ | ||||||
|  |                 return employeeChannel; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         return  null; | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										35
									
								
								face-common/src/main/java/com/dkha/common/enums/ErrEnum.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								face-common/src/main/java/com/dkha/common/enums/ErrEnum.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,35 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | import lombok.Getter; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(api中返回的错误代码) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: errEnum | ||||||
|  |  * @Package com.dkha.api.modules.errnums | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/2 11:42 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Getter | ||||||
|  | public enum ErrEnum { | ||||||
|  |     OK(200,"成功"),CREATED(201,"创建成功"), | ||||||
|  | 
 | ||||||
|  |     ACCEPTED(202,"更新成功"),BAD_REQUEST(400,"请求的地址不存在或者包含不支持的参数"), | ||||||
|  | 
 | ||||||
|  |     UNAUTHORIZED(401,"未授权"),FORBIDDEN(403,"被禁止访问"), | ||||||
|  | 
 | ||||||
|  |     NOT_FOUND(404,"请求资源不存在"),ERROR(500,"内部错误"); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     private Integer code; | ||||||
|  |     private String msg; | ||||||
|  | 
 | ||||||
|  |     ErrEnum(Integer code, String msg) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.msg = msg; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,22 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 岗位招聘失效时间枚举 | ||||||
|  |  */ | ||||||
|  | public enum ExpiryTimeTypeEnums { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     ONE_WEEK("1", "一周"), | ||||||
|  |     TWO_WEEK("2", "半个月"), | ||||||
|  |     ONE_MONTH("3", "一个月"), | ||||||
|  |     THREE_MONTH("4", "三个月"), | ||||||
|  |     SIX_MONTH("5", "半年"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     ExpiryTimeTypeEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,30 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author Spring | ||||||
|  |  * @date 2019/11/22 | ||||||
|  |  * @Description: 产业类型枚举 | ||||||
|  |  */ | ||||||
|  | public enum IndustryTypeEnum { | ||||||
|  | 
 | ||||||
|  |     FIRST_INDUSTRY("1", "一产"), | ||||||
|  |     SECOND_INDUSTRY("2", "二产"), | ||||||
|  |     THIRD_INDUSTRY("3", "三产"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     IndustryTypeEnum(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public static IndustryTypeEnum getByCode(String code) { | ||||||
|  |         for(IndustryTypeEnum industryType : IndustryTypeEnum.values()){ | ||||||
|  |             if(code.equals(industryType.code)){ | ||||||
|  |                 return industryType; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         return  null; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,14 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | public enum IsOnWorkingEnums { | ||||||
|  |     ON_WORKING("Y", "在职"), | ||||||
|  |     NOT_ON_WORKING("N", "离职"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     IsOnWorkingEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,13 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | public enum IsPoorEnums { | ||||||
|  |     Y("Y", "是"), | ||||||
|  |     N("N", "否"); | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     IsPoorEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,20 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @ClassName: LaborMessageEnms | ||||||
|  |  * @Description:(please write your description) | ||||||
|  |  * @author: 严平 | ||||||
|  |  * @date: 2019-09-24 | ||||||
|  |  * @Copyright: 成都电科惠安 | ||||||
|  |  */ | ||||||
|  | public enum LaborMessageEnms { | ||||||
|  |     SIGNED("1", "用人单位同意岗位"), | ||||||
|  |     RELIEVE("2", "用人单位拒绝岗位"); | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     LaborMessageEnms(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 预警消息推送 | ||||||
|  |  */ | ||||||
|  | public enum MsgEnums { | ||||||
|  | 
 | ||||||
|  | //    Completion warning  Income alarm Unemployment alarm | ||||||
|  |     COMPLETION_ALARM(1,"15日旷工人员"), | ||||||
|  |     NO_INCOME_ALARM(2,"6个月没有收入人员"), | ||||||
|  |     UNEMPLOYMENT_ALARM(3,"失业人数"), | ||||||
|  |     UNEMPLOYED_FAMILY(4,"一户零就业户数"), | ||||||
|  |      NEW_COMPANY_ALARM(5,"新公司申请"), | ||||||
|  |     TOTAL_LABORFORCE(6,"劳动力总数"), | ||||||
|  |     ON_WORK(7,"已就业人数"), | ||||||
|  |     ON_POOL(8,"贫困户户数"), | ||||||
|  | 
 | ||||||
|  |     UNEMPLOYMENT(3,"失业"), | ||||||
|  |     UNEMPLOYED(4,"一户零就业"), | ||||||
|  |     POOR(8,"贫困"), | ||||||
|  |     ; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public Integer type; | ||||||
|  |     public String msg; | ||||||
|  | 
 | ||||||
|  |     MsgEnums(Integer type,String msg) | ||||||
|  |     { | ||||||
|  |         this.type=type; | ||||||
|  |         this.msg=msg; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,22 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 录取意见状态 | ||||||
|  |  */ | ||||||
|  | public enum OpinionEnums { | ||||||
|  | 
 | ||||||
|  |     PASS("1", "通过"), | ||||||
|  |     FAIL("2", "未通过"), | ||||||
|  |     PENDING("0", "待处理"); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     OpinionEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,23 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author Spring | ||||||
|  |  * @date 2018/5/18-11:30 | ||||||
|  |  * @Description: 全局字典枚举 -- 全平台统一维护 | ||||||
|  |  */ | ||||||
|  | public enum PlatformDictTypeEnum { | ||||||
|  | 
 | ||||||
|  |     COMPANY_TYPE("company", "公司类型枚举Type"), | ||||||
|  |     EDUCATION("education", "学历枚举类型"), | ||||||
|  |     POST_SKILL("postSkill", "职业技能枚举类型"), | ||||||
|  |     REGION("region", "区域枚举类型"), | ||||||
|  |     BOARD_AND_LODGING("accommodation", "食宿安排枚举类型"); | ||||||
|  | //    WORK_ADDRESS("workAddress", "工作地点枚举类型"); | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     PlatformDictTypeEnum(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,21 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/9/11 17:36 | ||||||
|  |  * @Description 平台类型枚举 | ||||||
|  |  */ | ||||||
|  | public enum PlatformTypeEnum { | ||||||
|  | 
 | ||||||
|  |     API("API", "APP平台"), | ||||||
|  |     COMPANY("COMPANY", "劳动就业岗位发布平台"), | ||||||
|  |     GOVERNMENT("GOVERNMENT", "劳动就业服务平台"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     PlatformTypeEnum(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | public enum ProjectType { | ||||||
|  | 
 | ||||||
|  |     APPROVAL("0", "审批"), | ||||||
|  |     CHECK("1", "核准"), | ||||||
|  |     FILING("2", "备案"); | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     ProjectType(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,30 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 性别枚举 | ||||||
|  |  */ | ||||||
|  | public enum SEXEnums { | ||||||
|  |     MAN("0", "男"), | ||||||
|  |     WOMAN("1", "女"), | ||||||
|  |     NOLIMIT("2", "保密"); | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     SEXEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  |     public static SEXEnums getTypeByValue(String code) | ||||||
|  |     { | ||||||
|  |         if (null==code){ | ||||||
|  |             return NOLIMIT; | ||||||
|  |         } | ||||||
|  |         for (SEXEnums enums : SEXEnums.values()) { | ||||||
|  |             if (enums.code.equals(code)) { | ||||||
|  |                 return enums; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         return NOLIMIT; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,28 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | import lombok.Getter; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: SocketEnum | ||||||
|  |  * @Package com.dkha.common.enums | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2020/1/3 15:50 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Getter | ||||||
|  | public enum SocketEnum { | ||||||
|  | 
 | ||||||
|  |     WARNING("WARNING","预警"), | ||||||
|  |     BAYONET("BAYONET","卡口"); | ||||||
|  | 
 | ||||||
|  |     private String code; | ||||||
|  |     private String msg; | ||||||
|  | 
 | ||||||
|  |     SocketEnum(String code, String msg) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.msg = msg; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,29 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | import lombok.Getter; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: 布控任务 | ||||||
|  |  * @Title: | ||||||
|  |  * @author: huangyugang | ||||||
|  |  * @date: 2019/12/18 16:22 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Getter | ||||||
|  | public enum TaskStatuEnum { | ||||||
|  |     STATUS_UNDEF("STATUSUNDEF","未知"), | ||||||
|  |     STATUS_STARTING("STATUSSTARTING","正在打开"), | ||||||
|  |     STATUS_WORKING("STATUSWORKING","工作中"), | ||||||
|  |     STATUS_RESTATING("STATUSRESTATING","正在重新打开"), | ||||||
|  |     STATUS_OVER("STATUSOVER","任务已经结束"); | ||||||
|  |     private String code; | ||||||
|  |     private String message; | ||||||
|  | 
 | ||||||
|  |     TaskStatuEnum(String code, String message) | ||||||
|  |     { | ||||||
|  |         this.code=code; | ||||||
|  |         this.message=message; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,23 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description:  布控任务状态 | ||||||
|  |  * @Title: | ||||||
|  |  * @author: huangyugang | ||||||
|  |  * @date: 2019/12/11 9:13 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | public enum TaskStatusEnum { | ||||||
|  |     RUN("0", "运行中"), | ||||||
|  |     STOP("-1", "停止运行"), | ||||||
|  |     SUSPEND("1","暂停运行"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     TaskStatusEnum(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,15 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | public enum TrainingAssessmentStatus { | ||||||
|  |     PASS("0", "通过"), | ||||||
|  | 
 | ||||||
|  |     NOT_PASS("1", "未通过"), | ||||||
|  |     INIT("2", "初始状态"); | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     TrainingAssessmentStatus(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										20
									
								
								face-common/src/main/java/com/dkha/common/enums/YNEnums.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								face-common/src/main/java/com/dkha/common/enums/YNEnums.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,20 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author Spring | ||||||
|  |  * @date 2018/5/18-11:30 | ||||||
|  |  * @Description: 逻辑判断枚举 | ||||||
|  |  */ | ||||||
|  | public enum YNEnums { | ||||||
|  | 
 | ||||||
|  |     YES("Y", "是"), | ||||||
|  |     NO("N", "否"); | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     YNEnums(String code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,20 @@ | |||||||
|  | package com.dkha.common.enums; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @ClassName: 是否枚举 | ||||||
|  |  * @Description: 使用数字 | ||||||
|  |  * @author: yanping | ||||||
|  |  * @date: 2020-01-06 | ||||||
|  |  * @Copyright: 成都电科惠安 | ||||||
|  |  */ | ||||||
|  | public enum YNNumberEnum { | ||||||
|  |     YES(1, "是"), | ||||||
|  |     NO(0, "否"); | ||||||
|  |     public Integer code; | ||||||
|  |     public String name; | ||||||
|  | 
 | ||||||
|  |     YNNumberEnum(Integer code, String name) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.name = name; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,27 @@ | |||||||
|  | package com.dkha.common.exception; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/9/21 11:58 | ||||||
|  |  * @Description 权限相关异常--主要用于权限拦截器 | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | public class AuthorityException extends RuntimeException { | ||||||
|  | 
 | ||||||
|  |     public AuthorityException(String s) { | ||||||
|  |         super(s); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public AuthorityException(String s, Throwable throwable) { | ||||||
|  |         super(s, throwable); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public AuthorityException(Throwable throwable) { | ||||||
|  |         super(throwable); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public AuthorityException() { | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,27 @@ | |||||||
|  | package com.dkha.common.exception; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/9/21 11:58 | ||||||
|  |  * @Description 权限相关异常--主要用于权限拦截器 | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | public class DkAuthorityException extends RuntimeException { | ||||||
|  | 
 | ||||||
|  |     public DkAuthorityException(String s) { | ||||||
|  |         super(s); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public DkAuthorityException(String s, Throwable throwable) { | ||||||
|  |         super(s, throwable); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public DkAuthorityException(Throwable throwable) { | ||||||
|  |         super(throwable); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public DkAuthorityException() { | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,78 @@ | |||||||
|  | package com.dkha.common.exception; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.systemcode.SystemCode; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author Spring | ||||||
|  |  * @date 2018/5/18-11:30 | ||||||
|  |  * @Description: 自定义异常 | ||||||
|  |  */ | ||||||
|  | public class DkException extends RuntimeException { | ||||||
|  |     /** | ||||||
|  |      * 异常码 | ||||||
|  |      */ | ||||||
|  |     private int code; | ||||||
|  |     /** | ||||||
|  |      * 异常信息 | ||||||
|  |      */ | ||||||
|  |     private String msg; | ||||||
|  | 
 | ||||||
|  |     public DkException() { | ||||||
|  |         this.code = SystemCode.HANDLER_FAILED.code; | ||||||
|  |         this.msg = SystemCode.HANDLER_FAILED.des; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public DkException(int code) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.msg = SystemCode.get(code).des; | ||||||
|  |     } | ||||||
|  |     public DkException(int code,String msg) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.msg = msg; | ||||||
|  |     } | ||||||
|  |     public DkException(int code, Throwable e) { | ||||||
|  |         super(e); | ||||||
|  |         this.code = code; | ||||||
|  |         this.msg = SystemCode.get(code).des; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public DkException(String msg) { | ||||||
|  |         super(msg); | ||||||
|  |         this.code = SystemCode.HANDLER_FAILED.code; | ||||||
|  |         this.msg = msg; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public DkException(String msg, Throwable e) { | ||||||
|  |         super(msg, e); | ||||||
|  |         this.code = SystemCode.HANDLER_FAILED.code; | ||||||
|  |         this.msg = msg; | ||||||
|  |     } | ||||||
|  |     public DkException(SystemCode systemCode) { | ||||||
|  |         super(systemCode.des); | ||||||
|  |         this.code = systemCode.code; | ||||||
|  |         this.msg = systemCode.des; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public DkException(Throwable e) { | ||||||
|  |         super(e); | ||||||
|  |         this.code = SystemCode.HANDLER_FAILED.code; | ||||||
|  |         this.msg = SystemCode.HANDLER_FAILED.des; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public String getMsg() { | ||||||
|  |         return msg; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void setMsg(String msg) { | ||||||
|  |         this.msg = msg; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public int getCode() { | ||||||
|  |         return code; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void setCode(int code) { | ||||||
|  |         this.code = code; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,25 @@ | |||||||
|  | package com.dkha.common.exception; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @author Spring | ||||||
|  |  * @date 2018/5/18-11:30 | ||||||
|  |  * @Description: 自定义异常 | ||||||
|  |  */ | ||||||
|  | public class EmployeeException extends RuntimeException { | ||||||
|  | 
 | ||||||
|  |     public EmployeeException(String s) { | ||||||
|  |         super(s); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public EmployeeException(String s, Throwable throwable) { | ||||||
|  |         super(s, throwable); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public EmployeeException(Throwable throwable) { | ||||||
|  |         super(throwable); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public EmployeeException() { | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,391 @@ | |||||||
|  | package com.dkha.common.fileupload; | ||||||
|  | 
 | ||||||
|  | import com.alibaba.fastjson.JSONObject; | ||||||
|  | import com.dkha.common.util.UtilValidate; | ||||||
|  | import io.minio.MinioClient; | ||||||
|  | import io.minio.ObjectStat; | ||||||
|  | import io.minio.Result; | ||||||
|  | import io.minio.messages.DeleteError; | ||||||
|  | import io.minio.messages.Item; | ||||||
|  | import org.slf4j.Logger; | ||||||
|  | import org.slf4j.LoggerFactory; | ||||||
|  | import org.springframework.beans.factory.annotation.Value; | ||||||
|  | import org.springframework.context.annotation.PropertySource; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  | import org.springframework.util.StringUtils; | ||||||
|  | 
 | ||||||
|  | import javax.servlet.http.HttpServletResponse; | ||||||
|  | import java.io.BufferedInputStream; | ||||||
|  | import java.io.ByteArrayInputStream; | ||||||
|  | import java.io.InputStream; | ||||||
|  | import java.io.OutputStream; | ||||||
|  | import java.text.SimpleDateFormat; | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.UUID; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @ClassName: | ||||||
|  |  * @Description: (please write your description) | ||||||
|  |  * @author: {开发人的姓名} | ||||||
|  |  * @date: | ||||||
|  |  * @Copyright: 成都电科惠安 | ||||||
|  |  */ | ||||||
|  | @Component | ||||||
|  | public class MinioUtil { | ||||||
|  | 
 | ||||||
|  |     public static final Logger logger = LoggerFactory.getLogger(MinioUtil.class); | ||||||
|  | 
 | ||||||
|  |     @Value("${minio.url}") | ||||||
|  |     private String url; | ||||||
|  |     @Value("${minio.accessKey}") | ||||||
|  |     private String accessKey; | ||||||
|  | 
 | ||||||
|  |     @Value("${minio.secretKey}") | ||||||
|  |     private String secretKey; | ||||||
|  | 
 | ||||||
|  |     @Value("${minio.bucketName}") | ||||||
|  |     private String bucketName; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * @param inputStream | ||||||
|  |      * @param suffix | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      * @Title: uploadImage | ||||||
|  |      * @Description:上传图片 | ||||||
|  |      */ | ||||||
|  |     public JSONObject uploadImage(InputStream inputStream, String fileName, String suffix) throws Exception { | ||||||
|  |         return upload(inputStream, fileName, suffix, "image/jpeg"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 上传图片 | ||||||
|  |      * | ||||||
|  |      * @param inputStream | ||||||
|  |      * @param suffix | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      */ | ||||||
|  |     public JSONObject uploadImage(InputStream inputStream, String suffix) throws Exception { | ||||||
|  |         return upload(inputStream, null, suffix, "image/jpeg"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * @param inputStream | ||||||
|  |      * @param suffix | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      * @Title: uploadVideo | ||||||
|  |      * @Description:上传视频 | ||||||
|  |      */ | ||||||
|  |     public JSONObject uploadVideo(InputStream inputStream, String fileName, String suffix) throws Exception { | ||||||
|  |         return upload(inputStream, fileName, suffix, "video/mp4"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * @param inputStream | ||||||
|  |      * @param suffix | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      * @Title: uploadVideo | ||||||
|  |      * @Description:上传文件 | ||||||
|  |      */ | ||||||
|  |     public JSONObject uploadFile(InputStream inputStream, String fileName, String suffix) throws Exception { | ||||||
|  |         return upload(inputStream, fileName, suffix, "application/octet-stream"); | ||||||
|  | //        return upload(inputStream, fileName, suffix, "audio/mp3"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * @param inputStream | ||||||
|  |      * @param suffix | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      * @Title: uploadVideo | ||||||
|  |      * @Description:上传文件 | ||||||
|  |      */ | ||||||
|  |     public JSONObject uploadFiles(InputStream inputStream, String folder,String fileName, String suffix) throws Exception { | ||||||
|  |         return uploads(inputStream, folder,fileName, suffix, "application/octet-stream"); | ||||||
|  | //        return upload(inputStream, fileName, suffix, "audio/mp3"); | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * 上传字符串大文本内容 | ||||||
|  |      * | ||||||
|  |      * @param str | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      * @Title: uploadString | ||||||
|  |      * @Description:描述方法 | ||||||
|  |      */ | ||||||
|  |     public JSONObject uploadString(String str, String fileName) throws Exception { | ||||||
|  |         if (!StringUtils.isEmpty(str)) { | ||||||
|  |             return new JSONObject(); | ||||||
|  |         } | ||||||
|  |         InputStream inputStream = new ByteArrayInputStream(str.getBytes()); | ||||||
|  |         return upload(inputStream, fileName, null, "text/html"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      * @Title: upload | ||||||
|  |      * @Description:上传主功能 | ||||||
|  |      */ | ||||||
|  |     private JSONObject upload(InputStream inputStream, String fileName, String suffix, String contentType) throws Exception { | ||||||
|  |         JSONObject map = new JSONObject(); | ||||||
|  |         MinioClient minioClient = new MinioClient(url, accessKey, secretKey); | ||||||
|  |         // 检查存储桶是否已经存在 | ||||||
|  |         boolean isExist = minioClient.bucketExists(bucketName); | ||||||
|  |         if (isExist) { | ||||||
|  | //                System.out.println("Bucket already exists."); | ||||||
|  |         } else { | ||||||
|  |             // 创建一个名为asiatrip的存储桶,用于存储文件。 | ||||||
|  |             minioClient.makeBucket(bucketName); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); | ||||||
|  |         String ymd = sdf.format(new Date()); | ||||||
|  | //        String objectName = ymd + "/" + fileName + "/" + UUID.randomUUID() + (suffix != null ? suffix : ""); | ||||||
|  |         String objectName = ymd + "/" + (UtilValidate.isEmpty(fileName) ? getUniqueFileName() : fileName) + (suffix != null ? suffix : ""); | ||||||
|  |         minioClient.putObject(bucketName, objectName, inputStream, contentType); | ||||||
|  |         String url = minioClient.getObjectUrl(bucketName, objectName); | ||||||
|  |         map.put("flag", "0"); | ||||||
|  |         map.put("mess", "上传成功"); | ||||||
|  |         map.put("url", url); | ||||||
|  |         map.put("fullName", objectName); | ||||||
|  | //        map.put("path", bucketName + "/" + objectName); | ||||||
|  |         map.put("path", objectName); | ||||||
|  |         return map; | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      * @Title: upload | ||||||
|  |      * @Description:上传主功能 | ||||||
|  |      */ | ||||||
|  |     private JSONObject uploads(InputStream inputStream,String folder, String fileName, String suffix, String contentType) throws Exception { | ||||||
|  |         JSONObject map = new JSONObject(); | ||||||
|  |         MinioClient minioClient = new MinioClient(url, accessKey, secretKey); | ||||||
|  |         // 检查存储桶是否已经存在 | ||||||
|  |         boolean isExist = minioClient.bucketExists(bucketName); | ||||||
|  |         if (isExist) { | ||||||
|  | //                System.out.println("Bucket already exists."); | ||||||
|  |         } else { | ||||||
|  |             // 创建一个名为asiatrip的存储桶,用于存储文件。 | ||||||
|  |             minioClient.makeBucket(bucketName); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         String objectName = folder + "/" + (UtilValidate.isEmpty(fileName) ? getUniqueFileName() : fileName) + (suffix != null ? suffix : ""); | ||||||
|  |         minioClient.putObject(bucketName, objectName, inputStream, contentType); | ||||||
|  |         String url = minioClient.getObjectUrl(bucketName, objectName); | ||||||
|  |         map.put("flag", "0"); | ||||||
|  |         map.put("mess", "上传成功"); | ||||||
|  |         map.put("url", url); | ||||||
|  |         map.put("fullName", objectName); | ||||||
|  | //        map.put("path", bucketName + "/" + objectName); | ||||||
|  |         map.put("path", objectName); | ||||||
|  |         return map; | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * 获取上传对象信息 | ||||||
|  |      * | ||||||
|  |      * @param bucketName | ||||||
|  |      * @param objectName | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      */ | ||||||
|  |     public ObjectStat objectStat(String bucketName, String objectName) throws Exception { | ||||||
|  |         MinioClient minioClient = new MinioClient(url, accessKey, secretKey); | ||||||
|  |         ObjectStat objectStat = minioClient.statObject(bucketName, objectName); | ||||||
|  |         return objectStat; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 删除多个 | ||||||
|  |      * | ||||||
|  |      * @param bucketName | ||||||
|  |      * @param objectNames | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      */ | ||||||
|  |     public JSONObject removeObjects(String bucketName, List<String> objectNames) throws Exception { | ||||||
|  |         JSONObject map = new JSONObject(); | ||||||
|  |         MinioClient minioClient = new MinioClient(url, accessKey, secretKey); | ||||||
|  |         for (Result<DeleteError> errorResult : minioClient.removeObjects(bucketName, objectNames)) { | ||||||
|  |             DeleteError error = errorResult.get(); | ||||||
|  |             System.out.println("Failed to remove '" + error.objectName() + "'. Error:" + error.message()); | ||||||
|  |             map.put("results", error); | ||||||
|  |         } | ||||||
|  | //        Iterable<Result<DeleteError>> results =minioClient.removeObjects(bucketName,objectNames); | ||||||
|  | //        map.put("results",results); | ||||||
|  |         return map; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 删除文件 | ||||||
|  |      * | ||||||
|  |      * @param bucketName | ||||||
|  |      * @param objectName | ||||||
|  |      * @return | ||||||
|  |      * @throws Exception | ||||||
|  |      */ | ||||||
|  |     public JSONObject removeObject(String bucketName, String objectName) throws Exception { | ||||||
|  |         JSONObject map = new JSONObject(); | ||||||
|  |         MinioClient minioClient = new MinioClient(url, accessKey, secretKey); | ||||||
|  |         minioClient.removeObject(bucketName, objectName); | ||||||
|  |         map.put("results", "ok"); | ||||||
|  |         return map; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 根据存储箱和前缀查询对象集合 | ||||||
|  |      * | ||||||
|  |      * @param bucketName | ||||||
|  |      * @param prefix     文件对象前缀可以不传) | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public Iterable<Result<Item>> listObjects(String bucketName, String prefix) { | ||||||
|  |         Iterable<Result<Item>> myObjects = new ArrayList<>(); | ||||||
|  |         try { | ||||||
|  |             MinioClient minioClient = new MinioClient(url, accessKey, secretKey); | ||||||
|  |             // Check whether 'mybucket' exists or not. | ||||||
|  |             boolean found = minioClient.bucketExists(bucketName); | ||||||
|  |             if (found) { | ||||||
|  |                 //如果prefix为null或者‘’ | ||||||
|  |                 if ("".equals(prefix) || prefix == null) { | ||||||
|  |                     myObjects = minioClient.listObjects(bucketName); | ||||||
|  |                 } else { | ||||||
|  |                     //前缀查询 | ||||||
|  |                     myObjects = minioClient.listObjects(bucketName, prefix); | ||||||
|  |                 } | ||||||
|  |             } else { | ||||||
|  |                 System.out.println("mybucket does not exist"); | ||||||
|  |             } | ||||||
|  |         } catch (Exception e) { | ||||||
|  |             e.printStackTrace(); | ||||||
|  |             System.out.println("Error occurred: " + e); | ||||||
|  |         } | ||||||
|  |         return myObjects; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 根据桶和前缀输出里面所有的信息 | ||||||
|  |      * | ||||||
|  |      * @param bucketName | ||||||
|  |      * @param prefix | ||||||
|  |      */ | ||||||
|  |     public void printObjectsMsg(String bucketName, String prefix) { | ||||||
|  |         Iterable<Result<Item>> results = listObjects(bucketName, prefix); | ||||||
|  |         for (Result<Item> result : results) { | ||||||
|  |             Item item = null; | ||||||
|  |             try { | ||||||
|  |                 item = result.get(); | ||||||
|  |             } catch (Exception e) { | ||||||
|  |                 e.printStackTrace(); | ||||||
|  |             } | ||||||
|  |             logger.info(item.lastModified() + ", " + item.size() + ", " + item.objectName()); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 以流的形式下载文件 | ||||||
|  |      * | ||||||
|  |      * @param bucketName 桶名称 | ||||||
|  |      * @param objectName 对象名称 | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public void downloadFile(String bucketName, String objectName, HttpServletResponse response,String fileName) { | ||||||
|  |         try { | ||||||
|  |             MinioClient minioClient = new MinioClient(url, accessKey, secretKey); | ||||||
|  |             InputStream inputStream = minioClient.getObject(bucketName, objectName); | ||||||
|  |             OutputStream os = response.getOutputStream(); | ||||||
|  |             BufferedInputStream br = new BufferedInputStream(inputStream); | ||||||
|  |             byte[] buf = new byte[1024]; | ||||||
|  |             int len = 0; | ||||||
|  |             response.reset(); | ||||||
|  |             response.setContentType("application/octet-stream"); | ||||||
|  | //            response.setHeader("Access-Control-Allow-Origin", "localhost:8001"); | ||||||
|  |             response.setHeader("Content-Disposition", "attachment; filename=" + new String(fileName.getBytes("utf-8"), "ISO-8859-1")); | ||||||
|  |             OutputStream out = response.getOutputStream(); | ||||||
|  |             while ((len = br.read(buf)) > 0) { | ||||||
|  |                 out.write(buf, 0, len); | ||||||
|  |             } | ||||||
|  |             br.close(); | ||||||
|  |             out.close(); | ||||||
|  |         } catch (Exception e) { | ||||||
|  |             logger.error(e.getMessage(), e); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 获取唯一文件名 | ||||||
|  |      * | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public String getUniqueFileName() { | ||||||
|  |         return UUID.randomUUID().toString().replaceAll("-", ""); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 通过图片路径获取桶名称 | ||||||
|  |      * | ||||||
|  |      * @param fileUrl | ||||||
|  |      * @return 桶名称 | ||||||
|  |      */ | ||||||
|  |     public String getBucketNameByUrl(String fileUrl) { | ||||||
|  |         String[] splitArray = fileUrl.split("/"); | ||||||
|  |         return splitArray[3]; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 通过图片路径获取对象名称/文件名称 | ||||||
|  |      * | ||||||
|  |      * @param fileUrl | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public String getObjectNameByUrl(String fileUrl) { | ||||||
|  |         String[] splitArray = fileUrl.split(getBucketNameByUrl(fileUrl)); | ||||||
|  |         String splitResult = splitArray[1].replaceFirst("/", ""); | ||||||
|  |         //临时地址处理 | ||||||
|  |         if (splitResult.contains("?")) { | ||||||
|  |             String[] split = splitResult.split("\\?"); | ||||||
|  |             return split[0]; | ||||||
|  |         } | ||||||
|  |         return splitResult; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 获取文件名称 包括后缀 | ||||||
|  |      * | ||||||
|  |      * @param fileUrl | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public String getFileName(String fileUrl) { | ||||||
|  |         String[] split = fileUrl.split("/"); | ||||||
|  |         return split[split.length - 1]; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 截取minio有效的url 将问号后面的所有内容去掉 | ||||||
|  |      * | ||||||
|  |      * @param minioUrl | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public String interceptValidUrl(String minioUrl) { | ||||||
|  |         if (UtilValidate.isNotEmpty(minioUrl)) { | ||||||
|  |             return minioUrl.substring(0, minioUrl.indexOf("?")); | ||||||
|  |         } | ||||||
|  |         return null; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public static void main(String[] args) throws Exception { | ||||||
|  |         System.out.println(UUID.randomUUID().toString().replaceAll("-", "")); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,25 @@ | |||||||
|  | package com.dkha.common.http; | ||||||
|  | 
 | ||||||
|  | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||||||
|  | import org.springframework.context.annotation.Bean; | ||||||
|  | import org.springframework.context.annotation.Configuration; | ||||||
|  | import org.springframework.web.client.RestTemplate; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Description: | ||||||
|  |  * @Author: Spring | ||||||
|  |  * @CreateDate: 2019/8/5 14:19 | ||||||
|  |  */ | ||||||
|  | @Configuration | ||||||
|  | public class ConfigBean { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * @ConditionalOnMissingBean bean不存在的情况下才注入 | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @Bean | ||||||
|  |     @ConditionalOnMissingBean | ||||||
|  |     public RestTemplate getRestTemplate() { | ||||||
|  |         return new RestTemplate(); | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										175
									
								
								face-common/src/main/java/com/dkha/common/http/HttpUtil.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										175
									
								
								face-common/src/main/java/com/dkha/common/http/HttpUtil.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,175 @@ | |||||||
|  | package com.dkha.common.http; | ||||||
|  | 
 | ||||||
|  | import com.alibaba.fastjson.JSON; | ||||||
|  | import com.alibaba.fastjson.JSONObject; | ||||||
|  | import com.dkha.common.modules.vo.face.ApiAlarmVO; | ||||||
|  | import com.dkha.common.util.UtilValidate; | ||||||
|  | import jdk.nashorn.internal.scripts.JS; | ||||||
|  | import org.slf4j.Logger; | ||||||
|  | import org.slf4j.LoggerFactory; | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.http.*; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  | import org.springframework.web.client.RestTemplate; | ||||||
|  | 
 | ||||||
|  | import javax.servlet.http.HttpServletRequest; | ||||||
|  | import java.io.BufferedReader; | ||||||
|  | import java.io.IOException; | ||||||
|  | import java.util.Enumeration; | ||||||
|  | import java.util.HashMap; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/10/31 18:21 | ||||||
|  |  * @Description | ||||||
|  |  */ | ||||||
|  | @Component | ||||||
|  | public class HttpUtil<T> { | ||||||
|  | 
 | ||||||
|  |     public static final Logger logger = LoggerFactory.getLogger(HttpUtil.class); | ||||||
|  | 
 | ||||||
|  |     @Autowired | ||||||
|  |     private RestTemplate restTemplate; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * post request | ||||||
|  |      * @param url | ||||||
|  |      * @param requestObj request params | ||||||
|  |      * @param resultClass | ||||||
|  |      * @param <T> | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public <T> T post(String url, Object requestObj, Class<T> resultClass) { | ||||||
|  |         T t = restTemplate.postForObject(url, this.getHeaders(requestObj), resultClass); | ||||||
|  | //        logger.info("post result:  {}", JSON.toJSONString(resultClass)); | ||||||
|  |         return t; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * put request | ||||||
|  |      * @param url | ||||||
|  |      * @param requestObj | ||||||
|  |      * @param resultClass | ||||||
|  |      * @param <T> | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public <T> T put(String url, Object requestObj, Class<T> resultClass) { | ||||||
|  |         ResponseEntity<T> responseEntity = restTemplate.exchange(url, HttpMethod.PUT, this.getHeaders(requestObj), resultClass); | ||||||
|  | //        logger.info("put result:  {}", JSON.toJSONString(resultClass)); | ||||||
|  |         return responseEntity.getBody(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * get request | ||||||
|  |      * @param url | ||||||
|  |      * @param resultClass | ||||||
|  |      * @param <T> | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public <T> T get(String url, Class<T> resultClass) { | ||||||
|  |         ResponseEntity<T> responseEntity = restTemplate.exchange(url, HttpMethod.GET, this.getHeaders(null), resultClass); | ||||||
|  |         return responseEntity.getBody(); | ||||||
|  |     } | ||||||
|  |     public <T> T get(String url, Object requestObj, Class<T> resultClass) { | ||||||
|  |         ResponseEntity<T> responseEntity = restTemplate.exchange(url, HttpMethod.GET, this.getHeaders(requestObj), resultClass); | ||||||
|  |         return responseEntity.getBody(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public <T> T delete(String url, Class<T> resultClass) { | ||||||
|  |         ResponseEntity<T> responseEntity = restTemplate.exchange(url, HttpMethod.DELETE, this.getHeaders(null), resultClass); | ||||||
|  | 
 | ||||||
|  | //        logger.info("delete result:  {}", JSON.toJSONString(resultClass)); | ||||||
|  |         return responseEntity.getBody(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 判断返回是否成功 | ||||||
|  |      * @param resultObject | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public boolean isSuccess(Object resultObject) { | ||||||
|  |         String resultJson = JSON.toJSONString(resultObject); | ||||||
|  |         Map<String, Object> map = JSON.parseObject(resultJson, Map.class); | ||||||
|  |         if (UtilValidate.isNotEmpty(map) && map.get("rtn").toString().equals("0")) { | ||||||
|  |             return true; | ||||||
|  |         } else { | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /**\ | ||||||
|  |      * 获取POST请求参数 | ||||||
|  |      * @param request | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public static String getPostRequestParam(HttpServletRequest request) throws IOException { | ||||||
|  |         String bodyStr = getRequestPostBytes(request); | ||||||
|  |         return new String(bodyStr.getBytes(), "UTF-8"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 描述:获取 post 请求的 byte[] 数组 | ||||||
|  |      * <pre> | ||||||
|  |      * 举例: | ||||||
|  |      * </pre> | ||||||
|  |      * @param request | ||||||
|  |      * @return | ||||||
|  |      * @throws IOException | ||||||
|  |      */ | ||||||
|  |     public static String getRequestPostBytes(HttpServletRequest request) throws IOException { | ||||||
|  | 
 | ||||||
|  |         BufferedReader br = request.getReader(); | ||||||
|  | 
 | ||||||
|  |         String str; | ||||||
|  |         String wholeStr = ""; | ||||||
|  |         while((str = br.readLine()) != null){ | ||||||
|  |             wholeStr += str; | ||||||
|  |         } | ||||||
|  |         return wholeStr.toString(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 获取HTTP请求头信息 | ||||||
|  |      * @param request | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public static Map<String, String> getRequestHeadMsg(HttpServletRequest request) { | ||||||
|  |         Map<String, String> requestHeaderMsgMap = new HashMap<>(); | ||||||
|  |         Enumeration headerNames = request.getHeaderNames(); | ||||||
|  |         while (headerNames.hasMoreElements()) { | ||||||
|  |             String key = (String) headerNames.nextElement(); | ||||||
|  |             String value = request.getHeader(key); | ||||||
|  |             requestHeaderMsgMap.put(key, value); | ||||||
|  |         } | ||||||
|  |         return requestHeaderMsgMap; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 请求头设置 | ||||||
|  |      */ | ||||||
|  |     private HttpEntity getHeaders(Object requestObject) { | ||||||
|  |         HttpHeaders headers = new HttpHeaders(); | ||||||
|  |         MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); | ||||||
|  |         headers.setContentType(type); | ||||||
|  |         headers.add("Accept", MediaType.APPLICATION_JSON.toString()); | ||||||
|  |         //请求url不包含login,则需要设置请求头 | ||||||
|  |         /*if (!(JSON.toJSONString(requestObject).contains("name") && JSON.toJSONString(requestObject).contains("password"))) { | ||||||
|  |             headers.add("session_id", FaceSessionCache.get()); | ||||||
|  |         }*/ | ||||||
|  | 
 | ||||||
|  | //        if (JSON.toJSONString(requestObject).contains("token") ) { | ||||||
|  | //            try { | ||||||
|  | //                ApiAlarmVO apiAlarmVO=(ApiAlarmVO)requestObject; | ||||||
|  | //                headers.add("token",apiAlarmVO.getToken() ); | ||||||
|  | //            } catch (Exception e) { | ||||||
|  | //                e.printStackTrace(); | ||||||
|  | //            } | ||||||
|  | //        } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         HttpEntity<String> headerEntity = new HttpEntity<>(UtilValidate.isEmpty(requestObject) ? null : JSON.toJSONString(requestObject), headers); | ||||||
|  |         return headerEntity; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,22 @@ | |||||||
|  | package com.dkha.common.jwt; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/9/11 17:36 | ||||||
|  |  * @Description | ||||||
|  |  */ | ||||||
|  | public enum JwtConstantEnum { | ||||||
|  | 
 | ||||||
|  |     PLATFORM("platform", "platform"), | ||||||
|  |     USER_ID("uerId", "userId"), | ||||||
|  |     UUID("uuid", "uuid"); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public String code; | ||||||
|  |     public String msg; | ||||||
|  | 
 | ||||||
|  |     JwtConstantEnum(String code, String msg) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.msg = msg; | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										97
									
								
								face-common/src/main/java/com/dkha/common/jwt/JwtHelper.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								face-common/src/main/java/com/dkha/common/jwt/JwtHelper.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,97 @@ | |||||||
|  | package com.dkha.common.jwt; | ||||||
|  | 
 | ||||||
|  | import com.auth0.jwt.JWT; | ||||||
|  | import com.auth0.jwt.JWTVerifier; | ||||||
|  | import com.auth0.jwt.algorithms.Algorithm; | ||||||
|  | import com.auth0.jwt.exceptions.TokenExpiredException; | ||||||
|  | import com.auth0.jwt.interfaces.Claim; | ||||||
|  | import com.auth0.jwt.interfaces.DecodedJWT; | ||||||
|  | import com.dkha.common.exception.AuthorityException; | ||||||
|  | import com.dkha.common.exception.EmployeeException; | ||||||
|  | import com.dkha.common.systemcode.SystemCode; | ||||||
|  | import org.slf4j.Logger; | ||||||
|  | import org.slf4j.LoggerFactory; | ||||||
|  | 
 | ||||||
|  | import java.io.UnsupportedEncodingException; | ||||||
|  | import java.util.HashMap; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 后端主要实现用户的验证、token的签发、从http中解析出token串、token的验证、token的刷新等 | ||||||
|  |  * 在本类中并未全部实现,有待完善 | ||||||
|  |  * @Author: Spring | ||||||
|  |  * Created  on 2018/4/23. | ||||||
|  |  */ | ||||||
|  | public class JwtHelper { | ||||||
|  | 
 | ||||||
|  |     private static final Logger logger = LoggerFactory.getLogger(JwtHelper.class); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 用于HS256 hash加密算法,也可采用非对称的RS256公私钥加密 https://www.cnblogs.com/hehheai/p/6513871.html | ||||||
|  |      */ | ||||||
|  |     private static final String secret = "dk_employment_2019.10.12"; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * JWT生成方法,采用id和expiresTime,除保留字段,用户可自定义其余字段 | ||||||
|  |      * 以下为保留字段 | ||||||
|  |      * | ||||||
|  |      *  iss(Issuser):如果签发的时候这个claim的值是“a.com”,验证的时候如果这个claim的值不是“a.com”就属于验证失败; | ||||||
|  |      *  sub(Subject):如果签发的时候这个claim的值是“liuyunzhuge”,验证的时候如果这个claim的值不是“liuyunzhuge”就属于验证失败; | ||||||
|  |      *  aud(Audience):如果签发的时候这个claim的值是“['b.com','c.com']”,验证的时候这个claim的值至少要包含b.com,c.com的其中一个才能验证通过; | ||||||
|  |      *  exp(Expiration time):如果验证的时候超过了这个claim指定的时间,就属于验证失败; | ||||||
|  |      *  nbf(Not Before):如果验证的时候小于这个claim指定的时间,就属于验证失败; | ||||||
|  |      *  iat(Issued at):它可以用来做一些maxAge之类的验证,假如验证时间与这个claim指定的时间相差的时间大于通过maxAge指定的一个值,就属于验证失败; | ||||||
|  |      *  jti(JWT ID):如果签发的时候这个claim的值是“1”,验证的时候如果这个claim的值不是“1”就属于验证失败 | ||||||
|  |      * | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public static String generateJWT(String platform, String userId, String uuid) { | ||||||
|  | 
 | ||||||
|  |         /**设置JWT头部信息*/ | ||||||
|  |         Map<String, Object> headerMap = new HashMap<String, Object>(2); | ||||||
|  |         headerMap.put("typ", "JWT"); | ||||||
|  |         headerMap.put("alg", "HS256"); | ||||||
|  |         String token = null; | ||||||
|  |         try { | ||||||
|  |             token = JWT.create().withHeader(headerMap) | ||||||
|  |                     .withClaim(JwtConstantEnum.PLATFORM.code, platform) | ||||||
|  |                     .withClaim(JwtConstantEnum.USER_ID.code, userId) | ||||||
|  |                     .withClaim(JwtConstantEnum.UUID.code, uuid) | ||||||
|  |                     .sign(Algorithm.HMAC256(secret)); | ||||||
|  |         } catch (UnsupportedEncodingException e) { | ||||||
|  |             logger.error(e.getMessage(), e); | ||||||
|  |             throw new EmployeeException(e); | ||||||
|  |         } | ||||||
|  |         return token; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 验证JWT 该验证只能验证JWT保留字段,具体自定义验证需自定义完成 | ||||||
|  |      * 具体的错误类型可以通过设置求参数通过下面的main函数验证 | ||||||
|  |      * @param token | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public static Map<String, Claim> verifyToken(String token) { | ||||||
|  |         DecodedJWT jwt = null; | ||||||
|  |         try { | ||||||
|  |             JWTVerifier verifier = JWT.require(Algorithm.HMAC256(secret)).build(); | ||||||
|  |             jwt = verifier.verify(token); | ||||||
|  |             return jwt.getClaims(); | ||||||
|  |         } catch (UnsupportedEncodingException e) { | ||||||
|  |             logger.error(e.getMessage(), e); | ||||||
|  |             throw new AuthorityException(SystemCode.TOKEN_ERROR.code.toString()); | ||||||
|  |         } catch (TokenExpiredException e) { | ||||||
|  |             logger.error(e.getMessage(), e); | ||||||
|  |             throw new AuthorityException(SystemCode.TOKEN_EXPIRED.code.toString()); | ||||||
|  |         } catch (Exception e) { | ||||||
|  |             logger.error(e.getMessage(), e); | ||||||
|  |             throw new AuthorityException(SystemCode.TOKEN_ERROR.code.toString()); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public static void main(String[] args) { | ||||||
|  |         //JwtHelper.verifyToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIn0.kEZueQ8xZ_FKvlOxfC01bTaW3EqUGV9HJKKeeor6XQ1"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,39 @@ | |||||||
|  | /** | ||||||
|  |  * Copyright (c) 2018 人人开源 All rights reserved. | ||||||
|  |  * | ||||||
|  |  * https://www.renren.io | ||||||
|  |  * | ||||||
|  |  * 版权所有,侵权必究! | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | package com.dkha.common.kaptcha; | ||||||
|  | 
 | ||||||
|  | import com.google.code.kaptcha.impl.DefaultKaptcha; | ||||||
|  | import com.google.code.kaptcha.util.Config; | ||||||
|  | import org.springframework.context.annotation.Bean; | ||||||
|  | import org.springframework.context.annotation.Configuration; | ||||||
|  | 
 | ||||||
|  | import java.util.Properties; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 生成验证码配置 | ||||||
|  |  * | ||||||
|  |  * @author Mark sunlightcs@gmail.com | ||||||
|  |  */ | ||||||
|  | @Configuration | ||||||
|  | public class KaptchaConfig { | ||||||
|  | 
 | ||||||
|  |     @Bean | ||||||
|  |     public DefaultKaptcha producer() { | ||||||
|  |         Properties properties = new Properties(); | ||||||
|  |         properties.put("kaptcha.border", "no"); | ||||||
|  |         properties.put("kaptcha.textproducer.font.color", "black"); | ||||||
|  |         properties.put("kaptcha.textproducer.font.names", "Arial,Courier,cmr10,宋体,楷体,微软雅黑"); | ||||||
|  |         properties.put("kaptcha.textproducer.char.space", "5"); | ||||||
|  |         Config config = new Config(properties); | ||||||
|  |         DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); | ||||||
|  |         defaultKaptcha.setConfig(config); | ||||||
|  |         return defaultKaptcha; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | package com.dkha.common.modules.vo; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiVO | ||||||
|  |  * @Package com.dkha.common.entity.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/11/27 9:36 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="通用接口参数类 发送和接收通用", description="用于和底层传输统一参数格式") | ||||||
|  | public class ApiVO { | ||||||
|  |     @ApiModelProperty(value = "错误码") | ||||||
|  |     private Integer code; | ||||||
|  |     @ApiModelProperty(value = "错误提示") | ||||||
|  |     private String message; | ||||||
|  |     @ApiModelProperty(value = "操作命令对应不同的接口") | ||||||
|  |     private String cmd; | ||||||
|  |     @ApiModelProperty(value = "请求参数") | ||||||
|  |     private Object data; | ||||||
|  | } | ||||||
| @ -0,0 +1,150 @@ | |||||||
|  | package com.dkha.common.modules.vo; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.enums.ErrEnum; | ||||||
|  | import com.dkha.common.exception.DkException; | ||||||
|  | import com.dkha.common.util.UtilValidate; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | import org.springframework.validation.BindingResult; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ReturnVO | ||||||
|  |  * @Package com.dkha.api.modules | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/2 13:34 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="API通用返回", description="Api通用返回結構類") | ||||||
|  | public class ReturnVO implements Serializable { | ||||||
|  | 
 | ||||||
|  |     private Integer code; | ||||||
|  |     private String message; | ||||||
|  |     private Object data; | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public ReturnVO(Object data, Integer code, String message) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.data = data; | ||||||
|  |         this.message = message; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public ReturnVO(Integer code, String message) { | ||||||
|  |         this.code = code; | ||||||
|  |         this.data = null; | ||||||
|  |         this.message = message; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 操作成功返回集 code为200 | ||||||
|  |      */ | ||||||
|  |     public ReturnVO successResult(Object data) { | ||||||
|  |         ReturnVO ReturnVO = new ReturnVO(); | ||||||
|  |         ReturnVO.code = ErrEnum.OK.getCode(); | ||||||
|  |         ReturnVO.data = data; | ||||||
|  |         ReturnVO.message = ErrEnum.OK.getMsg(); | ||||||
|  |         return ReturnVO; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 操作成功返回集 code为200 | ||||||
|  |      * @param message | ||||||
|  |      * @param data | ||||||
|  |      */ | ||||||
|  |     public ReturnVO successResult(String message, Object data) { | ||||||
|  |         ReturnVO ReturnVO = new ReturnVO(); | ||||||
|  |         ReturnVO.code = ErrEnum.OK.getCode(); | ||||||
|  |         ReturnVO.data = data; | ||||||
|  |         ReturnVO.message = UtilValidate.isEmpty(message) ? ErrEnum.OK.getMsg() : message; | ||||||
|  |         return ReturnVO; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 操作失败返回集 默认code 500 | ||||||
|  |      * @param message | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public ReturnVO failResult(String message) { | ||||||
|  |         ReturnVO ReturnVO = new ReturnVO(); | ||||||
|  |         ReturnVO.code = ErrEnum.ERROR.getCode(); | ||||||
|  |         ReturnVO.data = null; | ||||||
|  |         ReturnVO.message = message; | ||||||
|  |         return ReturnVO; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 参数不正确 默认code | ||||||
|  |      * @param message | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public ReturnVO paramErrorResult(String message) { | ||||||
|  |         ReturnVO ReturnVO = new ReturnVO(); | ||||||
|  |         ReturnVO.code = ErrEnum.BAD_REQUEST.getCode(); | ||||||
|  |         ReturnVO.data = null; | ||||||
|  |         ReturnVO.message = (UtilValidate.isEmpty(message)? ErrEnum.BAD_REQUEST.getMsg():message); | ||||||
|  |         return ReturnVO; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 没有查询到数据 默认code | ||||||
|  |      * @param message | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public ReturnVO notInfoResult(String message) { | ||||||
|  |         ReturnVO ReturnVO = new ReturnVO(); | ||||||
|  |         ReturnVO.code = ErrEnum.NOT_FOUND.getCode(); | ||||||
|  |         ReturnVO.data = null; | ||||||
|  |         ReturnVO.message = (UtilValidate.isEmpty(message)? ErrEnum.NOT_FOUND.getMsg():message); | ||||||
|  |         return ReturnVO; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 操作失败返回集 | ||||||
|  |      * @param | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public ReturnVO fail() { | ||||||
|  |         ReturnVO ReturnVO = new ReturnVO(); | ||||||
|  |         ReturnVO.code = ErrEnum.ERROR.getCode(); | ||||||
|  |         ReturnVO.data = null; | ||||||
|  |         ReturnVO.message = ErrEnum.ERROR.getMsg(); | ||||||
|  |         return ReturnVO; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 操作失败返回集 | ||||||
|  |      * @param data | ||||||
|  |      * @param message | ||||||
|  |      * @param code | ||||||
|  |      */ | ||||||
|  |     public ReturnVO failResult(Integer code, String message, Object data) { | ||||||
|  |         ReturnVO ReturnVO = new ReturnVO(); | ||||||
|  |         ReturnVO.code = UtilValidate.isEmpty(code) ? ErrEnum.ERROR.getCode() : code; | ||||||
|  |         ReturnVO.data = data; | ||||||
|  |         ReturnVO.message = UtilValidate.isEmpty(message) ? ErrEnum.ERROR.getMsg() : message; | ||||||
|  |         return ReturnVO; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 用于Hibernate-validate vo校验 | ||||||
|  |      * @param bindingResult | ||||||
|  |      */ | ||||||
|  |     public void validate(BindingResult bindingResult) { | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             throw new DkException(bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,32 @@ | |||||||
|  | package com.dkha.common.modules.vo.camera; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: AssociationPeopleVO | ||||||
|  |  * @Package com.dkha.common.modules.vo.camera | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2020/1/9 17:57 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="人脸特征id关联的预警信息", description="人脸特征id关联的预警信息") | ||||||
|  | public class AssociationPeopleVO { | ||||||
|  |     @ApiModelProperty(value = "特征id") | ||||||
|  |     private String featId; | ||||||
|  |     @ApiModelProperty(value = "预警信息") | ||||||
|  |     private List<String> armIds; | ||||||
|  | } | ||||||
| @ -0,0 +1,48 @@ | |||||||
|  | package com.dkha.common.modules.vo.camera; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | import org.apache.tomcat.jni.Library; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(人物轨迹中redis存储单个摄像头分组信息) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: BayOnetCameraVO | ||||||
|  |  * @Package com.dkha.common.modules.vo.camera | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2020/1/9 17:38 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="人物轨迹数据", description="人物轨迹中redis存储单个摄像头分组信息") | ||||||
|  | public class BayOnetCameraVO { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "摄像头id") | ||||||
|  |     private String cameraId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "关联库id") | ||||||
|  |     private String associationLibraryId; | ||||||
|  | 
 | ||||||
|  | //    @ApiModelProperty(value = "关联的人物数据") | ||||||
|  | //    private PeopleVO peopleVO; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "处理抓拍条数") | ||||||
|  |     public Long warningNum = 0L; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "关于人脸的featids") | ||||||
|  |     private List<String> featIds; | ||||||
|  | //    @ApiModelProperty(value = "关联任务信息预警的id,人脸特征id-》不同的预警id信息") | ||||||
|  | //    private List<AssociationPeopleVO> associationPeople; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,27 @@ | |||||||
|  | package com.dkha.common.modules.vo.camera; | ||||||
|  | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: CameraInfoVO | ||||||
|  |  * @Package com.dkha.task.modual.vo.track | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2020/1/8 18:05 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @Data | ||||||
|  | public class CameraInfoVO { | ||||||
|  | 
 | ||||||
|  |     private String idFaceCamera; | ||||||
|  |     private String cameraName; | ||||||
|  |     private String cameraLongitude; | ||||||
|  |     private String cameraLatitude; | ||||||
|  |     private String status; | ||||||
|  | } | ||||||
| @ -0,0 +1,44 @@ | |||||||
|  | package com.dkha.common.modules.vo.camera; | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.face.FeatureVO; | ||||||
|  | import com.dkha.common.modules.vo.position.PositionVO; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: PeopleComparableVO | ||||||
|  |  * @Package com.dkha.common.modules.vo.camera | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2020/1/14 16:20 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @Data | ||||||
|  | public class PeopleComparableVO implements Comparable<PeopleComparableVO>{ | ||||||
|  | 
 | ||||||
|  |     private String cameraId; | ||||||
|  |     private CameraInfoVO  cameraInfoVO; | ||||||
|  |     private String esId; | ||||||
|  |     private String faceUrl; | ||||||
|  |     private String bgUrl; | ||||||
|  |     private PositionVO position; | ||||||
|  |     private Long timestamp; | ||||||
|  |     private String time; | ||||||
|  |     private Double score; | ||||||
|  |     private FeatureVO featureVO; | ||||||
|  |     private String faceId; | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public int compareTo(PeopleComparableVO peopleComparableVO) { | ||||||
|  |         if(this.timestamp.intValue()!=peopleComparableVO.getTimestamp().intValue()) | ||||||
|  |         { | ||||||
|  |             return (this.timestamp.intValue()-peopleComparableVO.getTimestamp().intValue()); | ||||||
|  |         } | ||||||
|  |         return 0; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,35 @@ | |||||||
|  | package com.dkha.common.modules.vo.camera; | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.face.FeatureVO; | ||||||
|  | import com.dkha.common.modules.vo.position.PositionVO; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(绑定轨迹中需要的人脸数据) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: PeopleVO | ||||||
|  |  * @Package com.dkha.task.modual.vo.track | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2020/1/10 11:36 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @Data | ||||||
|  | public class PeopleVO implements Serializable { | ||||||
|  |     private String esId; | ||||||
|  |     private String faceUrl; | ||||||
|  |     private String cameraId; | ||||||
|  |     private String bgUrl; | ||||||
|  |     private PositionVO position; | ||||||
|  |     private Long timestamp; | ||||||
|  |     private String time; | ||||||
|  |     private Double score; | ||||||
|  |     private FeatureVO featureVO; | ||||||
|  |     private String faceId; | ||||||
|  | } | ||||||
| @ -0,0 +1,42 @@ | |||||||
|  | package com.dkha.common.modules.vo.control; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * <p> | ||||||
|  |  * 布控表 | ||||||
|  |  * </p> | ||||||
|  |  * | ||||||
|  |  * @author Spring | ||||||
|  |  * @since 2019-11-20 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = false) | ||||||
|  | @Accessors(chain = true) | ||||||
|  | 
 | ||||||
|  | public class ControlTaskVedioVO{ | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  |     private String idControlTask; | ||||||
|  |     @ApiModelProperty(value = "布控阈值") | ||||||
|  |     private Double threshold; | ||||||
|  |     @ApiModelProperty(value = "布控名称") | ||||||
|  |     private String name; | ||||||
|  |     @TableField(exist = false) | ||||||
|  |     @ApiModelProperty(value = "url") | ||||||
|  |     private String url; | ||||||
|  | 
 | ||||||
|  |     @TableField(exist = false) | ||||||
|  |     @ApiModelProperty(value = "库id") | ||||||
|  |     private List<String> libraryId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务id") | ||||||
|  |     private String taskId; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,43 @@ | |||||||
|  | package com.dkha.common.modules.vo.control; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ControlVO | ||||||
|  |  * @Package com.dkha.common.entity.vo.control | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/11/27 10:55 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "布控-新增/删除", description = "用于布控和底层传输统一参数格式") | ||||||
|  | public class ControlVO { | ||||||
|  |     @ApiModelProperty(value = "任务id") | ||||||
|  |     private String taskId_cameraId; | ||||||
|  |     @ApiModelProperty(value = "任务地址根据下面类型来传递不同的地址比如:rtsp和http") | ||||||
|  |     private String vdUrl; | ||||||
|  |     @ApiModelProperty(value = "任务类型VdUrlRtsp rtsp流类型url VdUrlGb28181  gb28181流类型url VdUrlHttp http视频文件类型url") | ||||||
|  |     private String vdType; | ||||||
|  |     @ApiModelProperty(value = "库列表id") | ||||||
|  |     private List<String> libIds; | ||||||
|  |     @ApiModelProperty(value = "最小分值,取值范围0.00~1.00") | ||||||
|  |     private Double minScore; | ||||||
|  |     @ApiModelProperty(value = "每个库最大返回结果数, 0~100") | ||||||
|  |     private Double maxRetNb; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "删除任务列表") | ||||||
|  |     private List<String>  taskIdCameraIds; | ||||||
|  | } | ||||||
| @ -0,0 +1,84 @@ | |||||||
|  | package com.dkha.common.modules.vo.control; | ||||||
|  | 
 | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import org.hibernate.validator.constraints.Length; | ||||||
|  | import org.springframework.format.annotation.DateTimeFormat; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.Max; | ||||||
|  | import javax.validation.constraints.Min; | ||||||
|  | import javax.validation.constraints.NotNull; | ||||||
|  | import javax.validation.constraints.Size; | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: 应用层布控任务VO | ||||||
|  |  * @Title: | ||||||
|  |  * @author: huangyugang | ||||||
|  |  * @date: 2019/12/10 9:14 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = false) | ||||||
|  | @ApiModel(value="ControlTask对象", description="布控任务") | ||||||
|  | public class TaskControlVO  implements Serializable { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务ID") | ||||||
|  |     private Long idControlTask; | ||||||
|  |     @ApiModelProperty(value = "布控对象(id 人像库id 或者上传图片id)") | ||||||
|  |     private String controlObject; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务名称") | ||||||
|  |     @NotNull | ||||||
|  |     @Length(min=3,message = "任务名称最小长度不能小于3") | ||||||
|  |     private String taskName; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "处置类型-码值 抓捕类1,监控类2,提示类0 默认选择0") | ||||||
|  |     @NotNull(message = "处置类型不能为空") | ||||||
|  |     private String disposalType; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控类型-码值 长期布控 0,临时布控 1 默认选择0 ") | ||||||
|  |     @NotNull(message = "布控类型不能为空") | ||||||
|  |     private String controlType; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控开始时间") | ||||||
|  |     @DateTimeFormat(pattern = "yyy-MM-dd HH:mm") | ||||||
|  |     private Date controlStartTime; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控结束时间") | ||||||
|  |     @DateTimeFormat(pattern = "yyy-MM-dd HH:mm") | ||||||
|  |     private Date controlEndTime; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控区域") | ||||||
|  |    // @NotNull(message = "布控区域不能为空") | ||||||
|  |     private String controlRegion; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控阈值") | ||||||
|  |     @NotNull(message = "布控阀值不能为空必须是0-1之间") | ||||||
|  |     @Max(value = 1,message = "布控阈值 最大值为1") | ||||||
|  |     @Min(value = 0,message = "布控阈值 最小值为0") | ||||||
|  |     private Double controlThreshold; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控对象库ID列表") | ||||||
|  |     @NotNull | ||||||
|  |     @Size(min = 1) | ||||||
|  |     private List<String> libIds; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控的摄像头ID列表") | ||||||
|  |     @NotNull | ||||||
|  |     @Size(min = 1) | ||||||
|  |     private List<String> listcamera; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "备注信息") | ||||||
|  |     private String remarks; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "上传图片布控的url") | ||||||
|  |     private String  imgurl; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,48 @@ | |||||||
|  | package com.dkha.common.modules.vo.control; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.Max; | ||||||
|  | import javax.validation.constraints.Min; | ||||||
|  | import javax.validation.constraints.NotNull; | ||||||
|  | import javax.validation.constraints.Size; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: | ||||||
|  |  * @Title: | ||||||
|  |  * @author: huangyugang | ||||||
|  |  * @date: 2019/12/11 15:21 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "视频比对布控", description = "用于布控和底层传输统一参数格式") | ||||||
|  | public class VideoControlVo { | ||||||
|  |     @ApiModelProperty(value = "任务名称") | ||||||
|  |     private String taskName; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控阈值") | ||||||
|  |     @NotNull(message = "布控阀值不能为空必须是0-1之间") | ||||||
|  |     @Max(value = 1,message = "布控阈值 最大值为1") | ||||||
|  |     @Min(value = 0,message = "布控阈值 最小值为0") | ||||||
|  |     private Double controlThreshold; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控对象库ID列表") | ||||||
|  |     @NotNull | ||||||
|  |     @Size(min = 1) | ||||||
|  |     private List<String> libIds; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "布控视频URL地址") | ||||||
|  |     @NotNull | ||||||
|  |     private String videourl; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,24 @@ | |||||||
|  | package com.dkha.common.modules.vo.cut; | ||||||
|  | 
 | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/12/13 16:43 | ||||||
|  |  * @Description 裁剪图片 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class CutVo { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "图片路径") | ||||||
|  |     private String url; | ||||||
|  |     @ApiModelProperty(value = "坐标 x") | ||||||
|  |     private Integer x; | ||||||
|  |     @ApiModelProperty(value = "坐标 y") | ||||||
|  |     private Integer y; | ||||||
|  |     @ApiModelProperty(value = "坐标 w") | ||||||
|  |     private Integer w; | ||||||
|  |     @ApiModelProperty(value = "坐标 h") | ||||||
|  |     private Integer h; | ||||||
|  | } | ||||||
| @ -0,0 +1,39 @@ | |||||||
|  | package com.dkha.common.modules.vo.dto; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: FaceLibraryVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: yangjun | ||||||
|  |  * @date: 2019/12/3 15:13 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="特征库", description="特征库信息") | ||||||
|  | public class FaceLibraryVO { | ||||||
|  |     @ApiModelProperty(value="库id") | ||||||
|  |     private String libraryId; | ||||||
|  |     @ApiModelProperty(value="库名称") | ||||||
|  |     private String name; | ||||||
|  |     @ApiModelProperty(value="库类型") | ||||||
|  |     private String type; | ||||||
|  |     @ApiModelProperty(value="额外信息") | ||||||
|  |     private String extraMeta; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "创建时间") | ||||||
|  |     private Date createTime; | ||||||
|  | } | ||||||
| @ -0,0 +1,35 @@ | |||||||
|  | package com.dkha.common.modules.vo.dto; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.NotNull; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ImagesVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/3 15:14 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "批量图片入库接口", description = "用于图片入库接口") | ||||||
|  | public class ImageListVO { | ||||||
|  |     @ApiModelProperty(value = "目标库id") | ||||||
|  |     @NotNull(message = "目标库id不能为空") | ||||||
|  |     private String libraryId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "人脸相关信息") | ||||||
|  |     private List<ImageVO> faces; | ||||||
|  | } | ||||||
| @ -0,0 +1,50 @@ | |||||||
|  | package com.dkha.common.modules.vo.dto; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.NotBlank; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ImagesVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/3 15:14 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "用于图片入库接口", description = "用于图片入库接口") | ||||||
|  | public class ImageVO { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "需要入库的人脸地址") | ||||||
|  |     @NotBlank(message = "人脸图片地址不能为空") | ||||||
|  |     private String url; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "身份证id可空") | ||||||
|  |     private String idCard; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "性别可空") | ||||||
|  |     private String gender; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "姓名") | ||||||
|  |     private String name; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "名族") | ||||||
|  |     private String nation; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "特征信息") | ||||||
|  |     private String feature; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "额外信息") | ||||||
|  |     private String extraMeta; | ||||||
|  | } | ||||||
| @ -0,0 +1,72 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(预警报警返回接口) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: AlarmReturnVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/2 11:16 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="预警报警接口返回给业务层的数据", description="预警报警接口返回给业务层的数据") | ||||||
|  | public class AlarmReturnVO { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务id") | ||||||
|  |     private String taskId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "摄像头id") | ||||||
|  |     private String cameraId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "摄像头名称") | ||||||
|  |     private String cameraName; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务名称") | ||||||
|  |     private String taskName; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务处置类型") | ||||||
|  |     private String taskType; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "背景图片") | ||||||
|  |     private String faceBgUrl; | ||||||
|  |     @ApiModelProperty(value = "背景高度") | ||||||
|  |     private Integer bgHeight; | ||||||
|  |     @ApiModelProperty(value = "背景宽度") | ||||||
|  |     private Integer bgWidth; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "报警唯一id") | ||||||
|  |     private String alarmId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="抓拍时间") | ||||||
|  |     private Long timestamp; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="抓拍时间") | ||||||
|  |     private String date; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "人脸比中信息") | ||||||
|  |     private List<ApiFaceVO> faces; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "今日数量") | ||||||
|  |     private long toDaySnapShot; | ||||||
|  |     @ApiModelProperty(value = "总数") | ||||||
|  |     private long totalSnapShot; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,50 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiAlarmVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/11/29 16:00 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="预警任务参数", description="业务层调用返回的数据") | ||||||
|  | public class ApiAlarmVO { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="任务id") | ||||||
|  |     private String taskId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="任务id列表") | ||||||
|  |     private List<String> taskIds; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "摄像头列表") | ||||||
|  |     private List<String> cameraIds; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "查询参数筛选") | ||||||
|  |     private PageVO page; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "摄像头id仅用于卡口类型业务") | ||||||
|  |     private String cameraId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务类别:0 报警任务,1是视频任务") | ||||||
|  |     private Integer taskType; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务类别:0 报警任务,1是视频任务") | ||||||
|  |     private String token; | ||||||
|  | } | ||||||
| @ -0,0 +1,29 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.position.PositionVO; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiFaceOneSearchFaceVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/9 11:38 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "人脸库1:1比对返回", description = "人脸检索") | ||||||
|  | public class ApiFaceOneSearchFaceVO { | ||||||
|  |     private PositionVO faceRect; | ||||||
|  |     private String url; | ||||||
|  | } | ||||||
| @ -0,0 +1,32 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiFaceOneSearchReturnFaceVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/9 11:42 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "人脸库1:1比对返回", description = "人脸检索") | ||||||
|  | public class ApiFaceOneSearchReturnFaceVO { | ||||||
|  | 
 | ||||||
|  |     private Double hitSimilarity; | ||||||
|  |     private List<ApiFaceOneSearchFaceVO> faces; | ||||||
|  | 
 | ||||||
|  |     private String extraMeta; | ||||||
|  | } | ||||||
| @ -0,0 +1,30 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.position.PositionVO; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiFaceSearGroupReturnVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/9 13:00 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "人脸分组检索返回数据", description = "人脸分组检索返回数据") | ||||||
|  | public class ApiFaceSearGroupReturnVO { | ||||||
|  |     private PositionVO faceRect; | ||||||
|  |     private String url;//背景图片 | ||||||
|  |     private double hitSimilarity;//命中的相似度 | ||||||
|  | } | ||||||
| @ -0,0 +1,32 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiFaceSearchFaceVo | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/9 15:03 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "人脸库检索faces返回", description = "人脸检索") | ||||||
|  | public class ApiFaceSearchFaceVO { | ||||||
|  |     @ApiModelProperty(value = "比中分数") | ||||||
|  |     private Double hitSimilarity; | ||||||
|  |     @ApiModelProperty(value = "比中人脸的人脸id") | ||||||
|  |     private String faceId; | ||||||
|  |     @ApiModelProperty(value = "人脸库id") | ||||||
|  |     private String libraryId; | ||||||
|  | } | ||||||
| @ -0,0 +1,35 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.position.PositionVO; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiFaceSearchFacesVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/9 10:32 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "人脸库检索faces返回", description = "人脸检索") | ||||||
|  | public class ApiFaceSearchFacesVO { | ||||||
|  | 
 | ||||||
|  |     private String url; | ||||||
|  |     private PositionVO faceRect; | ||||||
|  |     @ApiModelProperty(value = "当前库检索结果") | ||||||
|  |     private List<ApiFaceSearchFaceVO> faceList; | ||||||
|  | } | ||||||
| @ -0,0 +1,30 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiFaceSearchReturnVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/6 18:34 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "人脸库检索返回", description = "人脸检索") | ||||||
|  | public class ApiFaceSearchReturnVO { | ||||||
|  |     private List<ApiFaceSearchFacesVO> faces; | ||||||
|  |     private PageVO pageVO; | ||||||
|  | } | ||||||
| @ -0,0 +1,36 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiFaceSearcVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/6 18:28 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="人脸检索类", description="人脸检索类") | ||||||
|  | public class ApiFaceSearchVO { | ||||||
|  |     @ApiModelProperty(value = "人脸url列表") | ||||||
|  |     private String url; | ||||||
|  |     @ApiModelProperty(value = "人脸库列表") | ||||||
|  |     private List<String> libraryIds; | ||||||
|  |     @ApiModelProperty(value = "每个库最大返回结果数, 0~100") | ||||||
|  |     private Double minScore; | ||||||
|  |     @ApiModelProperty(value = "分页数据") | ||||||
|  |     private PageVO pageVO; | ||||||
|  | } | ||||||
| @ -0,0 +1,40 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.position.PositionVO; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(用于接口返回实体) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: FaceVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/2 14:11 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | //@JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="预警报警组装给业务层的数据实体类", description="预警报警组装给业务层的数据实体类") | ||||||
|  | public class ApiFaceVO { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="人脸坐标") | ||||||
|  |     private PositionVO faceRect; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="人脸比中信息") | ||||||
|  |     private List<ComparisonVO> compare; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="特征") | ||||||
|  |     private FeatureVO feature; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,29 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.position.PositionVO; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ApiSearchFaceRectVo | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/9 12:36 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="人脸检测返回人脸信息", description="人脸检测返回人脸信息") | ||||||
|  | public class ApiSearchFaceRectVO { | ||||||
|  |     private PositionVO faceRect; | ||||||
|  |     private String url; | ||||||
|  | } | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ComparisonVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/2 14:42 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | //@JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="比中人脸信息", description="比中人脸信息") | ||||||
|  | public class ComparisonVO { | ||||||
|  |     @ApiModelProperty(value="比中库id") | ||||||
|  |     private String libraryId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="比中库中的人脸id") | ||||||
|  |     private String comparisonFaceId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="比中分值") | ||||||
|  |     private Double hitSimilarity; | ||||||
|  | } | ||||||
| @ -0,0 +1,46 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * <p> | ||||||
|  |  * 布控表 | ||||||
|  |  * </p> | ||||||
|  |  * | ||||||
|  |  * @author Spring | ||||||
|  |  * @since 2019-11-20 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = false) | ||||||
|  | @Accessors(chain = true) | ||||||
|  | 
 | ||||||
|  | public class ControlTaskVO extends GovShortBaseEntity{ | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  |     private String idControlTask; | ||||||
|  |     @ApiModelProperty(value = "布控阈值") | ||||||
|  |     private Double threshold; | ||||||
|  |     @ApiModelProperty(value = "布控名称") | ||||||
|  |     private String name; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "额外信息") | ||||||
|  |     private String extraMeta; | ||||||
|  | 
 | ||||||
|  |     @TableField(exist = false) | ||||||
|  |     @ApiModelProperty(value = "摄像头id") | ||||||
|  |     private List<String> cameraId; | ||||||
|  | 
 | ||||||
|  |     @TableField(exist = false) | ||||||
|  |     @ApiModelProperty(value = "库id") | ||||||
|  |     private List<String> libraryId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "任务id") | ||||||
|  |     private String taskId; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.warning.WarningVO; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ESReturnVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/11/29 18:30 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="查询es返回数据的实体类", description="业务层调用返回的数据") | ||||||
|  | public class EsReturnVO { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="警报数据") | ||||||
|  |     private WarningVO content; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value="总数") | ||||||
|  |     private Long totalElements; | ||||||
|  | } | ||||||
| @ -0,0 +1,46 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: FaceBayonetVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: yangjun | ||||||
|  |  * @date: 2019/12/5 17:57 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = false) | ||||||
|  | @Accessors(chain = true) | ||||||
|  | @ApiModel(value="FaceBayonet对象", description="摄像头表") | ||||||
|  | public class FaceBayonetVO implements Serializable { | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "id") | ||||||
|  |     private String carmeraId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "摄像头名称") | ||||||
|  |     private String name; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "摄像头地址") | ||||||
|  |     private String url; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "摄像头类型") | ||||||
|  |     private String type; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "额外信息") | ||||||
|  |     private String extraMeta; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "创建时间") | ||||||
|  |     private Date createTime; | ||||||
|  | } | ||||||
| @ -0,0 +1,39 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: FaceLibraryVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: yangjun | ||||||
|  |  * @date: 2019/12/3 15:13 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="特征库", description="特征库信息") | ||||||
|  | public class FaceLibraryVO { | ||||||
|  |     @ApiModelProperty(value="库id") | ||||||
|  |     private String libraryId; | ||||||
|  |     @ApiModelProperty(value="库名称") | ||||||
|  |     private String name; | ||||||
|  |     @ApiModelProperty(value="库类型") | ||||||
|  |     private String type; | ||||||
|  |     @ApiModelProperty(value="额外信息") | ||||||
|  |     private String extraMeta; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "创建时间") | ||||||
|  |     private Date createTime; | ||||||
|  | } | ||||||
| @ -0,0 +1,46 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import lombok.experimental.Accessors; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  *  | ||||||
|  |  * | ||||||
|  |  * @author Mark sunlightcs@gmail.com | ||||||
|  |  * @since 1.0.0 2020-01-10 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = false) | ||||||
|  | @Accessors(chain = true) | ||||||
|  | public class FaceTrackVO implements Serializable { | ||||||
|  | 	private static final long serialVersionUID = 1L; | ||||||
|  | 	/** | ||||||
|  | 	 * 图片url | ||||||
|  | 	 */ | ||||||
|  | 	private String  url; | ||||||
|  |     /** | ||||||
|  |      * 人像id | ||||||
|  |      */ | ||||||
|  | 	private String  faceId; | ||||||
|  |     /** | ||||||
|  |      * 摄像头id | ||||||
|  |      */ | ||||||
|  | 	private Long idFaceCamera; | ||||||
|  |     /** | ||||||
|  |      * 库id | ||||||
|  |      */ | ||||||
|  | 	private String startTime; | ||||||
|  |     /** | ||||||
|  |      * 人物数据 | ||||||
|  |      */ | ||||||
|  | 	private String endTime; | ||||||
|  | 
 | ||||||
|  | 	/** | ||||||
|  | 	 * 轨迹判定阈值 | ||||||
|  | 	 */ | ||||||
|  | 	private Double trajectoryThreshold; | ||||||
|  | } | ||||||
| @ -0,0 +1,31 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: FeatureVO | ||||||
|  |  * @Package com.dkha.common.entity.vo.position | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/13 14:42 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @Data | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="特征类", description="人脸特征类") | ||||||
|  | public class FeatureVO { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "人脸检查后年龄") | ||||||
|  |     private Integer age; | ||||||
|  |     @ApiModelProperty(value = "人脸检查后性别") | ||||||
|  |     private String gender ; | ||||||
|  | } | ||||||
| @ -0,0 +1,44 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.FieldFill; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonFormat; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @ClassName: | ||||||
|  |  * @Description:(please write your description) | ||||||
|  |  * @author: {yangjun} | ||||||
|  |  * @date: | ||||||
|  |  * @Copyright: 成都电科惠安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class GovShortBaseEntity implements Serializable { | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     @TableField(fill = FieldFill.INSERT) | ||||||
|  |     @ApiModelProperty(value = "是否有效 Y有效 N无效 作逻辑删除使用") | ||||||
|  |     private String isValid; | ||||||
|  | 
 | ||||||
|  |     @TableField(fill = FieldFill.INSERT) | ||||||
|  |     @ApiModelProperty(value = "创建人") | ||||||
|  |     private String createBy; | ||||||
|  | 
 | ||||||
|  |     @TableField(fill = FieldFill.INSERT_UPDATE) | ||||||
|  |     @ApiModelProperty(value = "更新人") | ||||||
|  |     private String updateBy; | ||||||
|  | 
 | ||||||
|  |     @TableField(fill = FieldFill.INSERT) | ||||||
|  |     @ApiModelProperty(value = "创建时间") | ||||||
|  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||||
|  |     private Date createTime; | ||||||
|  | 
 | ||||||
|  |     @TableField(fill = FieldFill.INSERT_UPDATE) | ||||||
|  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||||
|  |     @ApiModelProperty(value = "更新时间") | ||||||
|  |     private Date updateTime; | ||||||
|  | } | ||||||
| @ -0,0 +1,41 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(预警任务中过滤参数) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: HitConditionVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/11/29 17:08 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="预警任务中过滤参数", description="业务层调用返回的数据") | ||||||
|  | public class HitConditionVO { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "当前页") | ||||||
|  |     private Integer pageNo; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "每页条数") | ||||||
|  |     private Integer pageSize; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "开始时间戳") | ||||||
|  |     private Long startTimestamp; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "结束时间戳") | ||||||
|  |     private Long stopTimestamp; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "排序时间戳默认DESC传递ASC") | ||||||
|  |     private String order; | ||||||
|  | } | ||||||
| @ -0,0 +1,35 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.NotNull; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ImagesVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/3 15:14 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "批量图片入库接口", description = "用于图片入库接口") | ||||||
|  | public class ImageListVO { | ||||||
|  |     @ApiModelProperty(value = "目标库id") | ||||||
|  |     @NotNull(message = "目标库id不能为空") | ||||||
|  |     private String libraryId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "人脸相关信息") | ||||||
|  |     private List<ImageVO> faces; | ||||||
|  | } | ||||||
| @ -0,0 +1,50 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.position.PositionVO; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ImageReturnVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/3 18:28 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "用于图片入库返回参数", description = "用于图片入库返回参数") | ||||||
|  | public class ImageReturnVO { | ||||||
|  |     @ApiModelProperty(value = "成功的人脸id") | ||||||
|  |     private String faceId; | ||||||
|  |     @ApiModelProperty(value = "人脸库id") | ||||||
|  |     private String libraryId; | ||||||
|  |     @ApiModelProperty(value = "人脸id") | ||||||
|  |     private String idFaceid; | ||||||
|  |     @ApiModelProperty(value = "人脸坐标") | ||||||
|  |     private PositionVO faceRect; | ||||||
|  |     @ApiModelProperty(value = "传递的人脸信息") | ||||||
|  |     private ImagesVO face; | ||||||
|  | 
 | ||||||
|  |     public ImageReturnVO(String faceId, String libraryId,String idFaceid, PositionVO faceRect, ImagesVO face) | ||||||
|  |     { | ||||||
|  |         this.faceId=faceId; | ||||||
|  |         this.libraryId=libraryId; | ||||||
|  |         this.idFaceid=idFaceid; | ||||||
|  |         this.faceRect=faceRect; | ||||||
|  |         this.face=face; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "批量导入是否导入成功") | ||||||
|  |     private Boolean isSuccess; | ||||||
|  | } | ||||||
| @ -0,0 +1,50 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.NotBlank; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ImagesVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/3 15:14 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "用于图片入库接口", description = "用于图片入库接口") | ||||||
|  | public class ImageVO { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "需要入库的人脸地址") | ||||||
|  |     @NotBlank(message = "人脸图片地址不能为空") | ||||||
|  |     private String url; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "身份证id可空") | ||||||
|  |     private String idCard; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "性别可空") | ||||||
|  |     private String gender; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "姓名") | ||||||
|  |     private String name; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "名族") | ||||||
|  |     private String nation; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "特征信息") | ||||||
|  |     private String feature; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "额外信息") | ||||||
|  |     private String extraMeta; | ||||||
|  | } | ||||||
| @ -0,0 +1,65 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonFormat; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import javax.validation.constraints.NotBlank; | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: ImagesVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/3 15:14 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value = "用于图片入库接口", description = "用于图片入库接口") | ||||||
|  | public class ImagesVO { | ||||||
|  |     @ApiModelProperty(value = "目标库id") | ||||||
|  |     @NotBlank(message = "目标库id不能为空") | ||||||
|  |     private String libraryId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "需要入库的人脸地址") | ||||||
|  |     @NotBlank(message = "人脸图片地址不能为空") | ||||||
|  |     private String url; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "人脸id") | ||||||
|  |     private String faceId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "身份证id可空") | ||||||
|  |     private String idCard; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "性别可空") | ||||||
|  |     private String gender; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "姓名") | ||||||
|  |     private String name; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "名族") | ||||||
|  |     private String nation; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "特征信息") | ||||||
|  |     private String feature; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "额外信息") | ||||||
|  |     private String extraMeta; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "入库后人脸的URL") | ||||||
|  |     private String faceUrl; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "创建时间") | ||||||
|  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||||
|  |     private Date createTime; | ||||||
|  | } | ||||||
| @ -0,0 +1,31 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: PagePortraitVO | ||||||
|  |  * @Package com.dkha.api.modules.vo | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/5 10:06 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="人脸列表参数接收类", description="人脸列表参数接收类") | ||||||
|  | public class PagePortraitVO { | ||||||
|  |     private String libraryId; | ||||||
|  |     /**摄像头类型*/ | ||||||
|  |     private String type; | ||||||
|  |     /**库名称*/ | ||||||
|  |     private String factoryName; | ||||||
|  |     private PageVO page; | ||||||
|  | } | ||||||
| @ -0,0 +1,44 @@ | |||||||
|  | package com.dkha.common.modules.vo.face; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: TODO(please write your description) | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: PageVO | ||||||
|  |  * @Package com.dkha.api.modules | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/12/5 10:13 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="用于列表查询后续的分页", description="用于列表查询后续的分页") | ||||||
|  | public class PageVO { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "排序 默认按时间DESC  ASC") | ||||||
|  |     private String order="DESC"; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "开始时间戳") | ||||||
|  |     private Long startTimestamp; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "结束时间戳") | ||||||
|  |     private Long stopTimestamp; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "当前页") | ||||||
|  |     private Integer pageNo=1; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "每页条数") | ||||||
|  |     private Integer pageSize=10; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "总数") | ||||||
|  |     private Long total; | ||||||
|  | } | ||||||
| @ -0,0 +1,33 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: 比中返回结果 | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: CompareList | ||||||
|  |  * @Package com.dkha.common.entity.vo.facelib | ||||||
|  |  * @author: panhui | ||||||
|  |  * @date: 2019/11/27 15:20 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="比中结果通用", description="用于和底层传输统一参数格式") | ||||||
|  | public class CompareListVO { | ||||||
|  |     @ApiModelProperty(value = "比中库里面的人脸id") | ||||||
|  |     private String comparisonFaceId; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "库id") | ||||||
|  |     private String libId; | ||||||
|  |     @ApiModelProperty(value = "比分") | ||||||
|  |     private Double score; | ||||||
|  | } | ||||||
| @ -0,0 +1,21 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/12/11 16:32 | ||||||
|  |  * @Description 分组请求vo | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class CompareRequestVo { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "需要分组的url集合") | ||||||
|  |     private List<String> urlList; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "阀值") | ||||||
|  |     private Double minScore; | ||||||
|  | } | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/12/11 16:23 | ||||||
|  |  * @Description 分组比对结果详情 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class CompareResultDetailVo { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "图片url") | ||||||
|  |     private String url; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "相似度") | ||||||
|  |     private double score; | ||||||
|  | } | ||||||
| @ -0,0 +1,22 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/12/11 16:18 | ||||||
|  |  * @Description 人脸分组结果集,子项 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class CompareResultSubVo { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "结果url--随机获取其中一个") | ||||||
|  |     private String resultUrl; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "除结果url后,其余的url集合") | ||||||
|  |     private List<CompareResultDetailVo> compareResultSubVoList = new ArrayList<>(); | ||||||
|  | } | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @Author Spring | ||||||
|  |  * @Since 2019/12/11 16:17 | ||||||
|  |  * @Description 比较结果集合 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class CompareResultVo { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "分组比对返回结果集") | ||||||
|  |     private List<CompareResultSubVo> compareResultSubVoList = new ArrayList<>(); | ||||||
|  | } | ||||||
| @ -0,0 +1,32 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: 人脸删除请求 | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: FaceDeleteVO | ||||||
|  |  * @Package com.dkha.common.entity.vo.facelib | ||||||
|  |  * @author: yangjun | ||||||
|  |  * @date: 2019/11/27 11:16 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="人脸删除通用接口请求参数类", description="用于和底层传输统一参数格式") | ||||||
|  | public class FaceDeleteVO { | ||||||
|  |     @ApiModelProperty(value = "库id") | ||||||
|  |     private String libId; | ||||||
|  |     @ApiModelProperty(value = "人脸id") | ||||||
|  |     private List<String> faceIds; | ||||||
|  | } | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import com.dkha.common.modules.vo.position.FaceVO; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: 人脸入库返回 | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: FaceLibaryReturnVO | ||||||
|  |  * @Package com.dkha.common.entity.vo.facelib | ||||||
|  |  * @author: yangjun | ||||||
|  |  * @date: 2019/11/27 10:15 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="人脸入库通用接口返回参数类", description="用于和底层传输统一参数格式") | ||||||
|  | public class FaceLibaryReturnVO { | ||||||
|  |     @ApiModelProperty(value = "人脸相关信息") | ||||||
|  |     private List<FaceVO> faces; | ||||||
|  |     @ApiModelProperty(value = "库id") | ||||||
|  |     private String libId; | ||||||
|  | } | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonInclude; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.NoArgsConstructor; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @version V1.0 | ||||||
|  |  * @Description: 人脸入库请求 | ||||||
|  |  * All rights 成都电科慧安 | ||||||
|  |  * @Title: FaceLibaryVO | ||||||
|  |  * @Package com.dkha.common.entity.vo.facelib | ||||||
|  |  * @author: yangjun | ||||||
|  |  * @date: 2019/11/27 10:03 | ||||||
|  |  * @Copyright: 成都电科慧安 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @AllArgsConstructor | ||||||
|  | @NoArgsConstructor | ||||||
|  | @JsonInclude(JsonInclude.Include.NON_NULL) | ||||||
|  | @ApiModel(value="人脸入库通用接口请求参数类", description="用于和底层传输统一参数格式") | ||||||
|  | public class FaceLibaryVO { | ||||||
|  |     @ApiModelProperty(value = "库id") | ||||||
|  |     private String libId; | ||||||
|  |     @ApiModelProperty(value = "图片url") | ||||||
|  |     private List<String> imgs; | ||||||
|  |     @ApiModelProperty(value = "人员信息") | ||||||
|  |     private PersonalInformationVO personalInformation; | ||||||
|  | } | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | package com.dkha.common.modules.vo.facelib; | ||||||
|  | 
 | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class FileImageVo { | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "url") | ||||||
|  |     private String  url; | ||||||
|  | 
 | ||||||
|  |     @ApiModelProperty(value = "url") | ||||||
|  |     private List<String> urls; | ||||||
|  | } | ||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user