package com.njcn.device.pq.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pq.api.fallback.SubstationFeignClientFallbackFactory;
import com.njcn.device.pq.pojo.dto.SubstationDTO;
import com.njcn.device.pq.pojo.po.LineDetail;
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;

/**
 * @author hongawen
 * @version 1.0.0
 * @date 2022年10月13日 19:54
 */
@FeignClient(value = ServerInfo.DEVICE, path = "/substation", fallbackFactory = SubstationFeignClientFallbackFactory.class,contextId = "substation")
public interface SubstationFeignClient {


    /**
     * 根据变电站ID获取变电站信息
     *
     * @param subId 变电站ID集合
     * @return 变电站信息
     */
    @PostMapping("getSubstationById")
    HttpResult<List<SubstationDTO>> getSubstationById(@RequestBody List<String> subId);


    @GetMapping("getMonitorByStationId")
    HttpResult<List<LineDetail>> getMonitorByStationId(@RequestParam("stationId") String stationId, @RequestParam("powerFlag") Integer powerFlag);
}
