package com.njcn.system.timer.tasks;

import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.pms.api.GwMonitorPushFeignClient;
import com.njcn.system.timer.TimerTaskRunner;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.ArrayList;


/**
 *
 */
@Component
@RequiredArgsConstructor
public class PmsMonitorLimitSendTaskRunner implements TimerTaskRunner {

    private final GwMonitorPushFeignClient gwMonitorPushFeignClient;


    @Override
    public void action(String date) {
        String code = gwMonitorPushFeignClient.pushMonitorOverLimit(new ArrayList<>()).getCode();
        if(code.equals("A0002")){
            throw new BusinessException("失败");
        }
    }
}
