package com.yuchen.saas.device.api.feign;

import com.yuchen.saas.device.api.dto.*;
import com.yuchen.saas.device.api.entity.NetAlarmRecord;
import com.yuchen.saas.device.api.vo.NetAlarmLevelStatisticsVO;
import com.yuchen.saas.device.api.vo.NetAlarmTrendVo;
import com.yuchen.saas.park.api.dto.park.IoTEvent;
import com.yuchen.saas.park.api.entity.fault.ConnectEvent;
import com.yuchen.saas.park.api.vo.fault.DeviceProperty;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.mp.support.NestPage;
import org.nest.springwrap.core.tool.api.R;
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 yuanzhelin
 * @Date 2024/9/26 18:41
 * @Description TODO
 */
@FeignClient(
        value = AppNameConstant.SAAS_DEVICE,
        fallbackFactory = NetAlarmFeignFallback.class
)
public interface NetAlarmFeign {
    /**
     * 属性上报告警
     *
     */
    @PostMapping("/netAlarmRecord/property/alarm")
    R<Boolean> propertyAlarm(@RequestBody DeviceProperty deviceProperty);
    /**
     * 属性上报告警
     *
     */
    @PostMapping("/netAlarmRecord/connect/alarm")
    R<Boolean> connectAlarm(@RequestBody ConnectEvent connectEvent);
    /**
     * 属性上报告警
     *
     */
    @PostMapping("/netAlarmRecord/event/alarm")
    R<Boolean> eventAlarm(@RequestBody IoTEvent event);
    /**
     * 业务告警
     *
     */
    @PostMapping("/netAlarmRecord/service/alarm")
    R<Boolean> postServiceAlarmData(@RequestBody ServiceAlarmEvent serviceAlarmEvent);
    /**
     * 第三方平台告警
     *
     */
    @PostMapping("/netAlarmRecord/thirdParty/alarm")
    R<Boolean> postThirdPartyAlarmData(@RequestBody ThirdPartyAlarmEvent thirdPartyAlarmEvent);

    @PostMapping("/netAlarmRecord/app/page")
    R<NestPage<NetAlarmRecord>> alarmRecordPage(@RequestBody NetAlarmRecordPageDto qryDto);
    @PostMapping("/netAlarmStatistics/statistics")
    R<NetAlarmLevelStatisticsVO> statistics(@RequestBody NetAlarmLevelStatisticsDto qryDto);
    @PostMapping("/netAlarmStatistics/trend")
    R<List<NetAlarmTrendVo>> trend(@RequestBody NetAlarmTrendDto qryDto);
    @PostMapping("/netAlarmRecord/close")
    R close(@RequestBody NetAlarmCloseDto dto);
    @PostMapping("/netAlarmRecord/dispatched")
    R dispatched(@RequestBody NetAlarmDeployDto dto);
    @GetMapping("/netAlarmRecord/detail/{id}")
    R<NetAlarmRecord> detail(@PathVariable Long id);
}
