摘要: 在项目中我们有时候需要实现项目启动后就执行的功能,比如将热点数据存入redis中。 方式一:定义一个类实现CommandLineRunner接口,实现功能的代码在run方法中。cnblogs中参考链接 补充:SpringBoot在项目启动后会遍历所有实现CommandLineRunner的实体类并执 阅读全文
posted @ 2020-08-26 14:12 sun-sailing 阅读(553) 评论(0) 推荐(0)