| | |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | //@Configuration //1.主要用于标记配置类,兼备Component的效果。 |
| | | //@EnableScheduling |
| | | @Configuration //1.主要用于标记配置类,兼备Component的效果。 |
| | | @EnableScheduling |
| | | @AllArgsConstructor |
| | | public class TaskController { |
| | | private IOrderTaskService iOrderTaskService; |
| | |
| | | // @Scheduled(cron = "0/5 * * * * ?") |
| | | // @Scheduled(cron = "0 */1 * * * ?") |
| | | // @Scheduled(cron = "0 0 2 * * ?")//每天凌晨两点执行一次 |
| | | //@Scheduled(cron = " 0 30 2 * * ?")//每天2.30执行一次 |
| | | @Scheduled(cron = " 0 30 2 * * ?")//每天2.30执行一次 |
| | | //或直接指定时间间隔,例如:5秒 |
| | | //@Scheduled(fixedRate=5000) |
| | | private void configureTasks() { |