From c8a4f3f8327b4a2290d719503211adb8845e6fd8 Mon Sep 17 00:00:00 2001 From: vince <757871790@qq.com> Date: 星期二, 19 十二月 2023 14:37:08 +0800 Subject: [PATCH] 优化代码,增加仓温仓湿度 --- src/main/java/com/fzzy/gateway/GatewayRunner.java | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/fzzy/gateway/GatewayRunner.java b/src/main/java/com/fzzy/gateway/GatewayRunner.java index 9597fee..5c257ee 100644 --- a/src/main/java/com/fzzy/gateway/GatewayRunner.java +++ b/src/main/java/com/fzzy/gateway/GatewayRunner.java @@ -1,7 +1,9 @@ package com.fzzy.gateway; import com.fzzy.gateway.hx2023.service.ApiInitService; +import com.fzzy.mqtt.MqttPublishService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Service; @@ -18,15 +20,34 @@ @Resource private ApiInitService apiInitService; + @Resource + private MqttPublishService mqttPublishService; + @Resource + private GatewayTimerScheduled scheduled; + @Override public void run(String... args) throws Exception { - log.info("缃戝叧鎺ュ彛闅忕郴缁熷惎鍔�------------"); + log.info("---------MQTT鍒濆鍖�--------------"); + mqttPublishService.init(); - //鍥涘窛缃戝叧鎺ュ彛锛屽惎鍔ㄩ粯璁よ幏鍙栭壌鏉冧俊鎭紝闀挎湡鏈夋晥 + //缃戝叧鍒濆鍖� + log.info("---------缃戝叧璁惧鍒濆鍖�--------------"); apiInitService.init(); + + + //鑾峰彇姘旇薄淇℃伅 + scheduled.doWeatherExe(); + + //鏇存柊璁惧缂撳瓨 + log.info("---------璁惧缂撳瓨鍒濆鍖�--------------"); + apiInitService.updateDeviceCache(); + + //鍒濆鍖栬溅鐗岃瘑鍒� + log.info("---------杞︾墝璇嗗埆鍒濆鍖�--------------"); + apiInitService.initAllLpr(); } } -- Gitblit v1.9.3