package cn.iocoder.yudao.module.pms.controller.admin.yanfan.core;

//import cn.iocoder.yudao.module.pms.controller.admin.yanfan.mqtt.PubMqttClient;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * 启动类
 *
 * @author bill
 */
@Component
@Slf4j
public class StartBoot implements ApplicationRunner {


    @Autowired
//    private PubMqttClient mqttClient;
//    @Setter
//    private IMqttMessageListener subscribeCallback;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        try {
//            replyListen.listen();
//            reportListen.listen();
//            statusListen.listen();
//            propFetchListen.listen();
//            upgradeListen.listen();
//            invokeListen.listen();
//            otherListen.listen();
//            testListen.listen();
            /*启动内部客户端,用来下发客户端服务*/
//            mqttClient.setListener(subscribeCallback);
//            mqttClient.initialize();
//            protocolManagerService.getAllProtocols();
            log.info("=>设备监听队列启动成功");
        } catch (Exception e) {
            log.error("=>客户端启动失败:{}", e.getMessage(), e);
        }
    }
}
