什么是定时任务
定时任务就是每到固定的时间, 需要执行的命令/脚本
SpringBoot真的很方便, 使用它做定时调度只需要简单几步就可以实现:
1. 引入依赖(只需要引入SpringBoot的基础依赖即可, SpringBoot已整合定时器任务)
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
<dependencies>
<!-- SpringBoot 核心组件 -->