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);
|
}
|
|
}
|