package com.ruoyi.web.controller.camera;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.PersonnelManagement;
import com.ruoyi.system.domain.vo.CameraInfoVo;
import com.ruoyi.system.service.CameraService;
import com.ruoyi.system.service.IPersonnelManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 人员管理Controller
 *
 * @author ruoyi
 * @date 2024-02-28
 */
@RestController
@RequestMapping("/camera")
public class CameraController extends BaseController {

    @Autowired
    private CameraService cameraService;

    /**
     * 查询安防设备列表
     */
    @PreAuthorize("@ss.hasPermi('system:camera:list')")
    @GetMapping("/list")
    public AjaxResult list(CameraInfoVo cameraInfoVo) {
        return cameraService.selectCameraList(cameraInfoVo);
    }


    /**
     * 获取设备视频地址
     */
    @PreAuthorize("@ss.hasPermi('system:camera:video')")
    @GetMapping("/video/{cameraIndexCode}")
    public AjaxResult video(@PathVariable String cameraIndexCode) {
        return cameraService.video(cameraIndexCode);
    }


}
