package com.njcn.device.biz.commApi;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.biz.commApi.fallback.CommLineClientFallbackFactory;
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
import com.njcn.device.biz.pojo.dto.LineDTO;
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
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;

/**
 * pqs
 *
 * @author cdf
 * @date 2023/9/14
 */
@FeignClient(
        value = ServerInfo.DEVICE,
        path = "commLine",
        contextId = "commLine",
        fallbackFactory = CommLineClientFallbackFactory.class)
public interface CommLineClient {

    /**
     * @param id id
     * @Description: 获取监测点信息
     * @Author: wr
     * @Date: 2023/9/22 11:11
     */
    @GetMapping("/getLineDetail")
    HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id);

    /**
     * 获取污区值监测点相关信息
     *
     * @author hongawen
     */
    @GetMapping("/getPollutionLineInfo")
    HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(@RequestParam("id") List<String> id);

    /***
     * 批量获取监测点信息
     * @author hongawen
     * @date 2023/11/3 15:25
     * @param ids 监测点索引集合
     */
    @PostMapping("/getLineDetailBatch")
    HttpResult<List<LineDTO>> getLineDetailBatch(@RequestBody List<String> ids);



    @GetMapping("/getLineAllDetail")
    HttpResult<LineALLInfoDTO>  getLineAllDetail(@RequestParam("id") String id);


    @GetMapping("/getLineAllDetailList")
    HttpResult<List<LineALLInfoDTO>>  getLineAllDetailList(@RequestParam("ids") List<String> ids);

    @PostMapping("/getLineInfo")
    HttpResult<List<PollutionLineDTO>>  getLineInfo(@RequestBody List<String> ids);

}
