package com.njcn.device.pms.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
import com.njcn.device.pms.pojo.param.*;
import com.njcn.device.pms.pojo.param.gw.TypicalSourceParam;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.device.pms.pojo.vo.gw.TypicalSourceOnLine;
import org.springframework.cloud.openfeign.FeignClient;
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/monitor",
        contextId = "pms/monitor",
        fallbackFactory = MonitorClientFallbackFactory.class)
public interface MonitorClient {

    /**
     * 获取指定的监测点信息
     *
     * @param pmsMonitorInfoParam 获取监测点详情数据入参
     * @return 指定的监测点信息
     */
    @PostMapping("/getMonitorInfo")
    HttpResult<List<PmsMonitorInfoDTO>> getMonitorInfo(@RequestBody PmsMonitorInfoParam pmsMonitorInfoParam);

    /***
     * 根据条件获取监测点信息列表
     * @author jianghaifei
     * @date 2022-10-20 22:53
     * @param pmsMonitorParam
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.device.pms.pojo.dto.PmsMonitorDTO>>
     */
    @PostMapping("/getMonitorInfoListByCond")
    HttpResult<List<PmsMonitorDTO>> getMonitorInfoListByCond(@RequestBody PmsMonitorParam pmsMonitorParam);


    /**
     * 根据监测点id获取限值
     *
     * @param id 监测点id
     * @return 获取限值
     */
    @PostMapping("getOverLimitData")
    HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id);


    /**
     * 获取主网监测点数据
     * @author cdf
     * @date 2022/11/29
     */
    @PostMapping("getMonitorList")
    HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds);


    /**
     * 通过同源监测点编码获取监测点信息
     * @author cdf
     * @date 2022/11/29
     */
    @PostMapping("getMonitorListByMid")
    HttpResult<List<Monitor>> getMonitorListByMid(@RequestBody List<String> midIds);

    @PostMapping("getMonitorPage")
    HttpResult<Page<Monitor>> getMonitorPage(@RequestBody TerminalQueryParam baseParam);


   /***
    * 获取台账和终端信息(波形专用)
    * @author wr
    * @date 2023-03-23 10:53
    * @param param
    * @return HttpResult<List<Monitor>>
    */
    @PostMapping("getMonitorTerminal")
    HttpResult<MonitorVO> getMonitorTerminal(@RequestBody MonitorTerminalParam param);

    /**
     * @Description: 典型源荷下穿监测点信息接口
     * @Author: wr
     * @Date: 2024/5/27 14:00
     */
    @PostMapping("/monitorTypicalList")
    HttpResult<Page<TypicalSourceOnLine>> monitorTypicalList(@RequestBody TypicalSourceParam param);

    @PostMapping("/getMonitorListByParam")
    HttpResult<List<Monitor>> getMonitorListByParam(@RequestBody MonitorParam monitorParam);
}
