diff --git a/core/src/main/java/com/flowci/core/Application.java b/core/src/main/java/com/flowci/core/Application.java index 0aa5f67e2..dcd6b330f 100644 --- a/core/src/main/java/com/flowci/core/Application.java +++ b/core/src/main/java/com/flowci/core/Application.java @@ -16,15 +16,34 @@ package com.flowci.core; +import com.flowci.util.StringHelper; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.context.event.EventListener; +import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; + +import java.io.IOException; /** * @author yang */ +@Log4j2 @SpringBootApplication public class Application { + @Autowired + private ResourceLoader resourceLoader; + + @EventListener(ContextRefreshedEvent.class) + public void printBanner() throws IOException { + Resource r = resourceLoader.getResource("classpath:welcome.txt"); + log.info(StringHelper.toString(r.getInputStream())); + } + public static void main(String[] args) { SpringApplication.run(Application.class, args); } diff --git a/core/src/main/resources/welcome.txt b/core/src/main/resources/welcome.txt new file mode 100644 index 000000000..887a9f956 --- /dev/null +++ b/core/src/main/resources/welcome.txt @@ -0,0 +1,7 @@ + + _ _ __ _ _ +__ __ ___ | | ___ ___ _ __ ___ ___ | |_ ___ / _|| | ___ __ __ ___ (_) +\ \ /\ / / / _ \| | / __| / _ \ | '_ ` _ \ / _ \ | __| / _ \ | |_ | | / _ \ \ \ /\ / / / __|| | + \ V V / | __/| || (__ | (_) || | | | | || __/ | |_ | (_) | | _|| || (_) | \ V V / _ | (__ | | + \_/\_/ \___||_| \___| \___/ |_| |_| |_| \___| \__| \___/ |_| |_| \___/ \_/\_/ (_) \___||_| +