ApplicationRunner 和 postcon
时间: 2023-10-26 20:23:22 浏览: 36
ApplicationRunner 是 Spring Boot 中的一个接口,用于运行 Spring Boot 应用程序。它定义了一个 run 方法,该方法在 Spring Boot 应用程序启动后被调用。通过实现 ApplicationRunner 接口并重写 run 方法,可以在应用程序启动后执行一些自定义的逻辑。
postcon 是一个缩写,通常表示 "post construction",即在构造函数执行完毕后执行的代码。在软件开发中,postcon 通常用于指定在对象创建后需要执行的一些操作,例如初始化和配置。
所以,ApplicationRunner 和 postcon 是两个不同的概念,分别用于不同的场景。ApplicationRunner 用于执行 Spring Boot 应用程序启动后的逻辑,而 postcon 用于指定对象创建后需要执行的操作。