package org.example;

import org.example.socket.BootNettySocketServerThread;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@MapperScan({"org.example.background.dao"})
@EnableScheduling //允许自动调用
public class IotApplication implements CommandLineRunner {

    @Autowired
    private BootNettySocketServerThread socketServerThread;

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(IotApplication.class);
        app.run(args);
    }

    @Override
    public void run(String... args) throws Exception {
        socketServerThread.start();
    }

}