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.DataSetFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.po.CsDataSet;
import com.njcn.csdevice.pojo.vo.LineTargetVO;
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 = "/csDataSet", fallbackFactory = DataSetFeignClientFallbackFactory.class,contextId = "csDataSet")

public interface DataSetFeignClient {

    @PostMapping("/getSetByModelId")
    HttpResult<List<CsDataSet>> getSetByModelId(@RequestParam("modelId") String modelId,@RequestParam("clDev") Integer clDev);

    @PostMapping("/getDataSet")
    HttpResult<List<LineTargetVO>> getDataSet(@RequestParam("modelId") String modelId,@RequestParam("clDev") Integer clDev);

    @PostMapping("/getModuleDataSet")
    HttpResult<List<CsDataSet>> getModuleDataSet(@RequestParam("modelId") String modelId);

    @PostMapping("/getDataSetBySetIds")
    HttpResult<List<CsDataSet>> getDataSetBySetIds(@RequestBody List<String> lineIds);

    @PostMapping("/getBaseDataSet")
    HttpResult<CsDataSet> getBaseDataSet(@RequestParam("modelId") String modelId,@RequestParam("clDev") Integer clDev);

    @PostMapping("/getHarmonicDataSet")
    HttpResult<CsDataSet> getHarmonicDataSet(@RequestParam("modelId") String modelId,@RequestParam("clDev") Integer clDev,@RequestParam("target") Integer target);

    @PostMapping("/getDataSetByIdx")
    HttpResult<CsDataSet> getDataSetByIdx(@RequestParam("modelId") String modelId,@RequestParam("idx") Integer idx);

}
