springboot 項目一啓動,就開始運行某個功能:實現 CommandLineRunner 接口,重寫 run 方法。

import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; @Component public class MyStartupRunner implements CommandLineRunner { // 項目啓動後,就執行的功能 public voi
相關文章
相關標籤/搜索