package com.ycl.controller;
|
|
import com.ycl.domain.form.CameraCommandForm;
|
import com.ycl.domain.query.CameraPlayQuery;
|
import com.ycl.domain.query.CameraQuery;
|
import com.ycl.domain.result.Result;
|
import com.ycl.service.HKService;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Map;
|
|
/**
|
* @author:xp
|
* @date:2024/12/20 11:08
|
*/
|
@RestController
|
@RequestMapping("/video")
|
public class CameraController {
|
|
private final HKService hkService;
|
|
public CameraController(HKService hkService) {
|
this.hkService = hkService;
|
}
|
|
// /**
|
// * 获取摄像头列表
|
// *
|
// * @param query 查询条件
|
// * @return
|
// */
|
// @GetMapping("/camera/page")
|
// public Result getCamerasPage(CameraQuery query) {
|
// Map<String, Object> result = hkService.getCamerasPage(query);
|
// return Result.ok().data(result.get("list")).total((Integer) result.get("total"));
|
// }
|
//
|
//
|
// /**
|
// * 获取摄像头实时的视频流地址
|
// *
|
// * @param query 点播参数
|
// * @return
|
// */
|
// @GetMapping("/camera/video/play")
|
// public Result getCameraVideoStreamUrl(CameraPlayQuery query) {
|
// Map<String, Object> result = hkService.previewURLs(query);
|
// return Result.ok().data(result.get("url"));
|
// }
|
|
|
/**
|
* 控制摄像头
|
*
|
* @param form 控制参数
|
* @return
|
*/
|
@PostMapping("/camera/command")
|
public Result setCameraCommand(@RequestBody CameraCommandForm form) {
|
Boolean success = hkService.controlling(form);
|
if (success) {
|
return Result.ok("操作成功");
|
} else {
|
return Result.error("操作失败");
|
}
|
}
|
|
|
}
|