package com.ho.business.feignclient;

import com.ho.business.vo.resp.point.PointCurveResp;
import com.ho.common.tools.constant.ContextConstant;
import com.ho.common.tools.exception.DataResult;
import com.ho.common.tools.util.PageResult;
import com.ho.common.tools.vo.req.PointData;
import com.ho.common.tools.vo.req.StationHomeRespVo;
import com.ho.datacollect.api.vo.req.add.TdBase;
import com.ho.datacollect.api.vo.req.inverter.InverterCurveListVo;
import com.ho.td.api.entity.elecMeter.ElecPowerGeneration;
import com.ho.td.api.entity.inverter.InverterCurrent;
import com.ho.td.api.entity.inverter.InverterTimingGenerate;
import com.ho.td.api.entity.query.TdBaseTimeQuery;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @描述 调用td-service
 * @创建时间 2021/8/9
 * @修改人
 */
@FeignClient(value = ContextConstant.TD_SERVICE, fallback = TdFeignClientFallback.class)
public interface TdFeignClient {

    //逆变器
    @PostMapping(value = ContextConstant.TD_CONTEXT + "inverter/queryInterval")
    DataResult<InverterCurveListVo> queryInterval(@RequestBody TdBase tdBase);

    //查询逆变器单独字段的历史数据
    @PostMapping(value = ContextConstant.TD_CONTEXT + "inverter/queryHistoryInterval")
    DataResult<InverterCurveListVo> queryHistoryInterval(@RequestBody TdBase tdBase);

    //查询逆变器单独字段的历史列表数据
    @PostMapping(value = ContextConstant.TD_CONTEXT + "inverter/queryColList")
    DataResult<InverterCurveListVo> queryColList(@RequestBody TdBase tdBase);

    //逆变器每15分钟的发电量列表
    @PostMapping(value = ContextConstant.TD_CONTEXT + "inverter/timingGenerateList")
    DataResult<List<InverterTimingGenerate>> timingGenerateList(@RequestBody TdBaseTimeQuery baseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "inverter/getCurrentMonthAndYear")
    DataResult<List<InverterCurrent>> getCurrentMonthAndYear(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/queryPointTable")
    DataResult<List<PointCurveResp>> queryPointTable(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getTodayPowerGeneration")
    DataResult<ElecPowerGeneration> getTodayPowerGeneration(TdBaseTimeQuery tdBaseTimeQuery);


    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getPointTable")
    DataResult<List<StationHomeRespVo>> getPointTable(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getPointDataShow")
    DataResult<List<PointData>> getPointDataShow(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getPointDetails")
    DataResult<List<PointData>> getPointDetails(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getCountPointDataShow")
    Integer getCountPointDataShow(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);


    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getPointData")
    DataResult<List<PointData>> getPointData(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    //查询遥信值
    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/querySignalValue")
    DataResult<List<PointCurveResp>> querySignalValue(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    // 查询历史值
    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/queryHisValueList")
    DataResult<List<StationHomeRespVo>> queryHisValueList(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    //查询所有的点位数据
    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/queryAllValue")
    PageResult queryAllValue(TdBase tdBase);


    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getCountData")
    Integer getCountData(@RequestBody TdBase tdBase);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/selectMaxValue")
     DataResult<PointData> selectMaxValue(@RequestBody TdBaseTimeQuery query);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/queryPointTableList")
    DataResult<List<StationHomeRespVo>> queryPointTableList(@RequestBody TdBaseTimeQuery query);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/queryPointDataList")
    DataResult<List<StationHomeRespVo>> queryPointDataList(@RequestBody TdBaseTimeQuery query);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getGeneratorSetInfo")
    DataResult<StationHomeRespVo> getGeneratorSetInfo(TdBaseTimeQuery tdBaseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getToDayPVCharge")
    DataResult<StationHomeRespVo> getToDayPVCharge(TdBaseTimeQuery tdBaseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/getToDayPVMpptCharge")
    DataResult<StationHomeRespVo> getToDayPVMpptCharge(TdBaseTimeQuery tdBaseTimeQuery);

    //查询遥信值五遥
    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/querySignal")
    DataResult<List<PointCurveResp>> querySignal(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    //查询遥测值五遥
    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/queryMeasure")
    DataResult<List<PointCurveResp>> queryMeasure(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    //更新测点历史值
    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/modifyHistoryData")
    DataResult modifyHistoryData(@RequestBody TdBaseTimeQuery tdBaseTimeQuery);

    @PostMapping(value = ContextConstant.TD_CONTEXT + "device001/selectLastedValue")
    DataResult<PointData> selectLastedValue(@RequestBody TdBaseTimeQuery query);

}

