1.启动类上开启定时任务注解 @EnableScheduling
注:springboot会自动扫描主类包下的所有controller
2 自定义Compoment @Compoment
3.@Scheduled(fixedRate =1000*15)//每15s执行一次方法
SpringBoot2.x整合定时任务Schedule
猜你喜欢
转载自blog.csdn.net/qq_42338771/article/details/89636016
今日推荐
周排行