BroAdminAuthApplication.java 1.8 KB
package cn.brotop.auth;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import cn.brotop.common.security.annotation.EnableRyFeignClients;
import org.springframework.core.io.ClassPathResource;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 * 认证授权中心
 * 
 * @author 啊雷
 */
@EnableRyFeignClients
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
public class BroAdminAuthApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(BroAdminAuthApplication.class, args);

        //  启动成功后打印启动 Banner
        printlnStartBanner();
    }

    public static void printlnStartBanner(){

        ClassPathResource classPathResource = new ClassPathResource("banner_start.txt");
        InputStream inputStream = null;
        BufferedReader in = null;
        try {
            if (classPathResource.exists()){
                in = new BufferedReader(new InputStreamReader(classPathResource.getInputStream(), "UTF-8"));
                String line = null;
                while ((line = in.readLine()) != null){
                    System.out.println("\t" + line);
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            try {
                if (inputStream != null){
                    inputStream.close();
                }
            }catch (Exception e){
                e.printStackTrace();
            }
            try {
                if (in != null){
                    in.close();
                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }
}