潘志宝
2024-12-23 5bf42aa9950058f391805e6fb8d7376f4378924b
提交 | 用户 | 时间
e7c126 1 package com.iailab.gateway.util;
H 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  * @author iailab
15  */
16 @Component
17 @Slf4j
18 public class BannerApplicationRunner implements ApplicationRunner {
19
20     @Override
21     public void run(ApplicationArguments args) {
22         ThreadUtil.execute(() -> {
23             ThreadUtil.sleep(1, TimeUnit.SECONDS); // 延迟 1 秒,保证输出到结尾
24             log.info("\n----------------------------------------------------------\n\t" +
25                     "项目启动成功!\n\t" +
26                     "----------------------------------------------------------");
27         });
28     }
29
30 }