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.DataArrayFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.param.DataArrayParam;
import com.njcn.csdevice.pojo.po.CsDataArray;
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
import org.springframework.cloud.openfeign.FeignClient;
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 = "/csDataArray", fallbackFactory = DataArrayFeignClientFallbackFactory.class,contextId = "csDataArray")

public interface DataArrayFeignClient {

    @PostMapping("/getArrayBySet")
    HttpResult<List<CsDataArray>> getArrayBySet(@RequestParam("dataSet") String dataSet);

    @PostMapping("/getDataArray")
    HttpResult<List<DataArrayTreeVO>> getDataArray(@RequestBody List<String> dataSetList);

    @PostMapping("/getDataArrayById")
    HttpResult<List<CsDataArray>> getDataArrayById(@RequestParam("pid") String pid, @RequestParam("name") String name);

    @PostMapping("/getDataArrayByIds")
    HttpResult<List<CsDataArray>> getDataArrayByIds(@RequestParam("ids") List<String> ids);

    @PostMapping("/findListByParam")
    HttpResult<List<CsDataArray>> findListByParam(@RequestBody DataArrayParam param);

    }
