潘志宝
2024-12-25 ac52aed09a493bebf6f47571f01d107a46e1e3ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.iailab.gateway.util;
 
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;
 
/**
 * 项目启动成功后,提供文档相关的地址
 *
 * @author iailab
 */
@Component
@Slf4j
public class BannerApplicationRunner implements ApplicationRunner {
 
    @Override
    public void run(ApplicationArguments args) {
        ThreadUtil.execute(() -> {
            ThreadUtil.sleep(1, TimeUnit.SECONDS); // 延迟 1 秒,保证输出到结尾
            log.info("\n----------------------------------------------------------\n\t" +
                    "项目启动成功!\n\t" +
                    "----------------------------------------------------------");
        });
    }
 
}