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.AlarmNoticeDto;
import com.sptg.iot.api.dto.IotAlarmDto;
import com.sptg.iot.api.dto.IotAlarmDto;
import com.sptg.iot.api.dto.IotSmsSendDto;
import com.sptg.iot.api.entity.IotAlarm;
import com.sptg.iot.api.entity.IotAlarm;
import com.sptg.iot.api.feigns.fallback.IotAlarmFeignFallbackFactory;
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;

import java.util.List;

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

    /**
     * 获取本地告警列表
     * @param iotAlarmDto
     * @return
     */
    @PostMapping(value = "/iot/alarm/list")
    public ResultBean<Page<IotAlarm>> showIotAlarmList(@RequestBody IotAlarmDto iotAlarmDto);

    /**
     * 分页获取本地告警列表
     * @param IotAlarmDto
     * @return
     */
    @PostMapping(value = "/iot/alarm/pagingQuery")
    public ResultBean<Page<IotAlarm>> pagingQuery(@RequestBody IotAlarmDto IotAlarmDto);

    /**
     * 功能描述:同步告警列表
     * @param iotAlarmDto
     * @return
     */
    @PostMapping(value = "/iot/alarm/sync/list")
    public ResultBean<String> syncIotAlarmList(@RequestBody IotAlarmDto iotAlarmDto);

    /**
     * 功能描述:同步告警详情（单个）
     * @return
     */
    @PostMapping(value = "/iot/alarm/sync/detail/one")
    public ResultBean<String> syncIotAlarmDetailOne(@RequestBody IotAlarmDto iotAlarmDto);

    /**
     * 功能描述:同步告警详情（批量）
     * @return
     */
    @PostMapping(value = "/iot/alarm/sync/detail/batch")
    public ResultBean<String> syncIotAlarmDetailBatch(@RequestBody List<IotAlarmDto> iotAlarmDtoList);

    /**
     * 功能描述:同步告警详情（全量）
     * @return
     */
    @PostMapping(value = "/iot/alarm/sync/detail/all")
    public ResultBean<String> syncIotAlarmDetailAll(@RequestBody IotAlarmDto iotAlarmDto);

    /**
     * 获取本地告警记录
     * @param alarmId
     * @return
     */
    @GetMapping(value = "/iot/alarm/getByAlarmId/{alarmId}")
    public IotAlarm getIotAlarmByAlarmId(@PathVariable(value = "alarmId") String alarmId);

    /**
     * 获取本地告警记录
     * @param id
     * @return
     */
    @GetMapping(value = "/iot/alarm/getIotAlarmById/{id}")
    public IotAlarm getIotAlarmById(@PathVariable(value = "id") Long id);

    /**
     * 告警上报通知
     * @param alarmNoticeDtoList
     * @return
     */
    @PostMapping(value = "/iot/alarm/notice")
    public ResultBean<String> alarmNotice(@RequestBody List<AlarmNoticeDto> alarmNoticeDtoList);

    /**
     * 新增告警
     * @param iotAlarmDto
     * @return
     */
    @PostMapping(value = "/iot/alarm/add")
    public ResultBean<Boolean> addAlarm(@RequestBody IotAlarmDto iotAlarmDto);

    /**
     * 告警短信推送
     * @param iotSmsSendDto
     * @return
     */
    @PostMapping(value = "/iot/alarm/sendSms")
    public ResultBean<Boolean> alarmSendSms(@RequestBody IotSmsSendDto iotSmsSendDto);
}
