Commit 3cc7a35ccce99228b356e8437042e5d77fb40b7c

Authored by YunaiV
1 parent 0b800810

项目启动时,打印相关文档

yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/core/TipApplicationRunner.java 0 → 100644
  1 +package cn.iocoder.yudao.server.framework.tip.core;
  2 +
  3 +import cn.hutool.core.thread.ThreadUtil;
  4 +import lombok.extern.slf4j.Slf4j;
  5 +import org.springframework.boot.ApplicationArguments;
  6 +import org.springframework.boot.ApplicationRunner;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +import java.util.concurrent.TimeUnit;
  10 +
  11 +/**
  12 + * 项目启动成功后,提供文档相关的地址
  13 + */
  14 +@Component
  15 +@Slf4j
  16 +public class TipApplicationRunner implements ApplicationRunner {
  17 +
  18 + @Override
  19 + public void run(ApplicationArguments args) throws Exception {
  20 + ThreadUtil.execute(() -> {
  21 + ThreadUtil.sleep(1, TimeUnit.SECONDS); // 延迟 1 秒,保证输出到结尾
  22 + log.info("\n----------------------------------------------------------\n\t" +
  23 + "项目启动成功!\n\t" +
  24 + "接口文档: \t{} \n\t" +
  25 + "开发文档: \t{} \n\t" +
  26 + "视频教程: \t{} \n" +
  27 + "源码解析: \t{} \n" +
  28 + "----------------------------------------------------------",
  29 + "https://mtw.so/6w48hX",
  30 + "https://doc.iocoder.cn",
  31 + "https://t.zsxq.com/02Yf6M7Qn",
  32 + "https://t.zsxq.com/02B6ujIee");
  33 + });
  34 + }
  35 +
  36 +}
yudao-server/src/main/java/cn/iocoder/yudao/server/framework/tip/package-info.java 0 → 100644
  1 +/**
  2 + * 目的:项目启动成功后,提供文档相关的地址
  3 + */
  4 +package cn.iocoder.yudao.server.framework.tip;