@Component public class Runner implements CommandLineRunner { @Override public void run(String... args) throws Exception { System.out.println("The Runner start to initialize ..."); } }
项目启动的时候加载缓存之类的可以使用此方法,主要是实现CommandLineRunner,然后重写run方法
原文地址:https://www.cnblogs.com/huangtao1927/p/9499120.html
时间: 2024-11-09 10:42:10