package com.njcn.device.biz.commApi;

import cn.hutool.core.date.TimeInterval;
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.biz.commApi.fallback.CommTerminalGeneralClientFallbackFactory;
import com.njcn.device.biz.pojo.dto.*;
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
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 springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 *
 * @author cdf
 * @date 2023/4/24
 */
@FeignClient(
        value = ServerInfo.DEVICE,
        path = "commTerminal",
        contextId = "commTerminal",
        fallbackFactory = CommTerminalGeneralClientFallbackFactory.class)
public interface CommTerminalGeneralClient {


    /**
     * 通过部门获取所有子级部门详情
     * @author cdf
     * @date 2023/5/15
     */
    @PostMapping("getDeptChildrenByParent")
    HttpResult<List<DeptGetBase>> getDeptChildrenByParent(@RequestBody @Validated DeptGetLineParam deptGetLineParam);


    /**
     * 根据单位获取监测点信息
     * @author cdf
     * @date 2023/5/10
     */
    @PostMapping("deptGetLine")
    HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);




    /**
     * 根据单位获取所有变电站
     * @author cdf
     * @date 2023/5/10
     */
    @PostMapping("deptGetSubStation")
    HttpResult<List<DeptGetSubStationDTO>> deptSubStation(@RequestBody @Validated DeptGetLineParam deptGetLineParam);

    /**
     * 根据单位获取所有变电站
     * @author cdf
     * @date 2023/5/10
     */
    @PostMapping("deptGetBusBar")
    HttpResult<List<DeptGetBusBarDTO>> deptBusBar(@RequestBody @Validated DeptGetLineParam deptGetLineParam);


    /**
     * 根据单位获取所有装置
     * @author cdf
     * @date 2023/5/10
     */
    @PostMapping("deptGetDevice")
    HttpResult<List<DeptGetDeviceDTO>> deptGetDevice(@RequestBody @Validated DeptGetLineParam deptGetLineParam);


    /**
     * 根据单站id获取监测点信息
     * @author cdf
     * @date 2023/5/10
     */
    @PostMapping("substationGetLine")
    HttpResult<LineDevGetBandDTO> substationGetLine(@RequestParam("substationId")String substationId);


    /**
     * 根据母线id获取监测点信息
     * @author cdf
     * @date 2023/5/10
     */
    @PostMapping("busBarGetLine")
    public HttpResult<List<LineDevGetDTO>> busBarGetLine(@RequestParam("busBarId")String busBarId);


    /**
     * 通过部门获取所有子集部门所拥有的监测点
     *
     * @param deptGetLineParam
     * @return 指定的部门监测点信息
     */
    @PostMapping("/deptGetLineIds")
    HttpResult<List<DeptGetChildrenDTO>> deptGetLineList(@RequestBody DeptGetLineParam deptGetLineParam);

    /**
     * 用于返回pq 还是pms系统
     * @author cdf
     * @date 2023/8/3
     */
    @GetMapping("isPqOrPms")
    HttpResult<String> isPqOrPms();

}
