package com.sptg.gateway.controller.iot;

import com.baomidou.mybatisplus.annotations.TableField;
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.IotAlarmFeign;
import com.sptg.iot.api.feigns.IotAlarmWorkOrderFeign;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zwx
 * @create 2020/11/4 15:53
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping(value = "/grid/iot/alarm/order")
public class IotAlarmWorkOrderController {

    private final IotAlarmWorkOrderFeign iotAlarmWorkOrderFeign;

    /**
     * 功能描述:IOT物联网告警列表查询
     * @param iotAlarmDto IOT物联网告警业务对象（含查询条件）
     * @param page 分页条件
     * @return ResultBean<Page<IotAlarm>>
     *
     *
     */
    @GetMapping(value = "/list")
    public ResultBean<Page<IotAlarmWorkOrder>> showIotAlarmWorkOrderList(IotAlarmWorkOrderDto iotAlarmDto, Page<IotAlarmWorkOrder> page) {
        // 暂时拿全部的数据
//        iotDeviceDto.setOrgPosition("0/1/");
        iotAlarmDto.setPage(page);
        return this.iotAlarmWorkOrderFeign.showIotAlarmWorkOrderList(iotAlarmDto);
    }
}
