新建分支
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.chaozhanggui.system.cashierservice.task;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbWiningUserMapper;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class TaskScheduler {
|
||||
|
||||
@Autowired
|
||||
private TbWiningUserMapper tbWiningUserMapper;
|
||||
|
||||
//更新订单状态
|
||||
// @Scheduled(fixedRate = 1000, initialDelay = 5000)
|
||||
public void orderStatus() throws InterruptedException {
|
||||
System.out.println(DateUtils.getTime());
|
||||
Thread.sleep(10000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @Scheduled(fixedRate = 1000)
|
||||
public void winningUser(){
|
||||
System.out.println("恭喜您中奖了"+DateUtils.getTime());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user