package com.app;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 *	启动类
 *		SpringBoot运行：默认(仅有main方法)
 *		外置tomcat部署：继承 SpringBootServletInitializer 并重写 configure 方法
 */
@SpringBootApplication
@MapperScan(basePackages = {"com.app.**.dao"})
@EnableAsync(proxyTargetClass = true)
public class YunjiaoAdminApplication extends SpringBootServletInitializer {

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		// 注意这里要指向原先用main方法执行的Application启动类
		return builder.sources(YunjiaoAdminApplication.class);
	}

	public static void main(String[] args) {
		SpringApplication.run(YunjiaoAdminApplication.class, args);
	}

}
