package com.sw.mes;

import com.sw.mes.core.annotation.JpaExclude;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.FilterType;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableSwagger2
@EntityScan(basePackages = {"com.sw.mes"})
@EnableAspectJAutoProxy
@EnableJpaRepositories(excludeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {JpaExclude.class})},basePackages = {"com.sw.mes"}, enableDefaultTransactions = false)
public class MesPcFbServerApplication {

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

	@Bean
	public TaskScheduler taskSchedulerFb() {
		ThreadPoolTaskScheduler taskSchedulerFb = new ThreadPoolTaskScheduler();
        taskSchedulerFb.setPoolSize(50);
		return taskSchedulerFb;
	}

}
