package com.njcn.system.timer.tasks;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.njcn.csdevice.api.WlRecordFeignClient;
import com.njcn.system.timer.TimerTaskRunner;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * @author xy
 */
@Component
@RequiredArgsConstructor
public class CheckDeviceTaskRunner implements TimerTaskRunner {

    private final WlRecordFeignClient wlRecordFeignClient;

    @Override
    public void action(String date) {
        if(StrUtil.isBlank(date)){
            date = DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN);
        }
        wlRecordFeignClient.dayDealNoEndTimeEvent(date);
    }
}
