优化代码

This commit is contained in:
DESKTOP-G8BCEP0\HP 2021-07-30 17:41:02 +08:00
parent fd100a5785
commit 5ea7f0263e
6 changed files with 11 additions and 29 deletions

View File

@ -71,11 +71,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId> <artifactId>spring-boot-starter-webflux</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>

View File

@ -86,7 +86,7 @@ public class FirePointServiceImpl implements FirePointService {
firePointEntity.setAddTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); firePointEntity.setAddTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()));
firePointEntity.setFireType("0"); firePointEntity.setFireType("0");
log.info("-------发现新火点"); log.info("-------发现新火点");
log.info("---------------开始进行实时通讯,将检测到的火点传给前端"); /*log.info("---------------开始进行实时通讯,将检测到的火点传给前端");
Map map = new HashMap(3); Map map = new HashMap(3);
map.put("countyCode",firePointQo.getCountyCode()); map.put("countyCode",firePointQo.getCountyCode());
map.put("countyName",firePointQo.getCountyName()); map.put("countyName",firePointQo.getCountyName());
@ -101,7 +101,7 @@ public class FirePointServiceImpl implements FirePointService {
map1.put("fire",map); map1.put("fire",map);
String websocket = JSON.toJSONString(map1); String websocket = JSON.toJSONString(map1);
// 将监测到的火点信息返给前端 // 将监测到的火点信息返给前端
WebSocketServer.broadInfo(websocket); WebSocketServer.broadInfo(websocket);*/
return firePointDao.save(firePointEntity); return firePointDao.save(firePointEntity);
} }

View File

@ -79,14 +79,14 @@ public class PhotoUtil {
//uuid生成新的文件名 //uuid生成新的文件名
newName = UUID.randomUUID().toString() + suffix; newName = UUID.randomUUID().toString() + suffix;
//将图片保存到本地/usr/etc/images/Folder //将图片保存到本地/usr/etc/images/Folder
//File file1 = new File("/home/web/wf-fire-service/forestTaskImage/"); File file1 = new File("/home/sxy/image/firePointImage/");
File file1 = new File("E:/file/work/image/"); //File file1 = new File("E:/file/work/image/");
if (!file1.exists()) { if (!file1.exists()) {
file1.mkdirs(); file1.mkdirs();
} }
//String path = "/home/web/wf-fire-service/forestTaskImage/" + newName; String path = "/home/sxy/image/firePointImage/" + newName;
String path = "E:/file/work/image/" + newName; //String path = "E:/file/work/image/" + newName;
String uploadPaths = "/" + newName; String uploadPaths = "/firePointImage/" + newName;
//实现上传 //实现上传
file.transferTo(new File(path)); file.transferTo(new File(path));
FireTaskPhoto fireTaskPhoto = new FireTaskPhoto(); FireTaskPhoto fireTaskPhoto = new FireTaskPhoto();

View File

@ -1,4 +1,4 @@
server.port = 6466 server.port = 6700
## 数据源配置 ## 数据源配置
spring.datasource.url = jdbc:postgresql://192.168.2.9:5432/fire_point spring.datasource.url = jdbc:postgresql://192.168.2.9:5432/fire_point
@ -24,7 +24,7 @@ spring.datasource.hikari.validation-timeout = 3000
## Spring Data JPA 配置 ## Spring Data JPA 配置
spring.jpa.database = POSTGRESQL spring.jpa.database = POSTGRESQL
spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect
spring.jpa.show-sql = true spring.jpa.show-sql = false
# 指定 ddl mode (none, validate, create, create-drop, update) # 指定 ddl mode (none, validate, create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update spring.jpa.hibernate.ddl-auto = update
# 命名策略 # 命名策略

View File

@ -11,8 +11,8 @@
<property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" /> <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" />
<!-- 定义日志存储的路径 --> <!-- 定义日志存储的路径 -->
<!--<property name="FILE_PATH" value="/home/web/logs/forest-fire-service" />--> <!--<property name="FILE_PATH" value="/home/web/logs/forest-fire-service" />-->
<property name="FILE_PATH" value="E:/log4j2/fire_point" /> <!--<property name="FILE_PATH" value="E:/log4j2/fire_point" />-->
<!--<property name="FILE_PATH" value="/usr/local/log/forest-fire-service" />--> <property name="FILE_PATH" value="/home/sxy/logs/fire_point" />
<property name="FILE_NAME" value="fire_point" /> <property name="FILE_NAME" value="fire_point" />
</Properties> </Properties>

View File

@ -1,13 +0,0 @@
package com.xkrs;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class FirePointApplicationTests {
@Test
void contextLoads() {
}
}