package com.sptg.iot.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.iot.api.dto.IotAlarmDto;
import com.sptg.iot.api.dto.IotAlarmWorkOrderDto;
import com.sptg.iot.api.entity.IotAlarm;
import com.sptg.iot.api.entity.IotAlarmWorkOrder;
import com.sptg.iot.api.feigns.fallback.IotDeviceWorkOrderFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author zwx
 * @create 2020/10/19 22:52
 */
@FeignClient(value = "smart-house-iot", fallbackFactory = IotDeviceWorkOrderFeignFallbackFactory.class)
public interface IotAlarmWorkOrderFeign {

    /**
     * 获取本地告警工单列表
     * @param iotAlarmWorkOrderDto
     * @return
     */
    @PostMapping(value = "/iot/alarmWorkOrder/list")
    public ResultBean<Page<IotAlarmWorkOrder>> showIotAlarmWorkOrderList(@RequestBody IotAlarmWorkOrderDto iotAlarmWorkOrderDto);

    @PostMapping(value = "/iot/alarmWorkOrder/sync/list")
    public ResultBean<String> syncIotAlarmWorkOrderList(@RequestBody IotAlarmWorkOrderDto iotAlarmWorkOrderDto);

    @PostMapping(value = "/iot/alarmWorkOrder/update")
    public ResultBean<String> updateIotAlarmWorkOrder(@RequestBody IotAlarmWorkOrderDto iotAlarmWorkOrderDto);

    /**
     * 分页获取本地告警工单列表
     * @param iotAlarmWorkOrderDto
     * @return
     */
    @PostMapping(value = "/iot/iotAlarmWorkOrder/pagingQuery")
    public ResultBean<Page<IotAlarmWorkOrder>> pagingQuery(@RequestBody IotAlarmWorkOrderDto iotAlarmWorkOrderDto);

    /**
     * 获取本地告警工单记录
     * @param id
     * @return
     */
    @GetMapping(value = "/iot/iotAlarmWorkOrder/getIotAlarmWorkOrderById/{id}")
    public IotAlarmWorkOrder getIotAlarmWorkOrderById(@PathVariable(value = "id") Long id);
}
