package com.kqw.mobile.common.task;
import com.kqwdata.dao.DbwithdrawalrecordMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.text.ParseException;
@Component
@Configuration //1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling // 2.开启定时任务
@Slf4j
public class Order {
/*订单自动确认收货*/
@Scheduled(cron = "0/5 * * * * ?")
public void refreshOrder() throws ParseException {
System.out.println("我是每隔5秒执行一次");
log.info("我是每隔5秒执行一次");
}
}
定时任务
最新推荐文章于 2024-07-02 10:45:00 发布