package cn.quantgroup.xyqb;

import cn.quantgroup.xyqb.config.SequencerProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;

import lombok.extern.slf4j.Slf4j;

import cn.quantgroup.tech.db.EnableDynamicDataSource;

/**
 * @author Anonymous
 * 本地启动 :
 * 在 vm options 加入以下参数, 分别是: 环境,集群配置, 日志, 集群名, 端口号
 * -Denv=dev -Didc=k8s -Dlogging.config=classpath:logback-dev.xml -DNAMESPACE=xxx -Dserver.port=8099
 */
@Slf4j
@ComponentScan(basePackages = {"cn.quantgroup"})
@EnableCaching
@EnableAsync
@EnableAspectJAutoProxy
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableDynamicDataSource
@EnableConfigurationProperties({SequencerProperties.class})
public class Bootstrap {

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

}
