定时任务task
EnableScheduling
使用注解 @EnableScheduling 开启定时任务,会自动扫描。
@SpringBootApplication
//扫描 mybatis mapper 包路径
@MapperScan(basePackages = "com.cdw.springbootmavemdemo.mapper")//导入 org.mybatis.spring.annotation.MapperScan;就会报错
//扫描 所有需要的包, 包含一些自用的工具类包 所在的路径
@ComponentScan(basePackages= {
"com.cdw.springbootmavemdemo", "org.n3r.idworker"})
//开启定时任务
@EnableScheduling