From 3cc7a35ccce99228b356e8437042e5d77fb40b7c Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 18 May 2022 20:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=AF=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=89=93=E5=8D=B0=E7=9B=B8=E5=85=B3=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tip/core/TipApplicationRunner.java | 36 +++++++++++++++++++ .../server/framework/tip/package-info.java | 4 +++ 2 files changed, 40 insertions(+) create mode 100644 yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/core/TipApplicationRunner.java create mode 100644 yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/package-info.java diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/core/TipApplicationRunner.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/core/TipApplicationRunner.java new file mode 100644 index 000000000..469256f6d --- /dev/null +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/core/TipApplicationRunner.java @@ -0,0 +1,36 @@ +package cn.iocoder.yudao.server.framework.tip.core; + +import cn.hutool.core.thread.ThreadUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +import java.util.concurrent.TimeUnit; + +/** + * 项目启动成功后,提供文档相关的地址 + */ +@Component +@Slf4j +public class TipApplicationRunner implements ApplicationRunner { + + @Override + public void run(ApplicationArguments args) throws Exception { + ThreadUtil.execute(() -> { + ThreadUtil.sleep(1, TimeUnit.SECONDS); // 延迟 1 秒,保证输出到结尾 + log.info("\n----------------------------------------------------------\n\t" + + "项目启动成功!\n\t" + + "接口文档: \t{} \n\t" + + "开发文档: \t{} \n\t" + + "视频教程: \t{} \n" + + "源码解析: \t{} \n" + + "----------------------------------------------------------", + "https://mtw.so/6w48hX", + "https://doc.iocoder.cn", + "https://t.zsxq.com/02Yf6M7Qn", + "https://t.zsxq.com/02B6ujIee"); + }); + } + +} diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/package-info.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/package-info.java new file mode 100644 index 000000000..3006aa4ae --- /dev/null +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/package-info.java @@ -0,0 +1,4 @@ +/** + * 目的:项目启动成功后,提供文档相关的地址 + */ +package cn.iocoder.yudao.server.framework.tip;