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.DistributionMonitorClientFallbackFactory;
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
import com.njcn.device.pms.pojo.param.pwUser.PwUserMonitorParam;
import com.njcn.device.pms.pojo.po.DistributionMonitor;
import com.njcn.device.pms.pojo.vo.DoubleUserVO;
import com.njcn.device.pms.pojo.vo.pwUser.PwUserMonitorDataVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
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 yzh
 * @date 2022/10/18
 */
@FeignClient(
        value = ServerInfo.DEVICE,
        path = "/pms/distributionMonitor",
        contextId = "pms/distributionMonitor",
        fallbackFactory = DistributionMonitorClientFallbackFactory.class)
public interface DistributionMonitorClient {

    /**
     * 获取指定组织下的发电用电用户
     * @author cdf
     * @date 2022/11/15
     */
    @PostMapping("/getDoubleUserByDept")
    HttpResult<List<DoubleUserVO>> getDoubleUserByDept(@RequestParam("orgId")String orgId);

    /**
     * 获取配网监测点数据
     * @author cdf
     * @date 2022/11/29
     */
    @PostMapping("distributionMonitorList")
    HttpResult<List<DistributionMonitor>> distributionMonitorList(@RequestBody List<String> monitorIds);
    /**
    * @Description: 获取配网所有监测点数据
    * @Param: []
    * @return: com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.po.DistributionMonitor>>
    * @Author: clam
    * @Date: 2022/12/13
    */
    @PostMapping("distributionMonitorListByCondition")
    public HttpResult<List<DistributionMonitor>> distributionMonitorListByCondition(@RequestParam("orgId")String orgId,@RequestParam("monitorSort")String monitorSort);

    @PostMapping("pwMonitorAreaDetailInfo")
    HttpResult<List<PwPmsMonitorDTO>> pwMonitorAreaDetailInfo(@RequestBody List<String> monitorIds);

    @PostMapping("getPwUserIds")
    HttpResult<List<PwUserMonitorDataVO>> getPwUserIds(@RequestBody @Validated PwUserMonitorParam pwUserMonitorParam);


}
