44323
2024-03-06 b0254c5a17b3915eb00fdcb33f0eea222cff78ee
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/util/TaskUtil.java
New file
@@ -0,0 +1,33 @@
package com.dsh.communityWorldCup.util;
import com.dsh.communityWorldCup.service.IWorldCupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
 * @author zhibing.pu
 * @date 2023/7/11 8:39
 */
@Component
public class TaskUtil {
    @Autowired
    private IWorldCupService worldCupService;
    /**
     * 每隔一分钟去处理的定时任务
     */
    @Scheduled(fixedRate = 60000)
    public void taskMinute() {
        try {
            worldCupService.taskUpdateStatus();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}