Application是個接口,常用於項目啟動后(SpringApplication.run()執行結束),立馬執行某些邏輯。可用於項目的准備工作,比如加載配置文件,加載執行流,定時任務等。
如何使用Application

-
-
@Order注解,用於決定多個bean的執行順序;按照值從小到大執行;
擴展CommandLineRunner
CommandLineRunner與ApplicationRunner接口類似,區別是,CommandLineRunner接口中的run方法接收的參數為String數組

