package net.northking.cctp.upperComputer;


import net.northking.cctp.upperComputer.deviceManager.UpperComputerManager;
import net.northking.cctp.upperComputer.thread.ShutdownHook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
@EnableScheduling
@EnableAsync
public class AtuUpperComputerApplication {

    private static Logger logger = LoggerFactory.getLogger(AtuUpperComputerApplication.class);

    public static void main(String[] args){
        Runtime.getRuntime().addShutdownHook(new ShutdownHook());
        String system = System.getProperty("os.name");
        logger.debug("上位机操作系统：{}",system);
        UpperComputerManager.getInstance().setOperatingSystem(system);
        SpringApplication.run(AtuUpperComputerApplication.class, args);
    }
}
