first commit

master
GoblinsWang 2023-03-23 11:26:57 +08:00
commit f8dfb4f52d
525 changed files with 56959 additions and 0 deletions

35
.gitignore vendored Normal file
View 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
View File

@ -0,0 +1,9 @@
# 不不不不v
```
mvn install
```
#的点点滴滴
```
mvn clean
```

9554
doc/face.PDM Normal file

File diff suppressed because it is too large Load Diff

9530
doc/face.pdb Normal file

File diff suppressed because it is too large Load Diff

View 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
View 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
View 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
View 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>

View File

@ -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);
}
}

View File

@ -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 consulKVKeyprefix便
* @param
*/
protected BaseLock(ConsulClient consulClient, String sessionName, String lockKey) {
this.consulClient = consulClient;
this.keyPath = lockKey;
this.sessionName=sessionName;
}
/**
* @param consulClient
* @param lockKey consulKVKeyprefix便
* @param checkTtl SessionTTL
*/
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();
}
/**
* sessionIdsession
*/
protected void destroySession() {
if (sessionId != null) {
consulClient.sessionDestroy(sessionId, null);
sessionId = null;
}
}
}

View File

@ -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();
}
}
}
}

View 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 consulKVKeyprefix便
*/
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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View 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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View 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;
}
}

View File

@ -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;
}
}

View File

@ -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() {
}
}

View File

@ -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() {
}
}

View File

@ -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;
}
}

View File

@ -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() {
}
}

View File

@ -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];
}
/**
* miniourl
*
* @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("-", ""));
}
}

View File

@ -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();
}
}

View 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;
}
}

View File

@ -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;
}
}

View 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;
/**
* tokenhttptokentokentoken
*
* @Author: Spring
* Created on 2018/4/23.
*/
public class JwtHelper {
private static final Logger logger = LoggerFactory.getLogger(JwtHelper.class);
/**
* HS256 hashRS256 https://www.cnblogs.com/hehheai/p/6513871.html
*/
private static final String secret = "dk_employment_2019.10.12";
/**
* JWTidexpiresTime
*
*
* iss(Issuser)claima.comclaima.com
* sub(Subject)claimliuyunzhugeclaimliuyunzhuge
* aud(Audience)claim['b.com','c.com']claimb.comc.com
* exp(Expiration time)claim
* nbf(Not Before)claim
* iat(Issued at)maxAgeclaimmaxAge
* jti(JWT ID)claim1claim1
*
* @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");
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
/**
* code200
*/
public ReturnVO successResult(Object data) {
ReturnVO ReturnVO = new ReturnVO();
ReturnVO.code = ErrEnum.OK.getCode();
ReturnVO.data = data;
ReturnVO.message = ErrEnum.OK.getMsg();
return ReturnVO;
}
/**
* code200
* @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());
}
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 = "人脸库11比对返回", description = "人脸检索")
public class ApiFaceOneSearchFaceVO {
private PositionVO faceRect;
private String url;
}

View File

@ -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 = "人脸库11比对返回", description = "人脸检索")
public class ApiFaceOneSearchReturnFaceVO {
private Double hitSimilarity;
private List<ApiFaceOneSearchFaceVO> faces;
private String extraMeta;
}

View File

@ -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;//命中的相似度
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 ;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<>();
}

View File

@ -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<>();
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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