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(); } } }