From a42dda2bd3cc1cf8c20cc61e7ad9211eadecbaf3 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 24 二月 2022 16:55:06 +0800
Subject: [PATCH] 规范数据库,添加必要约束,优化通道批量导入功能

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java |  211 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 178 insertions(+), 33 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java
index 1039a35..8be07ca 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java
@@ -1,10 +1,15 @@
 package com.genersoft.iot.vmp.gb28181.transmit.cmd;
 
+import com.genersoft.iot.vmp.common.StreamInfo;
 import com.genersoft.iot.vmp.gb28181.bean.Device;
+import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
+import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe;
+import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
+import com.genersoft.iot.vmp.service.bean.SSRCInfo;
 
 /**    
- * @Description:璁惧鑳藉姏鎺ュ彛锛岀敤浜庡畾涔夎澶囩殑鎺у埗銆佹煡璇㈣兘鍔�   
- * @author: songww
+ * @description:璁惧鑳藉姏鎺ュ彛锛岀敤浜庡畾涔夎澶囩殑鎺у埗銆佹煡璇㈣兘鍔�   
+ * @author: swwheihei
  * @date:   2020骞�5鏈�3鏃� 涓嬪崍9:16:34     
  */
 public interface ISIPCommander {
@@ -18,7 +23,7 @@
      * @param upDown     闀滃ご涓婄Щ涓嬬Щ 0:鍋滄 1:涓婄Щ 2:涓嬬Щ
      * @param moveSpeed  闀滃ご绉诲姩閫熷害
 	 */
-	public boolean ptzdirectCmd(Device device,String channelId,int leftRight, int upDown);
+	boolean ptzdirectCmd(Device device,String channelId,int leftRight, int upDown);
 	
 	/**
 	 * 浜戝彴鏂瑰悜鏀炬帶鍒�
@@ -29,7 +34,7 @@
      * @param upDown     闀滃ご涓婄Щ涓嬬Щ 0:鍋滄 1:涓婄Щ 2:涓嬬Щ
      * @param moveSpeed  闀滃ご绉诲姩閫熷害
 	 */
-	public boolean ptzdirectCmd(Device device,String channelId,int leftRight, int upDown, int moveSpeed);
+	boolean ptzdirectCmd(Device device,String channelId,int leftRight, int upDown, int moveSpeed);
 	
 	/**
 	 * 浜戝彴缂╂斁鎺у埗锛屼娇鐢ㄩ厤缃枃浠朵腑鐨勯粯璁ら暅澶寸缉鏀鹃�熷害
@@ -38,7 +43,7 @@
 	 * @param channelId  棰勮閫氶亾
      * @param inOut      闀滃ご鏀惧ぇ缂╁皬 0:鍋滄 1:缂╁皬 2:鏀惧ぇ
 	 */
-	public boolean ptzZoomCmd(Device device,String channelId,int inOut);
+	boolean ptzZoomCmd(Device device,String channelId,int inOut);
 	
 	/**
 	 * 浜戝彴缂╂斁鎺у埗
@@ -48,7 +53,7 @@
      * @param inOut      闀滃ご鏀惧ぇ缂╁皬 0:鍋滄 1:缂╁皬 2:鏀惧ぇ
      * @param zoomSpeed  闀滃ご缂╂斁閫熷害
 	 */
-	public boolean ptzZoomCmd(Device device,String channelId,int inOut, int moveSpeed);
+	boolean ptzZoomCmd(Device device,String channelId,int inOut, int moveSpeed);
 	
 	/**
 	 * 浜戝彴鎺у埗锛屾敮鎸佹柟鍚戜笌缂╂斁鎺у埗
@@ -61,15 +66,34 @@
      * @param moveSpeed  闀滃ご绉诲姩閫熷害
      * @param zoomSpeed  闀滃ご缂╂斁閫熷害
 	 */
-	public boolean ptzCmd(Device device,String channelId,int leftRight, int upDown, int inOut, int moveSpeed, int zoomSpeed);
+	boolean ptzCmd(Device device,String channelId,int leftRight, int upDown, int inOut, int moveSpeed, int zoomSpeed);
 	
 	/**
-	 * 璇锋眰棰勮瑙嗛娴�
+	 * 鍓嶇鎺у埗锛屽寘鎷琍TZ鎸囦护銆丗I鎸囦护銆侀缃綅鎸囦护銆佸贰鑸寚浠ゃ�佹壂鎻忔寚浠ゅ拰杈呭姪寮�鍏虫寚浠�
 	 * 
+	 * @param device  		鎺у埗璁惧
+	 * @param channelId		棰勮閫氶亾
+	 * @param cmdCode		鎸囦护鐮�
+     * @param parameter1	鏁版嵁1
+     * @param parameter2	鏁版嵁2
+     * @param combineCode2	缁勫悎鐮�2
+	 */
+	boolean frontEndCmd(Device device, String channelId, int cmdCode, int parameter1, int parameter2, int combineCode2);
+	
+	/**
+	 * 鍓嶇鎺у埗鎸囦护锛堢敤浜庤浆鍙戜笂绾ф寚浠わ級
+	 * @param device		鎺у埗璁惧
+	 * @param channelId		棰勮閫氶亾
+	 * @param cmdString		鍓嶇鎺у埗鎸囦护涓�
+	 */
+	boolean fronEndCmd(Device device, String channelId, String cmdString);
+
+	/**
+	 * 璇锋眰棰勮瑙嗛娴�
 	 * @param device  瑙嗛璁惧
 	 * @param channelId  棰勮閫氶亾
 	 */
-	public String playStreamCmd(Device device,String channelId);
+	void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 璇锋眰鍥炴斁瑙嗛娴�
@@ -79,37 +103,93 @@
 	 * @param startTime 寮�濮嬫椂闂�,鏍煎紡瑕佹眰锛歽yyy-MM-dd HH:mm:ss
 	 * @param endTime 缁撴潫鏃堕棿,鏍煎紡瑕佹眰锛歽yyy-MM-dd HH:mm:ss
 	 */
-	public String playbackStreamCmd(Device device,String channelId, String startTime, String endTime);
-	
+	void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInf, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
+
+	/**
+	 * 璇锋眰鍘嗗彶濯掍綋涓嬭浇
+	 * 
+	 * @param device  瑙嗛璁惧
+	 * @param channelId  棰勮閫氶亾
+	 * @param startTime 寮�濮嬫椂闂�,鏍煎紡瑕佹眰锛歽yyy-MM-dd HH:mm:ss
+	 * @param endTime 缁撴潫鏃堕棿,鏍煎紡瑕佹眰锛歽yyy-MM-dd HH:mm:ss
+	 * @param downloadSpeed 涓嬭浇鍊嶉�熷弬鏁�
+	 */ 
+	void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
+
+	/**
+	 * 瑙嗛娴佸仠姝�
+	 */
+	void streamByeCmd(String deviceId, String channelId, SipSubscribe.Event okEvent);
+	void streamByeCmd(String deviceId, String channelId);
+
+	/**
+	 * 鍥炴斁鏆傚仠
+	 */
+	void playPauseCmd(Device device, StreamInfo streamInfo);
+
+	/**
+	 * 鍥炴斁鎭㈠
+	 */
+	void playResumeCmd(Device device, StreamInfo streamInfo);
+
+	/**
+	 * 鍥炴斁鎷栧姩鎾斁
+	 */
+	void playSeekCmd(Device device, StreamInfo streamInfo, long seekTime);
+
+	/**
+	 * 鍥炴斁鍊嶉�熸挱鏀�
+	 */
+	void playSpeedCmd(Device device, StreamInfo streamInfo, Double speed);
+
 	/**
 	 * 璇煶骞挎挱
 	 * 
 	 * @param device  瑙嗛璁惧
 	 * @param channelId  棰勮閫氶亾
 	 */
-	public boolean audioBroadcastCmd(Device device,String channelId);
+	boolean audioBroadcastCmd(Device device,String channelId);
+	
+	/**
+	 * 璇煶骞挎挱
+	 * 
+	 * @param device  瑙嗛璁惧
+	 */
+	void audioBroadcastCmd(Device device, SipSubscribe.Event okEvent);
+	boolean audioBroadcastCmd(Device device);
 	
 	/**
 	 * 闊宠棰戝綍鍍忔帶鍒�
 	 * 
-	 * @param device  瑙嗛璁惧
-	 * @param channelId  棰勮閫氶亾
+	 * @param device  		瑙嗛璁惧
+	 * @param channelId  	棰勮閫氶亾
+	 * @param recordCmdStr	褰曞儚鍛戒护锛歊ecord / StopRecord
 	 */
-	public boolean recordCmd(Device device,String channelId);
+	boolean recordCmd(Device device, String channelId, String recordCmdStr, SipSubscribe.Event errorEvent);
 	
+	/**
+	 * 杩滅▼鍚姩鎺у埗鍛戒护
+	 * 
+	 * @param device	瑙嗛璁惧
+	 */
+	boolean teleBootCmd(Device device);
+
 	/**
 	 * 鎶ヨ甯冮槻/鎾ら槻鍛戒护
 	 * 
-	 * @param device  瑙嗛璁惧
+	 * @param device  	瑙嗛璁惧
+	 * @param setGuard	true: SetGuard, false: ResetGuard
 	 */
-	public boolean guardCmd(Device device);
+	boolean guardCmd(Device device, String guardCmdStr, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 鎶ヨ澶嶄綅鍛戒护
 	 * 
-	 * @param device  瑙嗛璁惧
+	 * @param device		瑙嗛璁惧
+	 * @param alarmMethod	鎶ヨ鏂瑰紡锛堝彲閫夛級
+	 * @param alarmType		鎶ヨ绫诲瀷锛堝彲閫夛級
 	 */
-	public boolean alarmCmd(Device device);
+	boolean alarmCmd(Device device, String alarmMethod, String alarmType, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 寮哄埗鍏抽敭甯у懡浠�,璁惧鏀跺埌姝ゅ懡浠ゅ簲绔嬪埢鍙戦�佷竴涓狪DR甯�
@@ -117,29 +197,43 @@
 	 * @param device  瑙嗛璁惧
 	 * @param channelId  棰勮閫氶亾
 	 */
-	public boolean iFameCmd(Device device,String channelId);
+	boolean iFrameCmd(Device device, String channelId);
 	
 	/**
 	 * 鐪嬪畧浣嶆帶鍒跺懡浠�
 	 * 
-	 * @param device  瑙嗛璁惧
+	 * @param device		瑙嗛璁惧
+	 * @param enabled		鐪嬪畧浣嶄娇鑳斤細1 = 寮�鍚紝0 = 鍏抽棴
+	 * @param resetTime		鑷姩褰掍綅鏃堕棿闂撮殧锛屽紑鍚湅瀹堜綅鏃朵娇鐢紝鍗曚綅:绉�(s)
+	 * @param presetIndex	璋冪敤棰勭疆浣嶇紪鍙凤紝寮�鍚湅瀹堜綅鏃朵娇鐢紝鍙栧�艰寖鍥�0~255
 	 */
-	public boolean homePositionCmd(Device device);
+	boolean homePositionCmd(Device device, String channelId, String enabled, String resetTime, String presetIndex, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 璁惧閰嶇疆鍛戒护
 	 * 
 	 * @param device  瑙嗛璁惧
 	 */
-	public boolean deviceConfigCmd(Device device);
+	boolean deviceConfigCmd(Device device);
 	
+		/**
+	 * 璁惧閰嶇疆鍛戒护锛歜asicParam
+	 * 
+	 * @param device  			瑙嗛璁惧
+	 * @param channelId			閫氶亾缂栫爜锛堝彲閫夛級
+	 * @param name				璁惧/閫氶亾鍚嶇О锛堝彲閫夛級
+	 * @param expiration		娉ㄥ唽杩囨湡鏃堕棿锛堝彲閫夛級
+	 * @param heartBeatInterval	蹇冭烦闂撮殧鏃堕棿锛堝彲閫夛級
+	 * @param heartBeatCount	蹇冭烦瓒呮椂娆℃暟锛堝彲閫夛級
+	 */  
+	boolean deviceBasicConfigCmd(Device device, String channelId, String name, String expiration, String heartBeatInterval, String heartBeatCount, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 鏌ヨ璁惧鐘舵��
 	 * 
 	 * @param device 瑙嗛璁惧
 	 */
-	public boolean deviceStatusQuery(Device device);
+	boolean deviceStatusQuery(Device device, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 鏌ヨ璁惧淇℃伅
@@ -147,14 +241,14 @@
 	 * @param device 瑙嗛璁惧
 	 * @return 
 	 */
-	public boolean deviceInfoQuery(Device device);
+	boolean deviceInfoQuery(Device device);
 	
 	/**
 	 * 鏌ヨ鐩綍鍒楄〃
 	 * 
 	 * @param device 瑙嗛璁惧
 	 */
-	public boolean catalogQuery(Device device);
+	boolean catalogQuery(Device device, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 鏌ヨ褰曞儚淇℃伅
@@ -162,34 +256,85 @@
 	 * @param device 瑙嗛璁惧
 	 * @param startTime 寮�濮嬫椂闂�,鏍煎紡瑕佹眰锛歽yyy-MM-dd HH:mm:ss
 	 * @param endTime 缁撴潫鏃堕棿,鏍煎紡瑕佹眰锛歽yyy-MM-dd HH:mm:ss
+	 * @param sn
 	 */
-	public boolean recordInfoQuery(Device device, String channelId, String startTime, String endTime);
+	boolean recordInfoQuery(Device device, String channelId, String startTime, String endTime, int sn, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 鏌ヨ鎶ヨ淇℃伅
 	 * 
-	 * @param device 瑙嗛璁惧
+	 * @param device		瑙嗛璁惧
+	 * @param startPriority	鎶ヨ璧峰绾у埆锛堝彲閫夛級
+	 * @param endPriority	鎶ヨ缁堟绾у埆锛堝彲閫夛級
+	 * @param alarmMethod	鎶ヨ鏂瑰紡鏉′欢锛堝彲閫夛級
+	 * @param alarmType		鎶ヨ绫诲瀷
+	 * @param startTime		鎶ヨ鍙戠敓璧峰鏃堕棿锛堝彲閫夛級
+	 * @param endTime		鎶ヨ鍙戠敓缁堟鏃堕棿锛堝彲閫夛級
+	 * @return				true = 鍛戒护鍙戦�佹垚鍔�
 	 */
-	public boolean alarmInfoQuery(Device device);
+	boolean alarmInfoQuery(Device device, String startPriority, String endPriority, String alarmMethod,
+							String alarmType, String startTime, String endTime, SipSubscribe.Event errorEvent);	
 	
 	/**
 	 * 鏌ヨ璁惧閰嶇疆
 	 * 
-	 * @param device 瑙嗛璁惧
+	 * @param device 		瑙嗛璁惧
+	 * @param channelId		閫氶亾缂栫爜锛堝彲閫夛級
+	 * @param configType	閰嶇疆绫诲瀷锛�
 	 */
-	public boolean configQuery(Device device);
+	boolean deviceConfigQuery(Device device, String channelId, String configType,  SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 鏌ヨ璁惧棰勭疆浣嶇疆
 	 * 
 	 * @param device 瑙嗛璁惧
 	 */
-	public boolean presetQuery(Device device);
+	boolean presetQuery(Device device, String channelId, SipSubscribe.Event errorEvent);
 	
 	/**
 	 * 鏌ヨ绉诲姩璁惧浣嶇疆鏁版嵁
 	 * 
 	 * @param device 瑙嗛璁惧
 	 */
-	public boolean mobilePostitionQuery(Device device);
+	boolean mobilePostitionQuery(Device device, SipSubscribe.Event errorEvent);
+
+	/**
+	 * 璁㈤槄銆佸彇娑堣闃呯Щ鍔ㄤ綅缃�
+	 * 
+	 * @param device	瑙嗛璁惧
+	 * @param expires	璁㈤槄瓒呮椂鏃堕棿锛堝��=0鏃朵负鍙栨秷璁㈤槄锛�
+	 * @param interval	涓婃姤鏃堕棿闂撮殧
+	 * @return			true = 鍛戒护鍙戦�佹垚鍔�
+	 */
+	boolean mobilePositionSubscribe(Device device, int expires, int interval);
+
+	/**
+	 * 璁㈤槄銆佸彇娑堣闃呮姤璀︿俊鎭�
+	 * @param device		瑙嗛璁惧
+	 * @param expires		璁㈤槄杩囨湡鏃堕棿锛�0 = 鍙栨秷璁㈤槄锛�
+	 * @param startPriority	鎶ヨ璧峰绾у埆锛堝彲閫夛級
+	 * @param endPriority	鎶ヨ缁堟绾у埆锛堝彲閫夛級
+	 * @param alarmMethods	鎶ヨ鏂瑰紡鏉′欢锛堝彲閫夛級
+	 * @param alarmType		鎶ヨ绫诲瀷
+	 * @param startTime		鎶ヨ鍙戠敓璧峰鏃堕棿锛堝彲閫夛級
+	 * @param endTime		鎶ヨ鍙戠敓缁堟鏃堕棿锛堝彲閫夛級
+	 * @return				true = 鍛戒护鍙戦�佹垚鍔�
+	 */
+	boolean alarmSubscribe(Device device, int expires, String startPriority, String endPriority, String alarmMethod, String alarmType, String startTime, String endTime);
+
+	/**
+	 * 璁㈤槄銆佸彇娑堣闃呯洰褰曚俊鎭�
+	 * @param device		瑙嗛璁惧
+	 * @return				true = 鍛戒护鍙戦�佹垚鍔�
+	 */
+	boolean catalogSubscribe(Device device, SipSubscribe.Event okEvent ,SipSubscribe.Event errorEvent);
+
+	/**
+	 * 鎷夋鎺у埗鍛戒护
+	 *
+	 * @param device    鎺у埗璁惧
+	 * @param channelId 閫氶亾id
+	 * @param cmdString 鍓嶇鎺у埗鎸囦护涓�
+	 */
+	boolean dragZoomCmd(Device device, String channelId, String cmdString);
 }

--
Gitblit v1.8.0