package com.njcn.system.timer.tasks;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.StrUtil;
import com.njcn.dataProcess.api.DataRecallFeignClient;
import com.njcn.dataProcess.param.FullRecallMessage;
import com.njcn.message.message.RecallMessage;
import com.njcn.system.timer.TimerTaskRunner;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 类的介绍：装置算法执行链定时任务
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2023/12/6 9:35
 */
@Component
@RequiredArgsConstructor

public class DataRecallHourTaskRunner implements TimerTaskRunner {

    private final DataRecallFeignClient dataRecallFeignClient;

    @Override
    public void action(String date) {


        if(StrUtil.isBlank(date)){
            FullRecallMessage baseParam = new FullRecallMessage();
            baseParam.setReCallStartTime(LocalDateTime.now().withMinute(0).withSecond(0).withNano(0).minusHours(1));
            baseParam.setReCallEndTime(LocalDateTime.now().withMinute(0).withSecond(0).withNano(0));

            dataRecallFeignClient.fullHourRecall(baseParam);
        }

    }


}
