Skip to content

Commit d0dd8d3

Browse files
committed
add welcome msg
1 parent c9af6ff commit d0dd8d3

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

core/src/main/java/com/flowci/core/Application.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,34 @@
1616

1717
package com.flowci.core;
1818

19+
import com.flowci.util.StringHelper;
20+
import lombok.extern.log4j.Log4j2;
21+
import org.springframework.beans.factory.annotation.Autowired;
1922
import org.springframework.boot.SpringApplication;
2023
import org.springframework.boot.autoconfigure.SpringBootApplication;
24+
import org.springframework.context.event.ContextRefreshedEvent;
25+
import org.springframework.context.event.EventListener;
26+
import org.springframework.core.io.Resource;
27+
import org.springframework.core.io.ResourceLoader;
28+
29+
import java.io.IOException;
2130

2231
/**
2332
* @author yang
2433
*/
34+
@Log4j2
2535
@SpringBootApplication
2636
public class Application {
2737

38+
@Autowired
39+
private ResourceLoader resourceLoader;
40+
41+
@EventListener(ContextRefreshedEvent.class)
42+
public void printBanner() throws IOException {
43+
Resource r = resourceLoader.getResource("classpath:welcome.txt");
44+
log.info(StringHelper.toString(r.getInputStream()));
45+
}
46+
2847
public static void main(String[] args) {
2948
SpringApplication.run(Application.class, args);
3049
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
_ _ __ _ _
3+
__ __ ___ | | ___ ___ _ __ ___ ___ | |_ ___ / _|| | ___ __ __ ___ (_)
4+
\ \ /\ / / / _ \| | / __| / _ \ | '_ ` _ \ / _ \ | __| / _ \ | |_ | | / _ \ \ \ /\ / / / __|| |
5+
\ V V / | __/| || (__ | (_) || | | | | || __/ | |_ | (_) | | _|| || (_) | \ V V / _ | (__ | |
6+
\_/\_/ \___||_| \___| \___/ |_| |_| |_| \___| \__| \___/ |_| |_| \___/ \_/\_/ (_) \___||_|
7+

0 commit comments

Comments
 (0)