Application.java 1.61 KB
package com.glsx.ordercenter;

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.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 
 * @Title Application.java
 * @Package com.glsx.ordercenter
 * @Description 包活干订单管理服务启动类
 * @author think.wang
 * @date 2020年8月14日 下午3:31:02
 * @version 1.0.0
 */
@SpringBootApplication
@ComponentScan("com.glsx")
@ServletComponentScan
@EnableDiscoveryClient
@EnableTransactionManagement 
@EnableFeignClients(basePackages = {"com.glsx.common.feign.client"})
@MapperScan(basePackages={"com.glsx.ordercenter.mapper"})
@EnableScheduling
public class Application extends SpringBootServletInitializer {

	/**
	 * 本地启动 ,内嵌tomcat方式
	 * @param args
	 */
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

	/**
	 * 打包项目,单独部署tomcat
	 */
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return builder.sources(Application.class);
	}

}