package cn.superdesk.uniorder;

import cn.superdesk.uniorder.interceptor.logger.annotation.EnableControllerLogger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableAsync;

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


//@EnableKnife4j
@EnableAsync
// 启用缓存功能
//@EnableCaching
// 开启定时任务功能
//@EnableScheduling
//@EnableAutoConfiguration
@EnableControllerLogger
//@SpringBootApplication
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = "cn.superdesk.uniorder.*")
//@ComponentScan(value = {"cn.superdesk.uniorder", "cn.superdesk.uniorder.kafka"})
public class SysWebApplication {

    public static void main(String[] args) {

        SpringApplication.run(SysWebApplication.class, args);

//		Timer         timer = new Timer();
//		StatisticsJob task  = new StatisticsJob();
//		Date          dt    = DateUtil.date();
//
//		timer.schedule(task, dt, 60 * 60 * 1000L);
    }

//	@Bean
//	public SpringContextHolder springContextHolder() {
//		return new SpringContextHolder();
//	}

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

}