xuhy
2026-03-11 f2935d61940b9a156c1bfd99e8f82ebb7fe1370b
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
39
40
41
42
43
44
45
46
47
48
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.DevicePlayerQuery;
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;
    @Autowired
    private DevicePlayerQuery devicePlayerQuery;
 
    @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);
    }
 
    @ApiOperation(value = "获取视频播放操作链接")
    @GetMapping("/getPlayerUrlByDeviceId")
    public R<JSONObject> getPlayerUrlByDeviceId(@RequestParam String deviceId) {
        JSONObject deviceLiveUrl = devicePlayerQuery.getDevicePlayerList(deviceId);
        return R.ok(deviceLiveUrl);
    }
 
}