@Slf4j
@Component
public class RunTesk implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
callBack();
}
private void callBack() throws InterruptedException {
int i = 1;
while (true) {
if (i % 5 == 0) {
Thread.sleep(1000);
System.out.println(LocalDateTime.now()+","+i);
}
i++;
}
}
}
CommandLineRunner-项目启动可进行初始化操作
最新推荐文章于 2024-07-27 13:31:57 发布