package com.mosty.rwzx.task;

import com.mosty.rwzx.service.TbRwTaskService;
import lombok.AllArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 每隔几分钟执行一次指令的修改与变更
 * 查询是否有任务已经超期
 */
@Component
@AllArgsConstructor
public class ChangeRwztTask {

    private final TbRwTaskService tbRwTaskService;

    @Scheduled(cron = "0 */5 * * * ?")
    public void run() {
         this.tbRwTaskService.changeState();
    }
}
