From cf8a22f50b81fa30abaa518bdce660cd65deabea Mon Sep 17 00:00:00 2001
From: panlinlin <648540858@qq.com>
Date: 星期五, 15 一月 2021 15:33:24 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java |   44 ++++++++++++++++++++++++++++++++------------
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java
index 87e6bf2..4c41e16 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java
@@ -29,25 +29,45 @@
 	private IVideoManagerStorager storager;
 
 	/***
-	 * http://localhost:8080/api/ptz/34020000001320000002_34020000001320000008?leftRight=1&upDown=0&inOut=0&moveSpeed=50&zoomSpeed=0
-	 * @param deviceId
-	 * @param channelId
-	 * @param leftRight
-	 * @param upDown
-	 * @param inOut
-	 * @param moveSpeed
-	 * @param zoomSpeed
-	 * @return
+	 * 浜戝彴鎺у埗
+	 * @param deviceId 璁惧id
+	 * @param channelId 閫氶亾id
+	 * @param cmdCode		鎸囦护鐮�
+	 * @param horizonSpeed	姘村钩绉诲姩閫熷害
+	 * @param verticalSpeed	鍨傜洿绉诲姩閫熷害
+	 * @param zoomSpeed	    缂╂斁閫熷害
+	 * @return String 鎺у埗缁撴灉
 	 */
 	@PostMapping("/ptz/{deviceId}/{channelId}")
-	public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int leftRight, int upDown, int inOut, int moveSpeed, int zoomSpeed){
+	public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed){
 		
 		if (logger.isDebugEnabled()) {
-			logger.debug(String.format("璁惧浜戝彴鎺у埗 API璋冪敤锛宒eviceId锛�%s 锛宑hannelId锛�%s 锛宭eftRight锛�%d 锛寀pDown锛�%d 锛宨nOut锛�%d 锛宮oveSpeed锛�%d 锛寊oomSpeed锛�%d",deviceId, channelId, leftRight, upDown, inOut, moveSpeed, zoomSpeed));
+			logger.debug(String.format("璁惧浜戝彴鎺у埗 API璋冪敤锛宒eviceId锛�%s 锛宑hannelId锛�%s 锛宑mdCode锛�%d 锛宧orizonSpeed锛�%d 锛寁erticalSpeed锛�%d 锛寊oomSpeed锛�%d",deviceId, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed));
 		}
 		Device device = storager.queryVideoDevice(deviceId);
 		
-		cmder.ptzCmd(device, channelId, leftRight, upDown, inOut, moveSpeed, zoomSpeed);
+		cmder.frontEndCmd(device, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed);
+		return new ResponseEntity<String>("success",HttpStatus.OK);
+	}
+	// public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int leftRight, int upDown, int inOut, int moveSpeed, int zoomSpeed){
+		
+	// 	if (logger.isDebugEnabled()) {
+	// 		logger.debug(String.format("璁惧浜戝彴鎺у埗 API璋冪敤锛宒eviceId锛�%s 锛宑hannelId锛�%s 锛宭eftRight锛�%d 锛寀pDown锛�%d 锛宨nOut锛�%d 锛宮oveSpeed锛�%d 锛寊oomSpeed锛�%d",deviceId, channelId, leftRight, upDown, inOut, moveSpeed, zoomSpeed));
+	// 	}
+	// 	Device device = storager.queryVideoDevice(deviceId);
+		
+	// 	cmder.ptzCmd(device, channelId, leftRight, upDown, inOut, moveSpeed, zoomSpeed);
+	// 	return new ResponseEntity<String>("success",HttpStatus.OK);
+	// }
+	@PostMapping("/frontEndCommand/{deviceId}/{channelId}")
+	public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug(String.format("璁惧浜戝彴鎺у埗 API璋冪敤锛宒eviceId锛�%s 锛宑hannelId锛�%s 锛宑mdCode锛�%d parameter1锛�%d parameter2锛�%d",deviceId, channelId, cmdCode, parameter1, parameter2));
+		}
+		Device device = storager.queryVideoDevice(deviceId);
+		
+		cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2);
 		return new ResponseEntity<String>("success",HttpStatus.OK);
 	}
 }

--
Gitblit v1.8.0