package com.sf;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;

import lombok.extern.slf4j.Slf4j;

/**
 * 启动程序
 * 
 * @author ztzh
 */
@Slf4j
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class AdminApplication {	
	// 全局 ApplicationContext 实例，方便 getBean 拿到 Spring/SpringBoot 注入的类实例
	private static ApplicationContext APPLICATION_CONTEXT;

	public static ApplicationContext getApplicationContext() {
		return APPLICATION_CONTEXT;
	}

	public static void main(String[] args) throws Exception {
		// System.setProperty("spring.devtools.restart.enabled", "false");
		APPLICATION_CONTEXT = SpringApplication.run(AdminApplication.class, args);
	}
}
