package com.ho.flow.feignclient;

import com.ho.business.entity.*;
import com.ho.business.vo.req.DeviceReqVO;
import com.ho.business.vo.req.EventColReq;
import com.ho.business.vo.req.StationPageReqVO;
import com.ho.business.vo.req.device.DeviceListReq;
import com.ho.business.vo.req.device.DeviceTypeQuery;
import com.ho.business.vo.req.deviceTypeCol.DeviceTypeColQueryVo;
import com.ho.business.vo.req.inspectionFault.InspectionFaultVo;
import com.ho.business.vo.resp.DeviceRespVO;
import com.ho.common.tools.constant.ContextConstant;
import com.ho.common.tools.exception.DataResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;


@FeignClient(value = ContextConstant.BUSINESS_SERVICE, fallback = BusinessFeignClientFallback.class)
public interface BusinessFeignClient {

    // 根据部门id查电站集合
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectByStationIds")
    DataResult<List<Station>> selectByStationIds(@RequestBody List<Integer> ids);

    // 查询全部电站
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectStationSNAll")
    DataResult<List<Station>> selectStationSNAll();

    // 根据分组id查电站集合
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectByGroupId")
    DataResult<List<Station>> selectByGroupId(@RequestBody Integer group);

    // 根据电站id查电站
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectByStationId")
     DataResult<Station> selectByStationId(@RequestBody Integer id);

    // 根据条件查询电站信息
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectStationByCondition")
    DataResult<List<Station>> selectStationByCondition(@RequestBody StationPageReqVO vo);

    // 根据设备id查设备
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectByDeviceId")
    DataResult<Device> selectByDeviceId(@RequestBody Integer id);

    // 根据设备id查电站
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectByDeviceIds")
    DataResult<List<DeviceRespVO>> selectByDeviceIds(@RequestBody List<Integer> ids);

    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectByStationIdAndSrcId")
    DataResult<List<DeviceRespVO>> selectDeviceByStationIdsAndSrcId(@RequestBody Map<Integer, List<Integer>> map);

    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectDeviceByStationIdsAndSrcIdVirtual")
    DataResult<List<Device>> selectDeviceByStationIdsAndSrcIdVirtual(@RequestBody DeviceListReq deviceListReq);

    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectDeviceByDeviceType")
    DataResult<List<DeviceRespVO>> selectDeviceByDeviceType(@RequestBody String deviceType);

    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/getQueryEventParam")
    List<EventColReq> getQueryEventParam(@RequestBody DeviceListReq deviceListReq);

    //根据pid获取设备类型
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS +"outerApi/getDeviceTypeOne")
     DataResult<DeviceType> selectByPId(@RequestBody Integer pid);

    //根据pid获取设备类型
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS +"outerApi/getDeviceTypes")
    DataResult<List<DeviceType>> getDeviceTypes(@RequestBody List<Integer> deviceIds);

    //根据电站id查电站
    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectDeviceByStationIds")
    DataResult<List<Device>> selectDeviceByStationIds(@RequestBody DeviceReqVO deviceReqVO);

    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/getDeviceTypeConfigList")
    List<DeviceTypeConfig> getDeviceTypeConfigList(@RequestBody DeviceTypeQuery deviceTypeQuery);

    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/selectDeviceTypeCol")
    List<DeviceTypeCol> selectDeviceTypeCol(DeviceTypeColQueryVo vo);

    @PostMapping(value = ContextConstant.ROOT_CONTEXT +ContextConstant.BUSINESS + "outerApi/updateInspectionFault")
    DataResult updateInspectionFault(@RequestBody InspectionFaultVo vo);
}
