package com.njcn.harmonic.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.harmonic.api.fallback.HarmDataFeignClientFallbackFactory;
import com.njcn.harmonic.pojo.param.HistoryHarmParam;
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
import com.njcn.harmonic.pojo.vo.AssessEvaluation;
import com.njcn.influx.pojo.dto.HarmHistoryDataDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(
        value = ServerInfo.HARMONIC,
        path = "/harmonic",
        fallbackFactory = HarmDataFeignClientFallbackFactory.class,
        contextId = "harmonic")
public interface HarmDataFeignClient {


    /**
     * 获取监测点信息
     * @param  historyHarmParam 请求查询参数
     * @return 结果
     */
    @PostMapping("/getHistoryHarmData")
    HttpResult<HarmHistoryDataDTO> getHistoryHarmData(@RequestBody HistoryHarmParam historyHarmParam);

    /**
     * 获取越线监测点
     * @param param
     * @return
     */
    @PostMapping("/getLinesTarget")
    HttpResult<List<String>> getLinesTarget(@RequestBody StatSubstationBizBaseParam param);

    /**
     * 获取越线监测点越线次数
     * @param param
     * @return
     */
    @PostMapping("/getLinesRate")
    HttpResult<List<RStatLimitRateDPO>> getLinesRate(@RequestBody StatSubstationBizBaseParam param);


    /**
     * 评估结果获取谐波电压和谐波电流含有率、三项不平横度和负序电流
     * @param param
     * @return
     */
    @PostMapping("/getHarmIAndHarmVData")
    HttpResult<AssessEvaluation> getHarmIAndHarmVData(@RequestBody StatisticsBizBaseParam param);
}
