|
|
@@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.extend.service.ExtendDeviceService;
|
|
|
import com.genersoft.iot.vmp.vmanager.bean.StreamContent;
|
|
|
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
|
|
import com.genersoft.iot.vmp.vmanager.gb28181.play.PlayController;
|
|
|
+import com.genersoft.iot.vmp.vmanager.gb28181.ptz.PtzController;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.context.request.async.DeferredResult;
|
|
|
@@ -30,6 +31,14 @@ public class ExtendDeviceController {
|
|
|
@Resource
|
|
|
private PlayController playController;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private PtzController ptzController;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询设备
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@PostMapping("/page")
|
|
|
public PageInfo<ExtendDevice> page(@RequestBody ExtendDevicePageDto dto) {
|
|
|
if (dto.getPageNum() == 0) {
|
|
|
@@ -41,21 +50,52 @@ public class ExtendDeviceController {
|
|
|
return deviceService.page(dto);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据deviceId获取设备
|
|
|
+ * @param deviceIds
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping("/getDevices")
|
|
|
public Map<String,ExtendDevice> getDevices(@RequestParam List<String> deviceIds) {
|
|
|
return deviceService.getDevices(deviceIds);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询设备通道
|
|
|
+ * @param deviceId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping("/deviceChannel")
|
|
|
public List<ExtendDeviceChannel> deviceChannel(@RequestParam String deviceId) {
|
|
|
return deviceChannelService.deviceChannel(deviceId);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 播放实时视频
|
|
|
+ * @param request
|
|
|
+ * @param deviceId
|
|
|
+ * @param channelId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping("/start")
|
|
|
public DeferredResult<WVPResult<StreamContent>> start(HttpServletRequest request, @RequestParam String deviceId,
|
|
|
@RequestParam String channelId) {
|
|
|
return playController.play(request,deviceId,channelId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设备控制
|
|
|
+ * @param deviceId
|
|
|
+ */
|
|
|
+ @RequestMapping("/control")
|
|
|
+ public void control(@RequestParam String deviceId
|
|
|
+ ,@RequestParam String channelId
|
|
|
+ ,@RequestParam String command
|
|
|
+ ,@RequestParam int horizonSpeed
|
|
|
+ ,@RequestParam int verticalSpeed
|
|
|
+ ,@RequestParam int zoomSpeed) {
|
|
|
+ ptzController.ptz(deviceId,channelId,command,horizonSpeed,verticalSpeed,zoomSpeed);
|
|
|
+ }
|
|
|
+
|
|
|
}
|