diff --git a/admin-client-temperature.iml b/admin-client-temperature.iml
new file mode 100644
index 0000000..3119143
--- /dev/null
+++ b/admin-client-temperature.iml
@@ -0,0 +1,259 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 03a1c97..4a72afe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
com.rehome
admin-client-temperature
1.0.0
- jar
+ war
admin-client-temperature
admin-client-temperature
@@ -26,6 +26,12 @@
org.springframework.boot
spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-logging
+
+
org.mybatis.spring.boot
@@ -277,7 +283,7 @@
- ${project.artifactId}-pg
+ ${project.artifactId}-pg-26-appserver
org.springframework.boot
diff --git a/src/main/java/com/rehome/mqttclienttemperature/AdminClientTemperatureApplication.java b/src/main/java/com/rehome/mqttclienttemperature/AdminClientTemperatureApplication.java
index 74b31b7..60c443f 100644
--- a/src/main/java/com/rehome/mqttclienttemperature/AdminClientTemperatureApplication.java
+++ b/src/main/java/com/rehome/mqttclienttemperature/AdminClientTemperatureApplication.java
@@ -22,7 +22,7 @@ import java.util.Map;
@EnableScheduling
@EnableAsync
@SpringBootApplication
-public class AdminClientTemperatureApplication implements CommandLineRunner, ApplicationContextAware {
+public class AdminClientTemperatureApplication extends SpringBootServletInitializer implements CommandLineRunner, ApplicationContextAware {
/**
* 获取Spring框架的上下文
@@ -69,4 +69,14 @@ public class AdminClientTemperatureApplication implements CommandLineRunner, App
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
+
+ /**
+ * @date 2021-05-18 09:20
+ * @description: 容器配置,springboot打war包布署必须添加这个配置 为了打包springboot项目
+ * @Param: SpringApplicationBuilder
+ */
+ @Override
+ protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
+ return builder.sources(AdminClientTemperatureApplication.class);
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/rehome/mqttclienttemperature/controller/JdbcDemoController.java b/src/main/java/com/rehome/mqttclienttemperature/controller/JdbcDemoController.java
index 1cb256e..639865d 100644
--- a/src/main/java/com/rehome/mqttclienttemperature/controller/JdbcDemoController.java
+++ b/src/main/java/com/rehome/mqttclienttemperature/controller/JdbcDemoController.java
@@ -98,7 +98,7 @@ public class JdbcDemoController {
*
* @return
*/
- @RequestMapping("/api/list")
+ //@RequestMapping("/api/list")
public ResponseDto queryList() {
// 自定义一个线程池,内部包含8个线程
ExecutorService customPool = Executors.newFixedThreadPool(2);
@@ -107,7 +107,7 @@ public class JdbcDemoController {
CompletableFuture future = CompletableFuture.supplyAsync(() -> {
String sql = "select * from temperature where id = ?";
List