参考:https://blog.csdn.net/u010349272/article/details/108028504
一,ApplicationRunner 接口
@Componentpublic class Runner implements ApplicationRunner {@Autowiredprivate ZkUserService zkUserService;@Overridepublic void run(ApplicationArguments args) throws Exception {System.out.println("===============");}}
二,CommandLineRunner 接口
@Componentpublic class Runner implements CommandLineRunner {@Autowiredprivate ZkUserService zkUserService;@Overridepublic void run(String... args) throws Exception {System.out.println("===============");}}
