PaymentApplication.java
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package cn.brotop;
import cn.brotop.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.io.ClassPathResource;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
/**
* @author 啊雷
* @version 1.0
* @date 2021/2/1 13:36
*/
@EnableCustomSwagger2
@SpringBootApplication
public class PaymentApplication {
public static void main(String[] args) {
SpringApplication.run(PaymentApplication.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();
}
}
}
}