jiazx0107@163.com
2024-01-19 6a9cf62f7ca4b45c48a571c63fd484c186070a0e
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();
    }
}