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.CsCommTerminalFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
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;

/**
 * @author xy
 */
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/commTerminal", fallbackFactory = CsCommTerminalFeignClientFallbackFactory.class,contextId = "deviceUser")
public interface CsCommTerminalFeignClient {

    @GetMapping("lineUnitDetail")
    HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId);

    @GetMapping("getDevIdsByUser")
    HttpResult<List<String>> getDevIdsByUser(@RequestParam("userId") String userId);

    @GetMapping("getLineIdsByUser")
    HttpResult<List<String>> getLineIdsByUser(@RequestParam("userId") String userId);

    @GetMapping("getPqUserIdsByUser")
    HttpResult<List<String>> getPqUserIdsByUser(@RequestParam("userId") String userId);

    @PostMapping("/getLedgerByLineId")
    HttpResult<List<DevDetailDTO>> getLedgerByLineId(@RequestBody List<String> list);
}
