Commit 1d4b5c8c by 陈皓

init

parent f37eb400
......@@ -11,10 +11,10 @@ spring:
check-template-location: false
redis:
# 数据库索引
database: 0
database: 7
host: ${redis.url}
port: ${redis.port}
password:
password: ${redis.password}
# 连接超时时间
timeout: 5000
datasource:
......
#Redis配置
redis.url: 127.0.0.1
redis.port: 6379
redis.password:
redis.password: Gxfy2022!@#$
#数据库源配置
db:
cloud:
username: root
password: Dk2019!23456
username: ymts1
password: gxfy123456
driver-class-name: com.mysql.cj.jdbc.Driver
url:
cloud: jdbc:mysql://47.107.148.253:3306/cloud?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
cloud: jdbc:mysql://147.1.3.70:3306/image?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
#jwt
jwt:
......
#Redis配置
redis.url: 127.0.0.1
redis.port: 6379
redis.password:
#数据库源配置
db:
cloud:
username: root
password: Dk2019!23456
driver-class-name: com.mysql.cj.jdbc.Driver
url:
cloud: jdbc:mysql://47.107.148.253:3306/cloud?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
#jwt
jwt:
header: Authorization
# 令牌前缀
token-start-with: Bearer
# 必须使用最少88位的Base64对该令牌进行编码
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
# 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
token-validity-in-seconds: 7200000
# 在线用户key
online-key: online-token-
# 验证码
code-key: code-key-
# token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
detect: 1800000
# 续期时间范围,默认 1小时,这里单位毫秒
renew: 3600000
#线程池配置
task:
pool:
# 是否启用线程池
enable: true
# 核心线程池大小
core-pool-size: 5
# 最大线程数
max-pool-size: 15
# 队列容量
queue-capacity: 20
# 活跃时间
keep-alive-seconds: 30
#!/bin/bash
JAVAHOME=$JAVA_HOME
echo "--------start--------"
PID=$(ps -ef|grep api-server-1.0.0.jar |grep -v grep|awk '{print $2}')
if [ ! $PID ]; then
nohup java -jar -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -Xms512m -Xmn768m -Xmx1024m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC api-server-1.0.0.jar --spring.profiles.active=product --server.port=8100 > api.log 2>&1 &
echo "--------------start success-----------"
exit
else
kill -9 ${PID}
echo "--------------kill success-----------"
echo "---------------now wait start-------"
nohup java -jar -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -Xms512m -Xmn768m -Xmx1024m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC api-server-1.0.0.jar --spring.profiles.active=product --server.port=8100 > api.log 2>&1 &
echo "--------------start success-----------"
exit
fi
#!/bin/bash
JAVAHOME=$JAVA_HOME
echo "--------start--------"
PID=$(ps -ef|grep sys-server-1.0.0.jar |grep -v grep|awk '{print $2}')
if [ ! $PID ]; then
nohup java -jar -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -Xms512m -Xmn768m -Xmx1024m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC sys-server-1.0.0.jar --spring.profiles.active=product --server.port=8666 > sys.log 2>&1 &
echo "--------------start success-----------"
exit
else
kill -9 ${PID}
echo "--------------kill success-----------"
echo "---------------now wait start-------"
nohup java -jar -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -Xms512m -Xmn768m -Xmx1024m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC sys-server-1.0.0.jar --spring.profiles.active=product --server.port=8666 > sys.log 2>&1 &
echo "--------------start success-----------"
exit
fi
#!/bin/bash
JAVAHOME=$JAVA_HOME
echo "--------start--------"
PID=$(ps -ef|grep user-server-1.0.0.jar |grep -v grep|awk '{print $2}')
if [ ! $PID ]; then
nohup java -jar -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -Xms512m -Xmn768m -Xmx1024m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC user-server-1.0.0.jar --spring.profiles.active=product --server.port=8700 > user.log 2>&1 &
echo "--------------start success-----------"
exit
else
kill -9 ${PID}
echo "--------------kill success-----------"
echo "---------------now wait start-------"
nohup java -jar -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -Xms512m -Xmn768m -Xmx1024m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC user-server-1.0.0.jar --spring.profiles.active=product --server.port=8700 > user.log 2>&1 &
echo "--------------start success-----------"
exit
fi
......@@ -17,6 +17,7 @@ import com.zq.imgproc.dao.ImgSettingDao;
import com.zq.imgproc.entity.ImageBatch;
import com.zq.imgproc.entity.ImageDetection;
import com.zq.imgproc.entity.ImgSetting;
import com.zq.imgproc.utils.BendUtil;
import com.zq.imgproc.utils.DecompressUtil;
import com.zq.imgproc.utils.Deskew;
import com.zq.imgproc.utils.ImageUtil;
......@@ -134,8 +135,8 @@ public class ImageDetectionService {
// 检测图片的黑边
detection.setBlack(ImageUtil.blackDetection2(src));
// 图片弯曲检测
// BendResult bendResult = BendUtil.getBendResult(img.getUrl());
// detection.setBend(bendResult.getConfidence());
BendResult bendResult = BendUtil.getBendResult(img.getUrl());
detection.setBend(bendResult.getConfidence());
detection.setBend(0.0);
// 检查是否合格
detection.setQualified(check(detection, imgSetting));
......
......@@ -64,7 +64,7 @@ public class DecompressUtil {
public static String decompress7z(MultipartFile file) throws IOException {
// 文件路径要素
String yyyyMMdd = new SimpleDateFormat("/yyyyMM/dd/").format(new Date());
String filePath = "/file/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + "/";
String filePath = "/data/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + "/";
// 解压文件
InputStream inputStream = file.getInputStream();
Extractor extractor = CompressUtil.createExtractor(CharsetUtil.defaultCharset(),
......@@ -84,7 +84,7 @@ public class DecompressUtil {
*/
public static String decompressZip(MultipartFile file) throws IOException {
String yyyyMMdd = new SimpleDateFormat("/yyyyMM/dd/").format(new Date());
String filePath = "/file/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + "/";
String filePath = "/data/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + "/";
ZipUtil.unzip(file.getInputStream(), FileUtil.file(filePath), Charset.forName("GBK"));
filePath = filePath + "/";
return filePath;
......@@ -98,7 +98,7 @@ public class DecompressUtil {
*/
public static String compress(List<ImgVO> list) {
String yyyyMMdd = new SimpleDateFormat("/yyyyMM/dd/").format(new Date());
String savePath = "/file/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + "/";
String savePath = "/data/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + "/";
for (ImgVO img : list) {
// 网上的文件需要下载
if (img.getUrl().startsWith("http://ddns.gxmailu.com:18888")) {
......@@ -107,7 +107,7 @@ public class DecompressUtil {
FileUtil.copyFile(img.getUrl(), savePath + img.getFileName(), StandardCopyOption.COPY_ATTRIBUTES);
}
}
String filePath = "/file/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + ".zip";
String filePath = "/data/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + ".zip";
ZipUtil.zip(savePath, filePath, false);
FileUtil.del(savePath);
return filePath;
......@@ -124,7 +124,7 @@ public class DecompressUtil {
List<ImgVO> resList = new ArrayList<>();
List<File> fileList = FileUtil.loopFiles(path);
String yyyyMMdd = new SimpleDateFormat("/yyyyMM/dd/").format(new Date());
String savePath = "/file/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + "/";
String savePath = "/data/temp" + yyyyMMdd + UuidUtils.uuidNoDash() + "/";
int index = 1;
for (File file : fileList) {
String ext = FileUtil.extName(file);
......
......@@ -4,8 +4,8 @@ server:
spring:
servlet:
multipart:
max-file-size: 6MB
max-request-size: -1
max-file-size: 100MB
max-request-size: 500MB
application:
name: IMGPROC-SERVER
jackson:
......@@ -15,10 +15,10 @@ spring:
check-template-location: false
redis:
# 数据库索引
database: 0
database: 7
host: ${redis.url}
port: ${redis.port}
password:
password: ${redis.password}
# 连接超时时间
timeout: 5000
datasource:
......@@ -87,12 +87,12 @@ ip:
# deskew: /opt/services/tianjin-backend/lib/Deskew/Bin/deskew
# deskewpy: /opt/services/tianjin-backend/lib/correct.py
#imgconfig:
# opencv: /opt/tianjin/lib/opencv_java460.so
# deskew: /opt/tianjin/lib/Deskew/Bin/deskew
# deskewpy: /opt/tianjin/lib/correct.py
imgconfig:
opencv: D:/project/image-backend/config/lib/opencv_java460.dll
deskew: C:/Users/11419/Desktop/Deskew/Bin/deskew.exe
deskewpy: D:/project/imgproc/lib/correct.py
opencv: /opt/tianjin/lib/opencv_java460.so
deskew: /opt/tianjin/lib/Deskew/Bin/deskew
deskewpy: /opt/tianjin/lib/correct.py
#imgconfig:
# opencv: D:/project/image-backend/config/lib/opencv_java460.dll
# deskew: C:/Users/11419/Desktop/Deskew/Bin/deskew.exe
# deskewpy: D:/project/imgproc/lib/correct.py
......@@ -100,21 +100,12 @@
</activation>
</profile>
<profile>
<!--测试环境-->
<id>test</id>
<properties>
<profiles.active>test</profiles.active>
<logging.level>debug</logging.level>
<register.url>http://admin:123456@127.0.0.1:8800/eureka/</register.url>
</properties>
</profile>
<profile>
<!--生产环境-->
<id>product</id>
<properties>
<profiles.active>product</profiles.active>
<logging.level>info</logging.level>
<register.url>http://admin:123456@127.0.0.1:8800/eureka/</register.url>
<register.url>http://admin:GXfy2022@127.0.0.1:8800/eureka/</register.url>
</properties>
</profile>
</profiles>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment