jiazx0107@163.com
2024-01-04 013c5f28422defd9b47abbe17a827be693872a26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.fzzy.gateway;
 
import com.fzzy.gateway.hx2023.service.ApiInitService;
import com.fzzy.mqtt.MqttPublishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
/**
 * 配置随系统启动默认配置
 */
@Service
@Slf4j
@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("---------MQTT初始化--------------");
        mqttPublishService.init();
 
        //网关初始化
        log.info("---------网关设备初始化--------------");
        apiInitService.init();
 
 
        //获取气象信息
        scheduled.doWeatherExe();
 
        //更新设备缓存
        log.info("---------设备缓存初始化--------------");
        apiInitService.updateDeviceCache();
 
        //初始化车牌识别
        log.info("---------车牌识别初始化--------------");
        apiInitService.initAllLpr();
    }
 
}