|
@@ -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();
|
|
|
}
|
|
|
|