package com.njcn.csdevice.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
import com.njcn.csdevice.pojo.dto.CsLineDTO;
import com.njcn.csdevice.pojo.param.CsLineParam;
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.csdevice.pojo.po.CsLinePO;
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
import com.njcn.device.biz.pojo.po.Overlimit;
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 java.util.List;
import java.util.Map;

/**
 * @author xy
 */
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/csline", fallbackFactory = CsLineClientFallbackFactory.class,contextId = "csline")
public interface CsLineFeignClient {

    @PostMapping("/queryLineById")
     HttpResult<List<CsLinePO>> queryLineById(@RequestBody List<String> ids );

    @PostMapping("/queryLineByDevId")
     HttpResult<List<CsLinePO>> queryLineByDevId(@RequestParam("id") String id);

    @PostMapping("/addList")
    HttpResult<String> addLineList(@RequestBody List<CsLinePO> list);

    @PostMapping("/findByNdid")
    HttpResult<List<CsLinePO>> findByNdid(@RequestParam("id") String id);


    @GetMapping("/getCustomDetailByLineId")
    HttpResult<Map<String,String>> getCustomDetailByLineId(@RequestParam("id") String id);

    @PostMapping("/getPositionById")
    HttpResult<String> getPositionById(@RequestParam("id") String id);

    @PostMapping("/updateLine")
    HttpResult<String> updateLine(@RequestBody CsLineParam csLineParam);

    @PostMapping("/updateIds")
    HttpResult<Boolean> updateIds(@RequestBody @Validated CsLineParam csLineParam);

    @PostMapping("/getById")
    HttpResult<CsLinePO> getById(@RequestParam("lineId") String lineId);

    @PostMapping("/getLinesByDevList")
    HttpResult<List<CsLinePO>> getLinesByDevList(@RequestBody List<String> ids);

    @PostMapping("/updateLineDataByList")
    HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId);

    @PostMapping("/getLineByName")
    HttpResult<List<CsLinePO>> getLineByName(@RequestParam("lineName") String lineName);

    @PostMapping("/getAllLine")
    HttpResult<List<String>> getAllLine();

    @PostMapping("/getAllLineDetail")
    HttpResult<List<CsLineDTO>> getAllLineDetail();

    @PostMapping("/getOverLimitDataByIds")
    HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids);

    @PostMapping("/getDevBySensitiveUser")
    @ApiOperation("根据敏感用户查询装置")
    HttpResult<List<CsEquipmentDeliveryPO>> getDevBySensitiveUser(@RequestBody List<String> list);

    @PostMapping("/list")
    HttpResult<List<CsLinePO>> list(@RequestBody CsLinePO param);

    @PostMapping("/getLineDetailData")
    HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id);

    @GetMapping("/getSimpleLine")
    HttpResult<List<CsLinePO>> getSimpleLine();

}
