package com.yeejoin.amos.boot.module.common.biz.service.impl;

import com.yeejoin.amos.boot.module.common.biz.listener.AmosMqttListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper;

/**
 * @author Administrator
 */
@Component
public class ApplicationRunnerImpl implements ApplicationRunner {

    @Autowired
    EmqKeeper emqKeeper;

    @Autowired
    AmosMqttListener amosMqttListener;


    @Override
    public void run(ApplicationArguments args) throws Exception {
        emqKeeper.subscript("/amos/operation/log", 2, amosMqttListener);
    }
}
