package com.zcxk.charge.web.client;

import com.zcxk.charge.web.config.FeignConfig;
import com.zcxk.charge.api.dto.WorkOrderManageByAlarmDto;
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;

/**
 * @description 服务调用(运维管理)
 * @author  wangli
 * @data 2021/1/15 10:57
 */
@FeignClient(value = "operation-manager",configuration = {FeignConfig.class})
public interface OperationManagerClient {

    /**
    * 报警信息生产工单信息
    * @author Andy
    * @date 11:32 2021/8/18
    * @param workOrderManages:
    * @return java.lang.Integer
    **/
    @PostMapping("/order/workOrderManage/saveByAlarms")
    Integer saveByAlarms(@RequestBody List<WorkOrderManageByAlarmDto> workOrderManages);

    /**
    * batchDeleteByAlarms
    * @author Andy
    * @date 11:32 2021/8/18
    * @param deviceIds:
    * @return java.lang.Integer
    **/
    @PostMapping("/order/workOrderManage/batchDeleteByAlarms")
    Integer batchDeleteByAlarms(@RequestParam(name="deviceIds") List<Long> deviceIds);

    /**
    * updateByAlarms
    * @author Andy
    * @date 11:32 2021/8/18
    * @param workOrderManages:
    * @return void
    **/
    @PostMapping("/order/workOrderManage/updateByAlarms")
    void updateByAlarms(@RequestBody List<WorkOrderManageByAlarmDto> workOrderManages);

    /**
    * findWorkOrderByDeviceIds
    * @author Andy
    * @date 11:32 2021/8/18
    * @param deviceIds:
    * @return java.util.List<com.zcxk.charge.api.dto.WorkOrderManageByAlarmDto>
    **/
    @PostMapping("/order/workOrderManage/findWorkOrderByDeviceIds")
    List<WorkOrderManageByAlarmDto> findWorkOrderByDeviceIds(@RequestParam (name="deviceIds") List<Long> deviceIds);


}
