package com.pj;

import com.pj.current.SpCloudUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.transaction.annotation.EnableTransactionManagement;

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

@EnableCaching // 启用缓存
@EnableScheduling // 启动定时任务
@SpringBootApplication // springboot本尊
@EnableTransactionManagement // 启动注解事务管理
@EnableFeignClients        // 启用Feign实现RPC调用
public class TransportServerApplication {

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



}
