package com.njcn.csharmonic.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csharmonic.api.fallback.CsHarmonicPlanLineFeignClientFallbackFactory;
import com.njcn.csharmonic.param.CsHarmonicPlanLineParam;
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;

/**
 * @author xy
 */
@FeignClient(value = ServerInfo.CS_HARMONIC_BOOT, path = "/csHarmonicPlanLine", fallbackFactory = CsHarmonicPlanLineFeignClientFallbackFactory.class,contextId = "csHarmonicPlanLine")
public interface CsHarmonicPlanLineFeignClient {

    @GetMapping("/getPlanIdByLineId")
    @ApiOperation("根据监测点ID查询方案ID")
    HttpResult<String> getPlanIdByLineId(@RequestParam("lineId") String lineId);

    @PostMapping("/savePlanLines")
    @ApiOperation("新增方案与监测点关联")
    HttpResult<Boolean> savePlanLines(@RequestBody @Validated CsHarmonicPlanLineParam param);

    @PostMapping("/deleteByLineIds")
    @ApiOperation("根据监测点ID集合删除关联")
    HttpResult<Boolean> deleteByLineIds(@RequestBody List<String> lineIds);

}
