feat(improve) - 优化Starter 启动打印信息

This commit is contained in:
wangli 2026-02-25 14:50:15 +08:00
parent 7d5c9f64c8
commit fd78c71ddb
2 changed files with 54 additions and 0 deletions

View File

@ -32,6 +32,7 @@ import cn.axzo.workflow.starter.mq.check.ImplementationReadyChecker;
import cn.axzo.workflow.starter.mq.monitor.WorkflowEngineStarterDefaultMQMonitor;
import cn.axzo.workflow.starter.mq.monitor.console.WorkflowEngineStarterMQMonitorController;
import cn.axzo.workflow.starter.selector.MetaFeignClientEnableSelector;
import cn.axzo.workflow.starter.util.LOGOPrinter;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.MixAll;
@ -50,6 +51,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.env.Environment;
import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;
@ -66,6 +68,11 @@ public class WorkflowEngineStarterAutoConfiguration {
private final Logger log = LoggerFactory.getLogger(WorkflowEngineStarterAutoConfiguration.class);
@PostConstruct
public void printLogo() {
LOGOPrinter.print();
}
@Bean
public ListenerExecutor listenerExecutor(WorkflowEngineStarterProperties starterProperties,
List<ExecuteInterceptor> additionalInterceptors) {

View File

@ -0,0 +1,47 @@
package cn.axzo.workflow.starter.util;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ansi.AnsiColor;
import org.springframework.boot.ansi.AnsiOutput;
import java.util.Optional;
/**
* TODO
*
* @author wangli
* @since 2026-02-25 11:58
*/
@Slf4j
public class LOGOPrinter {
/**
* WorkflowEngine 当前版本号
*/
private static final String VERSION_NO = getVersion();
public static void print() {
StringBuilder str = new StringBuilder("\n");
str.append(
"================================================================================================\n");
str.append(" _ _ _ __ _ _____ _ \n");
str.append("| | | | | | / _| | | ___| (_)\n");
str.append("| | | | ___ _ __| | _| |_| | _____ _| |__ _ __ __ _ _ _ __ ___\n");
str.append("| |/\\| |/ _ \\| '__| |/ / _| |/ _ \\ \\ /\\ / / __| '_ \\ / _` | | '_ \\ / _ \\\n");
str.append("\\ /\\ / (_) | | | <| | | | (_) \\ V V /| |__| | | | (_| | | | | | __/\n");
str.append(" \\/ \\/ \\___/|_| |_|\\_\\_| |_|\\___/ \\_/\\_/ \\____/_| |_|\\__, |_|_| |_|\\___|\n");
str.append(" __/ |\n");
str.append(" |___/\n");
str.append(" Version: ");
str.append(AnsiOutput.toString(AnsiColor.GREEN, VERSION_NO, AnsiColor.DEFAULT));
str.append("\n");
str.append(" Document: https://alidocs.dingtalk.com/i/nodes/QOG9lyrgJPR71pQqI9ZqnM7XWzN67Mw4\n");
str.append(
"================================================================================================\n");
log.info(str.toString());
}
private static String getVersion() {
return Optional.ofNullable(LOGOPrinter.class.getPackage()).map(Package::getImplementationVersion).orElse("DEV");
}
}