package com.sptg.third.api.feigns.grid;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.iot.api.dto.AlarmNoticeDto;
import com.sptg.iot.api.entity.IotDevice;
import com.sptg.third.api.feigns.grid.fallback.GridIotFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author zwx
 * @create 2020/11/28 19:40
 */
@FeignClient(value = "smart-house-third", fallbackFactory = GridIotFeignFallbackFactory.class)
public interface GridIotFeign {

    /**
     * 增量推送物联网设备到网格
     * @return
     */
    @PostMapping(value = "/third/grid/iot/device/increment/push")
    public ResultBean<String> gridIotDeviceIncrementPush();

    /**
     * 全量推送物联网设备到网格
     * @return
     */
    @PostMapping(value = "/third/grid/iot/device/total/push")
    public ResultBean<String> gridIotDeviceTotalPush();

    /**
     * 批量查询设备最新数据
     * @param iotDeviceList
     * @return
     */
    @PostMapping(value = "/third/grid/iot/device/push")
    public ResultBean<String> gridIotDevicePush(@RequestBody List<IotDevice> iotDeviceList);

    /**
     * 设备心跳数据推送
     * @param iotDevice
     * @return
     */
    @PostMapping(value = "/third/grid/iot/device/heartbeat/push")
    public ResultBean<String> gridIotDeviceHeartbeatPush(@RequestBody IotDevice iotDevice);

    /**
     * 设备状态数据推送
     * @param iotDevice
     * @return
     */
    @PostMapping(value = "/third/grid/iot/device/status/push")
    public ResultBean<String> gridIotDeviceStatusPush(@RequestBody IotDevice iotDevice);

    /**
     * 推送物联网设备告警到网格
     * @param alarmNoticeDtoList
     * @return
     */
    @PostMapping(value = "/third/grid/alarm/push")
    public ResultBean<String> gridIotAlarmPush(@RequestBody List<AlarmNoticeDto> alarmNoticeDtoList);
}
