springboot 项目启动立即执行的方法
#1:@PostConstruct
1 @Component 2 public class testController { 3 4 /** 5 * 项目启动时,初始化定时器 6 */ 7 @PostConstruct 8 public void init() { 9 System.out.println("********quartz定时任务启动成功********"); 10 } 11 }
posted on 2021-12-14 15:12 夜空中闪闪发光的星星 阅读(59) 评论(0) 收藏 举报
浙公网安备 33010602011771号