package com.pj;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.io.File;
import java.util.Properties;

/**
 * 启动 
 * @author kong 
 */
@EnableCaching // 启用缓存
@EnableScheduling // 启动定时任务
@SpringBootApplication // springboot本尊
@EnableTransactionManagement // 启动注解事务管理
@ServletComponentScan
public class SpServerApplication {

	public static void main(String[] args) {
		Properties properties = System.getProperties();
		String rootPath = properties.getProperty("user.dir");
		SpringApplication application = new SpringApplication(SpServerApplication.class);
		application.addListeners(new ApplicationPidFileWriter(rootPath + File.separator + "app.pid"));
		application.run(args);
	}
	
}
