package com.ho.business.feignclient;

import com.ho.business.entity.DeviceTypeCol;
import com.ho.business.vo.DeviceTypeList;
import com.ho.common.tools.entity.ProcessOrder;
import com.ho.common.tools.exception.BaseResponseCode;
import com.ho.common.tools.exception.BusinessException;
import com.ho.common.tools.exception.DataResult;
import com.ho.flow.vo.Event;
import com.ho.flow.vo.req.AlarmConfig.AlarmConfigQueryVo;
import com.ho.flow.vo.req.SendSmsConfig.SendSmsConfigQueryReq;
import com.ho.flow.vo.req.event.EventAddReq;
import com.ho.flow.vo.req.event.EventDemoReqVo;
import com.ho.flow.vo.req.event.EventReqPageVO;
import com.ho.flow.vo.resp.StationStatusRespVO;
import com.ho.flow.vo.resp.event.EventDayNum;
import com.ho.flow.vo.resp.event.EventDemo;
import com.ho.flow.vo.resp.event.EventTypeAndLevelsReqVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Description 调用flow-center失败
 * Author yule
 * Date 2023/2/6 10:14
 */
@Slf4j
@Component
public class FlowFeignClientFallback implements FlowFeignClient {

    @Override
    public DataResult<Integer> selectWorkOrderByStationId(Integer stationId) {
        log.error("调用 [FlowFeignClient.selectWorkOrderByStationId] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult addEvents(EventAddReq event) {
        log.error("调用 [FlowFeignClient.addEvents] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult addEventsList(List<EventAddReq> event) {
        log.error("调用 [FlowFeignClient.addEventsList] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public Boolean isRecoveryDevice(AlarmConfigQueryVo alarmConfigQueryVo) {
        log.error("调用 [FlowFeignClient.isRecoveryDevice] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult<List<StationStatusRespVO>> normalStation(AlarmConfigQueryVo alarmConfigQueryVo) {
        log.error("调用 [FlowFeignClient.normalStation] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult<List<EventDemo>> faultDuration(EventDemoReqVo eventDemoReqVo) {
        log.error("调用 [FlowFeignClient.faultDuration] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult<List<EventDemo>> faultDurations(EventDemoReqVo eventDemoReqVo) {
        log.error("调用 [FlowFeignClient.faultDurations] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult deviceColDefine(List<DeviceTypeCol> deviceTypeCols) {
        log.error("调用 [FlowFeignClient.deviceColDefine] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult syncAlarmConfig(DeviceTypeList deviceTypeList) {
        log.error("调用 [FlowFeignClient.syncAlarmConfig] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult<Event> getNotRecovered(AlarmConfigQueryVo stationStatusReq) {
        log.error("调用 [FlowFeignClient.getNotRecovered] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult<EventTypeAndLevelsReqVO> alarmDataStatistics(AlarmConfigQueryVo stationStatusReq) {
        log.error("调用 [FlowFeignClient.alarmDataStatistics] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult getSendSms(SendSmsConfigQueryReq vo) {
        log.error("调用 [FlowFeignClient.getSendSms] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public List<EventDayNum> countEventByDay(EventReqPageVO vo) {
        log.error("调用 [FlowFeignClient.countEventByDay] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }

    @Override
    public DataResult initProcessInstance(@RequestBody ProcessOrder processOrder) {
        log.error("调用 [FlowFeignClient.initProcessInstance] 异常!");
        throw new BusinessException(BaseResponseCode.FEIGN_CALL_FAIL);
    }
}
