xuhy
2026-03-11 67bf2fb3c479e791d008d7bbf7ad9f88adca6a44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.ruoyi.web.controller.api;
 
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.query.DevicePageListQuery;
import com.ruoyi.web.controller.tool.monitor.DeviceLiveQuery;
import com.ruoyi.web.controller.tool.monitor.DeviceQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@Api(tags = "监控对接")
@RestController
@RequestMapping("/monitor")
public class MonitorController {
 
 
    @Autowired
    private DeviceQuery deviceQuery;
    @Autowired
    private DeviceLiveQuery deviceLiveQuery;
 
    @ApiOperation(value = "获取监控设备分页列表")
    @PostMapping("/devicePageList")
    public R<JSONObject> devicePageList(@RequestBody DevicePageListQuery query) {
        JSONObject deviceList = deviceQuery.getDeviceList(query.getPage(), query.getPageSize(), query.getOnlineStatus());
        return R.ok(deviceList);
    }
 
    @ApiOperation(value = "获取监控直播链接")
    @GetMapping("/getLiveUrlByDeviceId")
    public R<JSONObject> getLiveUrlByDeviceId(@RequestParam String deviceId) {
        JSONObject deviceLiveUrl = deviceLiveQuery.getDeviceLiveList(deviceId);
        return R.ok(deviceLiveUrl);
    }
 
}