package com.njcn.device.pms.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pms.api.fallback.PmsGeneratrixClientFallbackFactory;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO;
import com.njcn.device.pms.pojo.param.PmsGeneratrixParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author yzh
 * @date 2022/10/18
 */
@FeignClient(value = ServerInfo.DEVICE,
        path = "/pms/generatrixWire",
        contextId = "pmsGeneratrixWire",
        fallbackFactory = PmsGeneratrixClientFallbackFactory.class)
public interface PmsGeneratrixClient {

    /**
     * 获取母线信息
     *
     * @param pmsGeneratrixParam 入参
     * @return 母线信息
     */
    @PostMapping("/getGeneratrixInfo")
    HttpResult<List<PmsGeneratrixDTO>> getGeneratrixInfo(@RequestBody PmsGeneratrixParam pmsGeneratrixParam);

    /**
     * 获取母线与电站关联信息
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>>
     * @author yzh
     * @date 2022/11/3
     */
    @PostMapping("/getGeneratrixAndPowerStationInfo")
    HttpResult<List<GeneratrixAndPowerStationDTO>> getGeneratrixAndPowerStationInfo(@RequestBody PmsGeneratrixParam param);
}
