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.CsEdDataFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.param.CsEdDataAddParm;
import com.njcn.csdevice.pojo.param.CsEdDataQueryParm;
import com.njcn.csdevice.pojo.po.CsEdDataPO;
import com.njcn.csdevice.pojo.vo.CsEdDataVO;
import io.swagger.annotations.ApiOperation;
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 = "/edData", fallbackFactory = CsEdDataFeignClientFallbackFactory.class, contextId = "edData")
public interface CsEdDataFeignClient {

    @PostMapping("/findByDevTypeId")
    HttpResult<CsEdDataVO> findByDevTypeId(@RequestParam("devType") String devType);

    @PostMapping("/getAll")
    HttpResult<List<CsEdDataPO>> getAll(@RequestParam("devType") String devType);

    @GetMapping("/getById")
    HttpResult<CsEdDataPO> getById(@RequestParam("id") String id);

    @GetMapping("/addEdDataFirst")
    @ApiOperation("首次录入版本信息")
    HttpResult<CsEdDataPO> addEdDataFirst(@RequestBody CsEdDataAddParm param);

    @GetMapping("/findByCondition")
    @ApiOperation("根据条件查询是否存在数据")
    HttpResult<CsEdDataPO> findByCondition(@RequestBody CsEdDataQueryParm param);

    @GetMapping("/findByPath")
    HttpResult<CsEdDataPO> findByPath(@RequestParam("filePath") String filePath);
}
