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.EquipmentFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author xy
 */
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/EquipmentDelivery", fallbackFactory = EquipmentFeignClientFallbackFactory.class,contextId = "EquipmentDelivery")
public interface EquipmentFeignClient {

    @PostMapping("/queryEquipmentByndid")
    HttpResult<CsEquipmentDeliveryVO> queryEquipmentByndid(@RequestParam("ndid") String ndid);

    @PostMapping("/updateStatusBynDid")
    HttpResult<Boolean> updateStatusBynDid(@RequestParam("nDId") String nDid,@RequestParam("status")  Integer status);
    @PostMapping("/queryEquipmentById")
    HttpResult<List<CsEquipmentDeliveryDTO>> queryDeviceById(@RequestParam("ids") List<String> ids);

    @PostMapping("/updateSoftInfoBynDid")
    HttpResult<Boolean> updateSoftInfoBynDid(@RequestParam("nDId") String nDid, @RequestParam("id")  String id, @RequestParam("module") Integer module);

    /**
     * 根据nDid查询设备信息
     * @param nDid
     * @return
     */
    @PostMapping("/findDevByNDid")
    HttpResult<CsEquipmentDeliveryPO> findDevByNDid(@RequestParam("nDid") String nDid);

    /**
     * 根据nDid更新软件信息
     * @return
     */
    @PostMapping("/updateSoftInfo")
    HttpResult<String> updateSoftInfo(@RequestParam("nDid") String nDid,@RequestParam("id") String id);

    /**
     * 根据nDid更新模块信息
     * @return
     */
    @PostMapping("/updateModuleNumber")
    HttpResult<String> updateModuleNumber(@RequestParam("nDid") String nDid,@RequestParam("number") Integer number);

    @PostMapping("/getAll")
    HttpResult<List<CsEquipmentDeliveryPO>> getAll();

    @PostMapping("/judgeDevModel")
    HttpResult<Boolean> judgeDevModel(@RequestParam("nDid") String nDid);

    @PostMapping("/getDevByLineId")
    HttpResult<CsEquipmentDeliveryPO> getDevByLineId(@RequestParam("lineId") String lineId);

    @PostMapping("/updateCldDevStatus")
    HttpResult<Boolean> updateCldDevStatus(@RequestParam("nodeId") String nodeId, @RequestParam("processNo") Integer processNo);

    @PostMapping("/flipCldDevStatus")
    HttpResult<Boolean> flipCldDevStatus(@RequestParam("date") String date, @RequestParam("devId") String devId, @RequestParam("status") Integer status);
}
