Spring定时任务(Cron表达式)

时间:2025-02-18 09:17:47
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @Service public class SeckillScheduled { // @Scheduled(cron = "*/5 * * * * ? ") @Scheduled(cron = "0 0 1/1 * * ? ") public void uploadSeckillSkuLatest3Days() { //调用service层方法 定时执行业务代码 } }