package com.yida.data.server;

import cc.mrbird.febs.common.security.starter.annotation.EnableFebsCloudResourceServer;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableAsync
@SpringBootApplication(exclude = DruidDataSourceAutoConfigure.class)
@EnableFebsCloudResourceServer
@EnableTransactionManagement
@MapperScan("com.yida.data.server.mapper")
@EnableFeignClients(basePackages = "com.yida.data")
@EnableScheduling
public class App {

    public static void main(String[] args) {
        //获取application的上下文
        ApplicationContext applicationContext = new SpringApplicationBuilder(App.class)
            .web(WebApplicationType.SERVLET)
            .run(args);

        /**
         * 启动netty dtu的服务端
         */
//        StartConfig socketServer = applicationContext.getBean(StartConfig.class);
//        socketServer.start();
    }
}
