Application是个接口,常用于项目启动后(SpringApplication.run()执行结束),立马执行某些逻辑。可用于项目的准备工作,比如加载配置文件,加载执行流,定时任务等。
@Order注解,用于决定多个bean的执行顺序;按照值从小到大执行;
CommandLineRunner与ApplicationRunner接口类似,区别是,CommandLineRunner接口中的run方法接收的参数为String数组
ApplicationRunner实现“项目启动就执行“功能
原文:https://www.cnblogs.com/vicious/p/14717267.html