Browse Source

回放修改2.3

wwh 2 years ago
parent
commit
e77fd87f68

+ 19 - 19
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/controller/VideoRecorControllerSg.java

@@ -46,9 +46,9 @@ public class VideoRecorControllerSg {
         Map<String, Object> value = new HashMap<>();
         value.put("nvrId", "");
         value.put("optional", "/evo-apigw/admin/API/SS/Playback/StartPlaybackByTime");
-        value.put("recordType", 1);
-        value.put("streamType", 1);
-        value.put("recordSource", 2);
+        value.put("recordType", "1");
+        value.put("streamType", "1");
+        value.put("recordSource", "2");
         value.put("channelId", channelId);
 
         //开始结束时间代为处理
@@ -63,7 +63,7 @@ public class VideoRecorControllerSg {
         value.put("startTime", befor);
 
 
-        if (farmId==1) {
+        if (farmId == 1) {
             System.out.println("曙光");
             VideoRecordRequestSg requestSg = new VideoRecordRequestSg(oauthConfigBaseInfo);
             requestSg.setClientMac("30:9c:23:79:40:08");
@@ -73,13 +73,13 @@ public class VideoRecorControllerSg {
             requestSg.setData(value);
             Object jsonObject1 = requestSg.doAction();
             System.out.println(jsonObject1);
-            String action =(String) JSONObject.fromObject(jsonObject1).get("url");
-            String token =(String) JSONObject.fromObject(jsonObject1).get("token");
+            String action = (String) JSONObject.fromObject(jsonObject1).get("url");
+            String token = (String) JSONObject.fromObject(jsonObject1).get("token");
             String[] split = action.split("\\|");// |需要转义符
             JSONObject jsonObject = new JSONObject();
-            jsonObject.put("url", split[1]+"?token="+token+"&trackID=701");
-            return R.ok().put("data",jsonObject);
-        } else if (farmId==22) {
+            jsonObject.put("url", split[1] + "?token=" + token + "&trackID=701");
+            return R.ok().put("data", jsonObject);
+        } else if (farmId == 22) {
             System.out.println("海宁");
             VideoRecordRequestHn requestHn = new VideoRecordRequestHn(oauthConfigBaseInfo02);
             requestHn.setClientMac("30:9c:23:79:40:08");
@@ -88,13 +88,13 @@ public class VideoRecorControllerSg {
             requestHn.setMethod("SS.Playback.StartPlaybackByTime");
             requestHn.setData(value);
             Object jsonObject1 = requestHn.doAction();
-            String action =(String) JSONObject.fromObject(jsonObject1).get("url");
-            String token =(String) JSONObject.fromObject(jsonObject1).get("token");
+            String action = (String) JSONObject.fromObject(jsonObject1).get("url");
+            String token = (String) JSONObject.fromObject(jsonObject1).get("token");
             String[] split = action.split("\\|");// |需要转义符
             JSONObject jsonObject = new JSONObject();
-            jsonObject.put("url", split[1]+"?token="+token+"&trackID=701");
-            return R.ok().put("data",jsonObject);
-        } else if (farmId==21){
+            jsonObject.put("url", split[1] + "?token=" + token + "&trackID=701");
+            return R.ok().put("data", jsonObject);
+        } else if (farmId == 21) {
             System.out.println("苍南");
             VideoRecordRequestCn requestCn = new VideoRecordRequestCn(oauthConfigBaseInfo03);
             requestCn.setClientMac("30:9c:23:79:40:08");
@@ -103,13 +103,13 @@ public class VideoRecorControllerSg {
             requestCn.setMethod("SS.Playback.StartPlaybackByTime");
             requestCn.setData(value);
             Object jsonObject1 = requestCn.doAction();
-            String action =(String) JSONObject.fromObject(jsonObject1).get("url");
-            String token =(String) JSONObject.fromObject(jsonObject1).get("token");
+            String action = (String) JSONObject.fromObject(jsonObject1).get("url");
+            String token = (String) JSONObject.fromObject(jsonObject1).get("token");
             String[] split = action.split("\\|");// |需要转义符
             JSONObject jsonObject = new JSONObject();
-            jsonObject.put("url", split[1]+"?token="+token+"&trackID=701");
-            return R.ok().put("data",jsonObject);
-        }else {
+            jsonObject.put("url", split[1] + "?token=" + token + "&trackID=701");
+            return R.ok().put("data", jsonObject);
+        } else {
             return R.error();
         }
 

+ 4 - 4
huimv-farm-video/src/main/java/com/huimv/video/dhicc/test/request/Video/VideoRecordRequestSg.java

@@ -55,10 +55,10 @@ public class VideoRecordRequestSg extends BaseRequest<Object> {
     private void setBody() {
         //设置请求参数
         Map<String, Object> map = new HashMap<>();
-        map.put("pageNum", this.clientMac);
-        map.put("pageSize", this.clientPushId);
-        map.put("isContain", this.project);
-        map.put("searchKey", this.method);
+        map.put("clientMac", this.clientMac);
+        map.put("clientPushId", this.clientPushId);
+        map.put("project", this.project);
+        map.put("method", this.method);
         map.put("data", this.data);
         this.setBody(JSON.toJSONString(map));