package cn.minbb.iot.task;

import cn.minbb.iot.util.Application;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class AfterServiceStarted implements ApplicationRunner {

    @Value("${server.port}")
    private int port;

    private Logger logger = LoggerFactory.getLogger(AfterServiceStarted.class);

    @Override
    public void run(ApplicationArguments args) {
        // 服务启动完成后立即执行
        logger.info("{} --- 启动成功", Application.getCurrentStringTime());
    }
}
