From 8efb5a8cd2c8a6b40e58f4f3fb851d54cf415af9 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期日, 24 十二月 2023 01:23:55 +0800 Subject: [PATCH] 游仙协议解析-1 --- src/main/java/com/fzzy/gateway/GatewayRunner.java | 34 ++++++++++++++++++++++++++++------ 1 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/fzzy/gateway/GatewayRunner.java b/src/main/java/com/fzzy/gateway/GatewayRunner.java index b841244..ab5dc98 100644 --- a/src/main/java/com/fzzy/gateway/GatewayRunner.java +++ b/src/main/java/com/fzzy/gateway/GatewayRunner.java @@ -1,12 +1,13 @@ package com.fzzy.gateway; -import com.fzzy.api.service.ApiCommonService; -import com.fzzy.api.service.ApiTriggerService; -import com.fzzy.api.service.GbCheckItemService; + +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; + +import javax.annotation.Resource; /** * 閰嶇疆闅忕郴缁熷惎鍔ㄩ粯璁ら厤缃� @@ -16,15 +17,36 @@ @Order(value = 2) public class GatewayRunner implements CommandLineRunner { + @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