Commit da6dec3a by 谢明辉

<feature><阿里云上传>

0 parents
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.vion</groupId>
<artifactId>ossupdate</artifactId>
<version>1.0.RELEASE</version>
<packaging>jar</packaging>
<name>ossupdate</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.8.3</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>application-*.properties</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.vion;
import com.vion.configuration.OssConfigration;
import com.vion.dao.IDao;
import com.vion.entity.OssClientEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@ComponentScan(value = "com.vion")
@SpringBootApplication
@Slf4j
public class Application implements CommandLineRunner {
public static final String PICTURE = "picture/";
public static final String FEATURE = "feature/";
public static final String POSTFIX = ".feature";
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Autowired
private IDao dao;
@Resource
private OssClientEntity ossClientEntity;
@Value("${path.picture}")
private String facePath;
@Value("${path.feature}")
private String featurePath;
@Value("${date.begin}")
private String begin;
@Value("${date.end}")
private String end;
@Override
public void run(String... args) throws Exception {
/*下载文件*/
// OssFileUtil ossFileUtil = new OssFileUtil();
// ObjectListing objectListing = ossFileUtil.getFilesInPrefix(ossClientEntity.getBucket(), "picture/face/20180808/", ossClientEntity.getOssClient(), 1000, false);
// objectListing.getObjectSummaries().forEach(summery -> {
// String[] strings = summery.getKey().split("/");
// File file = new File("D:/picture/face/20180808/" + strings[3]);
// if (!file.exists()) {
// if (!file.mkdir()) {
// System.out.println("创建文件夹失败:" + file.getName());
// }
// }
// ossClientEntity.getOssClient().getObject(new GetObjectRequest(ossClientEntity.getBucket(), summery.getKey()), new File("D:\\" + summery.getKey().replace("\\", "/")));
// }
// );
//上传文件
// 建立线程池
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 100, 10, TimeUnit.MINUTES, new ArrayBlockingQueue<Runnable>(250), r -> {
Thread t = new Thread(r);
t.setName("线程" + OssConfigration.COUNT);
OssConfigration.COUNT++;
return t;
});
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
Date beginDate = format.parse(begin);
Date endDate = format.parse(end);
dao.getAll(beginDate, endDate, ossClientEntity, facePath, featurePath, threadPool);
}
}
package com.vion.configuration;
import com.vion.dao.IDao;
import com.vion.dao.MyFaceDao;
import com.vion.dao.PostFaceDao;
import com.vion.entity.OssClientEntity;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
/**
* @author 谢明辉
* @createDate 2018-10-30
* @description
*/
@Configuration
public class OssConfigration {
@Value("${oss.config.endPoint}")
private String endPoint;
@Value("${oss.config.accessKeyId}")
private String accessKeyId;
@Value("${oss.config.accessKeySecret}")
private String accessKeySecret;
@Value("${oss.config.bucket}")
private String bucket;
public static int COUNT = 0;
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public OssClientEntity ossClientEntity() {
OssClientEntity entity = new OssClientEntity();
entity.setKey(accessKeyId);
entity.setSecret(accessKeySecret);
entity.setEndPoint(endPoint);
entity.setBucket(bucket);
return entity;
}
@Bean("Dao")
@ConditionalOnProperty(name = "flag", havingValue = "mysql")
public IDao myFaceDao() {
return new MyFaceDao();
}
@Bean("Dao")
@ConditionalOnProperty(name = "flag", havingValue = "postgre")
public IDao postFaceDao() {
return new PostFaceDao();
}
}
package com.vion.dao;
import com.vion.entity.OssClientEntity;
import java.util.Date;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author 谢明辉
* @createDate 2018-11-12
* @description
*/
public interface IDao {
void getAll(Date beginDate, Date endDate, OssClientEntity ossClientEntity, String facePath, String featurePath, ThreadPoolExecutor threadPool);
}
package com.vion.dao;
import com.vion.entity.FaceEntity;
import com.vion.entity.OssClientEntity;
import com.vion.job.MyUpdateJob;
import com.vion.utils.FileUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author 谢明辉
* @createDate 2018-10-31
* @description
*/
@Slf4j
public class MyFaceDao implements IDao {
@Autowired
private JdbcTemplate jdbcTemplate;
public static long DAY = 3600L * 24L * 1000L;
public static final String FIND_ALL = "SELECT chanel_id,frr_arrival_face_picture1,frr_arrival_showbody_picture FROM r_face_recognition_record WHERE frr_count_date=?";
@Override
public void getAll(Date beginDate, Date endDate, OssClientEntity ossClientEntity, String facePath, String featurePath, ThreadPoolExecutor threadPool) {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
// 按天循环
for (long count = beginDate.getTime(); count <= endDate.getTime(); count += DAY) {
log.info(count + "================================================");
// 查询一天的数据
List<FaceEntity> list = jdbcTemplate.query(FIND_ALL, new Object[]{new Date(count)}, (r, i) -> {
FaceEntity entity = new FaceEntity();
entity.setBodyPic(r.getString("frr_arrival_showbody_picture"));
entity.setFacePic(r.getString("frr_arrival_face_picture1"));
entity.setChannelSerialNum(r.getString("chanel_id"));
return entity;
});
// 平均分成50份,每个线程执行其中的一份,共50个线程
List<List<FaceEntity>> lists = FileUtils.averageAssign(list, 50);
Integer pathDate = Integer.parseInt(format.format(new Date(count)));
lists.forEach(faceEntities -> threadPool.execute(new MyUpdateJob(faceEntities, ossClientEntity, pathDate, facePath, featurePath)));
// 等待线程池执行完成,执行下个循环
while (threadPool.getActiveCount() != 0) {
}
log.info("==============================={}结束=========================================", new Date(count));
System.gc();
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
package com.vion.dao;
import com.vion.entity.FaceEntity;
import com.vion.entity.OssClientEntity;
import com.vion.job.PostUpdateJob;
import com.vion.utils.FileUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @author 谢明辉
* @createDate 2018-10-31
* @description
*/
@Slf4j
public class PostFaceDao implements IDao {
public static long DAY = 3600L * 24L * 1000L;
public static final String FIND_ALL = "SELECT channel_serialnum,face_pic,body_pic FROM d_face_recognition WHERE countdate=?";
@Autowired
private JdbcTemplate jdbcTemplate;
@Override
public void getAll(Date beginDate, Date endDate, OssClientEntity ossClientEntity, String facePath, String featurePath, ThreadPoolExecutor threadPool) {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
// 按天循环
for (long count = beginDate.getTime(); count <= endDate.getTime(); count += DAY) {
log.info(count + "================================================");
// 查询一天的数据
List<FaceEntity> list = jdbcTemplate.query(FIND_ALL, new Object[]{new Date(count)}, (r, i) -> {
FaceEntity entity = new FaceEntity();
entity.setBodyPic(r.getString("body_pic"));
entity.setFacePic(r.getString("face_pic"));
entity.setChannelSerialNum(r.getString("channel_serialnum"));
return entity;
});
// 平均分成50份,每个线程执行其中的一份,共50个线程
List<List<FaceEntity>> lists = FileUtils.averageAssign(list, 50);
Integer pathDate = Integer.parseInt(format.format(new Date(count)));
lists.forEach(faceEntities -> threadPool.execute(new PostUpdateJob(faceEntities, ossClientEntity, pathDate, facePath, featurePath)));
// 等待线程池执行完成,执行下个循环
while (threadPool.getActiveCount() != 0) {
}
log.info("==============================={}结束=========================================", new Date(count));
System.gc();
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
package com.vion.entity;
import lombok.Data;
import java.util.List;
/**
* @author 谢明辉
* @createDate 2018-10-31
* @description
*/
@Data
public class DataMap {
/**
* 日期对应的数字
* 例如2018-08-08对应20180808
*/
private Integer dateNumber;
/** 日期对应的数据 */
private List<FaceEntity> faceEntities;
}
package com.vion.entity;
import lombok.Data;
import java.util.Date;
/**
* @author 谢明辉
* @createDate 2018-10-30
* @description
*/
@Data
public class FaceEntity {
private Integer id;
private String channelSerialNum;
private String facePic;
private String bodyPic;
private Date countDate;
}
package com.vion.entity;
import com.aliyun.oss.OSSClient;
import lombok.Data;
/**
* @author 谢明辉
* @createDate 2018-10-30
* @description
*/
@Data
public class OssClientEntity {
private String secret;
private String endPoint;
private String bucket;
private String key;
/** 构建ossClient单例 */
private static volatile OSSClient ossClient;
/**
* @return com.aliyun.oss.OSSClient
* @createDate 2018-11-8
* @description 获取ossClient实例
*/
public OSSClient getOssClient() {
if (ossClient == null) {
synchronized (OssClientEntity.class) {
if (ossClient == null) {
ossClient = new OSSClient(endPoint, key, secret);
}
}
}
return ossClient;
}
}
package com.vion.job;
import com.vion.entity.FaceEntity;
import com.vion.entity.OssClientEntity;
import com.vion.utils.FileUtils;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.util.List;
import static com.vion.Application.PICTURE;
/**
* @author 谢明辉
* @createDate 2018-10-30
* @description
*/
@Slf4j
public class MyUpdateJob implements Runnable {
private List<FaceEntity> faces;
private OssClientEntity ossClientEntity;
private Integer dateNumber;
private String facePath;
private String featurePath;
public MyUpdateJob(List<FaceEntity> face, OssClientEntity entity, Integer dateNumber, String facePath, String featurePath) {
this.ossClientEntity = entity;
this.faces = face;
this.dateNumber = dateNumber;
this.facePath = facePath;
this.featurePath = featurePath;
}
@Override
public void run() {
faces.forEach(face -> {
String md5 = "";
String md6 = "";
File pic;
try {
// 1.数据库中存在face则去找对应face图片,如果图片不存在,则在数据库找body,如果body存在则去找对应body图片,如果图片不存在则执行完成。
// 2.数据库中不存在face则去找body,如果body存在则去找对应body图片,图片不存在则执行完成
// 3.数据库不存在face,不存在body,执行完成
if (FileUtils.isNotNull(face.getFacePic())) {
pic = new File(FileUtils.getPathName(facePath, dateNumber, null, face.getFacePic(), false));
if (pic.exists()) {
md5 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getFacePic(), PICTURE, null, face.getChannelSerialNum()), pic).getETag();
} else if (FileUtils.isNotNull(face.getBodyPic())) {
pic = new File(FileUtils.getPathName(facePath, dateNumber, null, face.getBodyPic(), false));
if (pic.exists()) {
md5 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getBodyPic(), PICTURE, null, face.getChannelSerialNum()), pic).getETag();
}
}
} else if (FileUtils.isNotNull(face.getBodyPic())) {
pic = new File(FileUtils.getPathName(facePath, dateNumber, null, face.getBodyPic(), false));
if (pic.exists()) {
md5 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getBodyPic(), PICTURE, null, face.getChannelSerialNum()), pic).getETag();
}
}
pic = null;
if (!FileUtils.isNotNull(md5)) {
if (FileUtils.isNotNull(face.getFacePic())) {
log.info("找不到文件,picture:{}", face.getFacePic());
} else if (FileUtils.isNotNull(face.getBodyPic())) {
log.info("找不到文件,picture:{}", face.getBodyPic());
}
}
} catch (Exception e) {
log.error("上传出错" + face.getFacePic());
pic = null;
e.printStackTrace();
}
});
log.info("+++++++++++++++++++++++++++++上传完成++++++++++++++++++++++++");
}
}
package com.vion.job;
import com.vion.entity.FaceEntity;
import com.vion.entity.OssClientEntity;
import com.vion.utils.FileUtils;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.util.List;
import static com.vion.Application.*;
/**
* @author 谢明辉
* @createDate 2018-10-30
* @description 一个线程的job
*/
@Slf4j
public class PostUpdateJob implements Runnable {
private List<FaceEntity> faces;
private OssClientEntity ossClientEntity;
private Integer dateNumber;
private String facePath;
private String featurePath;
public PostUpdateJob(List<FaceEntity> face, OssClientEntity entity, Integer dateNumber, String facePath, String featurePath) {
this.ossClientEntity = entity;
this.faces = face;
this.dateNumber = dateNumber;
this.facePath = facePath;
this.featurePath = featurePath;
}
@Override
public void run() {
faces.forEach(face -> {
String md5 = "";
String md6 = "";
File pic;
File feature;
try {
if (FileUtils.isNotNull(face.getFacePic())) {
pic = new File(FileUtils.getPathName(facePath, dateNumber, face.getChannelSerialNum(), face.getFacePic(), false));
feature = new File(FileUtils.getPathName(featurePath, dateNumber, face.getChannelSerialNum(), face.getFacePic(), true));
if (pic.exists()) {
md5 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getFacePic(), PICTURE, null, face.getChannelSerialNum()), pic).getETag();
} else if (FileUtils.isNotNull(face.getBodyPic())) {
pic = new File(FileUtils.getPathName(facePath, dateNumber, face.getChannelSerialNum(), face.getBodyPic(), false));
if (pic.exists()) {
md5 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getBodyPic(), PICTURE, null, face.getChannelSerialNum()), pic).getETag();
}
}
if (feature.exists()) {
md6 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getFacePic(), FEATURE, POSTFIX, face.getChannelSerialNum()), feature).getETag();
} else if (FileUtils.isNotNull(face.getBodyPic())) {
feature = new File(FileUtils.getPathName(facePath, dateNumber, face.getChannelSerialNum(), face.getBodyPic(), true));
if (feature.exists()) {
md6 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getBodyPic(), FEATURE, POSTFIX, face.getChannelSerialNum()), feature).getETag();
}
}
} else if (FileUtils.isNotNull(face.getBodyPic())) {
pic = new File(FileUtils.getPathName(facePath, dateNumber, face.getChannelSerialNum(), face.getBodyPic(), false));
feature = new File(FileUtils.getPathName(featurePath, dateNumber, face.getChannelSerialNum(), face.getBodyPic(), true));
if (pic.exists()) {
md5 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getBodyPic(), PICTURE, null, face.getChannelSerialNum()), pic).getETag();
}
if (feature.exists()) {
md6 = ossClientEntity.getOssClient().putObject(ossClientEntity.getBucket(), FileUtils.generator(face.getBodyPic(), FEATURE, POSTFIX, face.getChannelSerialNum()), feature).getETag();
}
}
pic = null;
feature = null;
if (FileUtils.isNotNull(md5)) {
log.info("上传成功,picture:{}", md5);
} else {
log.info("找不到文件,picture:{}", face.getFacePic());
}
if (FileUtils.isNotNull(md6)) {
System.out.println();
log.info("上传成功,feature:{}", md6);
} else {
System.out.println();
log.info("找不到文件,feature:{}", face.getFacePic() + ".feature");
}
} catch (Exception e) {
log.error("上传出错" + face.getFacePic());
pic = null;
feature = null;
e.printStackTrace();
}
});
log.info("+++++++++++++++++++++++++++++上传完成++++++++++++++++++++++++");
}
}
package com.vion.utils;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
/**
* @author 谢明辉
* @createDate 2018-10-30
* @description
*/
public class FileUtils {
public static Pattern pattern = Pattern.compile("[0-9]{8}");
public static void getFiles(List<File> fileList, String basePath, Integer begin, Integer end) {
File file = new File(basePath);
if (!file.exists()) {
System.out.println(basePath + " 不存在");
return;
}
File[] files = file.listFiles();
if (files != null) {
for (File file1 : files) {
if (file1.isDirectory()) {
if (file1.getName().matches("[0-9]{8}")) {
if (Integer.parseInt(file1.getName()) >= begin && Integer.parseInt(file1.getName()) <= end) {
getFiles(fileList, getAvailablePath(file1), begin, end);
}
} else {
getFiles(fileList, getAvailablePath(file1), begin, end);
}
} else {
if (file1.getName().contains("face-0") || file1.getName().contains("body-0")) {
fileList.add(file1);
}
}
}
}
}
private static String getAvailablePath(File file) {
return file.getPath().replace("//", "/");
}
public static String generator(String name, String pathPrefix, String pathPostfix, String channelSerialNum) {
StringBuilder result = new StringBuilder();
if (pathPrefix != null) {
result.append(pathPrefix);
}
if (pathPostfix != null) {
if (name.endsWith(pathPostfix)) {
name = name.substring(0, name.lastIndexOf(pathPostfix));
}
}
if (name.contains("face")) {
result.append("face").append("/");
} else if (name.contains("body")) {
result.append("body").append("/");
}
if (name.length() > 25) {
String dateStr = name.substring(name.length() - 25, name.length() - 17);
result.append(dateStr).append("/");
}
result.append(channelSerialNum).append("/").append(name);
if (pathPostfix != null) {
result.append(pathPostfix);
}
return result.toString();
}
public static <T> List<List<T>> averageAssign(List<T> source, int n) {
List<List<T>> result = new ArrayList<List<T>>();
//余数
int remainder = source.size() % n;
//商
int number = source.size() / n;
//偏移量
int offset = 0;
for (int i = 0; i < n; i++) {
List<T> value = null;
if (remainder > 0) {
value = source.subList(i * number + offset, (i + 1) * number + offset + 1);
remainder--;
offset++;
} else {
value = source.subList(i * number + offset, (i + 1) * number + offset);
}
result.add(value);
}
return result;
}
public static boolean isNotNull(String s) {
return !(s == null || "".equals(s));
}
public static String getPathName(String basePath, Integer dateNumber, String channelSerialNum, String fileName, boolean isFeature) {
StringBuilder sb = new StringBuilder();
sb.append(basePath).append(dateNumber).append("\\");
if (isNotNull(channelSerialNum)) {
sb.append(channelSerialNum).append("\\");
}
sb.append(fileName);
if (isFeature) {
sb.append(".feature");
}
return sb.toString();
}
}
package com.vion.utils;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.model.ListObjectsRequest;
import com.aliyun.oss.model.ObjectListing;
/**
* @author 谢明辉
* @createDate 2018-11-6
* @description
*/
public class OssFileUtil {
/**
* @param prefix 路径前缀,例如,picture/face/20181010
* @param bucketName bucketName
* @param maxKeys 列出的最大文件数量,如果为null,默认100,最大为1000
* @param delimiter 是否使用分割符
* @param ossClient ossClient实例
* @return com.aliyun.oss.model.ObjectListing
* @createDate 2018-11-6
* @description 列举指定目录下的所有文件
*/
public ObjectListing getFilesInPrefix(String bucketName, String prefix, OSSClient ossClient, Integer maxKeys, boolean delimiter) {
ListObjectsRequest listObjectsRequest = new ListObjectsRequest(bucketName);
if (maxKeys != null) {
maxKeys = maxKeys > 1000 ? 1000 : (maxKeys < 1 ? 1 : maxKeys);
listObjectsRequest.setMaxKeys(maxKeys);
}
if (delimiter) {
listObjectsRequest.setDelimiter("/");
}
listObjectsRequest.setPrefix(prefix);
return ossClient.listObjects(listObjectsRequest);
}
}
oss.config.bucket=vion-retail
oss.config.endPoint=oss-cn-beijing.aliyuncs.com
oss.config.accessKeyId=LTAI9WfUr3GDne4c
oss.config.accessKeySecret=SDzMs26kNyiDIIRJIY2qUBxBOeUEZ8
#######################Face root directory#######################
path.picture=D:\\face\\s
##################Feature root directory######################
path.feature=D:\\feature\\
#########################the application will upload the data in [beginDate,endDate]
#########################begin date######################
date.begin=20180825
#########################end date###################
date.end=20180825
########################Path format\uFF1Aface/date/channel_serialNum, Database connection using postgreSql,flag = postgre
#spring.datasource.driver-class-name=org.postgresql.Driver
#spring.datasource.url=jdbc:postgresql://192.168.9.221:5432/shoppingMall_snapshot
#spring.datasource.username=postgres
#spring.datasource.password=vion
#flag=postgre
########################Path format\uFF1Aface/date/channel_serialNum ,Database connection using mysql flag=mysql
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc\:mysql\://47.94.47.137\:3306/vioncountcloud?useUnicode\=true&characterEncoding\=UTF-8
spring.datasource.username=root
spring.datasource.password=IH5c3t0di14Ay7y5
flag=mysql
server.port=8888
\ No newline at end of file \ No newline at end of file
debug=false
spring.profiles.active=pro
logging.config=classpath:logback.xml
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="true" scanPeriod="1 seconds">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logs\\%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>
<logger name="com.vion.*" level="debug"/>
</configuration>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!