目录1.使用 @PostConstruct 注解优点:缺点:2.使用 CommandLineRunner 接口优点:缺点:3.使用 ApplicationRunner 接口优点:缺点:4.使用 ApplicationListener 监听 ApplicationReadyEvent优点:缺点:5.@EventLis
目录一、注解@PostConstruct二、CommandLineRunner接口三、实现ApplicationRunner接口四、实现ApplicationListener五、四种方式的执行顺序一、注解@PostConstruct