package com.njcn.prepare.harmonic.api.event;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.harmonic.pojo.vo.PowerStatisticsTargetVO;
import com.njcn.prepare.harmonic.api.event.fallback.RActivePowerRangeFeignClientFallbackFactory;
import com.njcn.prepare.harmonic.pojo.param.RActivePowerRangeParam;
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;

/**
 * 有功功率趋势Feign客户端
 * @author guofeihu
 * @date 2024-08-22
 */
@FeignClient(
        value = ServerInfo.PREPARE_BOOT,//对应模块名
        path = "/rActivePowerRange",//对应controller请求类
        fallbackFactory = RActivePowerRangeFeignClientFallbackFactory.class//服务降级处理类
)
public interface RActivePowerRangeFeignClient {

    @PostMapping("/record")
    HttpResult<List<PowerStatisticsTargetVO>> record(@RequestBody(required = false) RActivePowerRangeParam rActivePowerRangeParam);

    @GetMapping("/getDataByLineId")
    HttpResult<RActivePowerRangePO> getDataByLineId(@RequestParam("lineId") String lineId,@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime);

}
