@EnableScheduling @Autowired
时间: 2023-10-21 13:58:29 浏览: 115
springBoot 创建定时任务过程详解
@EnableScheduling是spring的注解,它用于启用定时任务的功能。要使用@EnableScheduling注解,需要引入spring的依赖。这可以通过在pom.xml文件中添加spring-boot-starter-parent依赖来实现。同时,还需要添加spring-boot-starter-web依赖来引入Spring Boot的核心组件。中的代码中,@Autowired注解被用来注入StatisticsDailyService类,以便在定时任务中执行相应的数据查询和添加操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [springboot 使用定时任务@EnableScheduling](https://blog.csdn.net/weixin_49107940/article/details/126959441)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [通过@Autowired注解注入bean的顺序,以及@bean注入.rar](https://download.csdn.net/download/weixin_43812522/13104892)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文