package cn.superdesk.uniorder.dubbo.provider;

import cn.superdesk.uniorder.interceptor.monitor.annotation.EnableMonitorLogger;
import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitScan;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

@SpringBootApplication
@EnableAutoConfiguration
@EnableMonitorLogger
//@EnableDubboConfiguration
@EnableDubbo
@EnableCaching
@EnableAsync
@EnableTransactionManagement
@MapperScan("cn.superdesk.uniorder.dao.mapper.*")
@ComponentScan(value = {
		"cn.superdesk.uniorder",
		"cn.superdesk.uniorder.dubbo.provider",

		"cn.superdesk.uniorder.openapicall"
})
@RetrofitScan(value = {
		"cn.superdesk.uniorder.openapicall",
		"cn.superdesk.uniorder.openapicall.superdeskapp",
		"cn.superdesk.uniorder.openapicall.superdeskmall",
		"cn.superdesk.uniorder.openapicall.superdeskuniorder",
		"cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice"
})
public class SysServiceApplication {


	public static void main(String[] args) {
		ApplicationContext ctx = SpringApplication.run(SysServiceApplication.class, args);
	}

	@PostConstruct
	void setDefaultTimezone() {
		TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
	}
}
