@PostConstruct注解
实现InitializingBean, 重写afterPropertiesSet() 方法
在xml配置中配置bean的init-method属性
实现ApplicationContextAware接口并重写setApplicationContext()方法
实现 CommandLineRunner 接口
实现 ApplicationRunner 接口
实现 ApplicationListener 接口
引用:【SpringBoot】 启动后执行方法的五种方式_sco5282的博客-CSDN博客_springboot 启动后执行