package cn.iocoder.yudao.module.system.controller.admin.biz;

import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.DeviceWarnPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.DeviceWarnRespVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.DeviceWarnSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.DeviceWarnDO;
import cn.iocoder.yudao.module.system.service.biz.DeviceWarnService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import java.io.IOException;
import java.util.List;

import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * @Author: jinyd
 * @CreateTime: 2024/11/4  13:37
 * @Description:
 * @Version: 4.0
 */


@Tag(name = "管理后台 - 设备报警")
@RestController
@RequestMapping("/device/warn")
@Validated
public class DeviceWarnController {

    @Resource
    private DeviceWarnService warnService;

    @GetMapping("/page")
    @Operation(summary = "获得设备报警分页")
    @PreAuthorize("@ss.hasPermission('device:warn:query')")
    public CommonResult<PageResult<DeviceWarnRespVO>> getWarnPage(@Valid DeviceWarnPageReqVO pageReqVO) {
        PageResult<DeviceWarnRespVO> pageResult = warnService.getWarnPage(pageReqVO);
        return success(pageResult);
    }


}
