jiazx0107@163.com
2023-12-07 9b5c86d852fd94c0f01497d7571b27419ab17c58
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,16 +20,28 @@
    @Resource
    private ApiInitService apiInitService;
    @Resource
    private MqttPublishService mqttPublishService;
    @Resource
    private  GatewayTimerScheduled scheduled;
    @Override
    public void run(String... args) throws Exception {
        log.info("网关接口随系统启动------------");
        //四川网关接口,启动默认获取鉴权信息,长期有效
        mqttPublishService.init();
        //执行初始化方案
        apiInitService.init();
        //获取气象信息
        scheduled.doWeatherExe();
        //更新设备缓存
        apiInitService.updateDeviceCache();
        //初始化车牌识别
        apiInitService.initAllLpr();
    }
}