package com.njcn.device.pq.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pq.api.fallback.DeptLineFeignClientFallbackFactory;
import com.njcn.device.pq.pojo.po.DeptLine;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;

/**
 * @author denghuajun
 * @date 2022/2/11
 *
 */
@FeignClient(value = ServerInfo.DEVICE,path = "/deptLine",fallbackFactory = DeptLineFeignClientFallbackFactory.class,contextId = "deptLine")
public interface DeptLineFeignClient {
    @PostMapping("/getLineByDeptId")
    HttpResult<List<String>> getLineByDeptId(@RequestParam("id")String id);

    @PostMapping("/getLineByDeptIdAndNewStation")
    HttpResult<List<String>> getLineByDeptIdAndNewStation(@RequestParam(value = "id",required = false)String id);

    @PostMapping("/selectDeptBindLines")
    HttpResult<Boolean> selectDeptBindLines(@RequestParam("ids") List<String> ids);

    @PostMapping("removeBind")
    HttpResult<Integer> removeBind(@RequestParam("id") String id);
    /**
    * @Description:获取部门和监测点的关系（分稳态暂态）
    * @Param: [devDataType] 0：暂态 1：稳态
    * @return: com.njcn.common.pojo.response.HttpResult<java.lang.Integer>
    * @Author: clam
    * @Date: 2022/10/19
    */
    @PostMapping("getLineByDeptRelation")
    HttpResult<Map<String,List<String>>> getLineByDeptRelation(@RequestParam("devDataType") Integer devDataType);

    @PostMapping("/getLineByLineIds")
    HttpResult<DeptLine> getLineByLineIds(@RequestParam("id") String ids);

    @PostMapping("/getDeptListByLineId")
    HttpResult<List<DeptLine>> getDeptListByLineId(@RequestParam("id") String ids);

    /**
    * @Description: 部门Id获取所有子集部门绑定监测点
    * @Param:
    * @return: com.njcn.common.pojo.response.HttpResult<java.util.List<java.lang.String>>
    * @Author: clam
    * @Date: 2024/5/29
    */
    @PostMapping("/getLineNodeByDeptId")
    HttpResult<List<String>> getLineNodeByDeptId(@RequestParam("id") String id);

    @PostMapping("/getAllData")
    HttpResult<List<DeptLine>> getAllData();
}
