From 3fb9694c2dc1e912660f111c88e223c88ab00de7 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 26 Sep 2022 10:40:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=BC=E9=80=9Aapi?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/web/gb28181/ApiStreamController.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java index 07c93fbb..ba8c757b 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java @@ -83,10 +83,12 @@ public class ApiStreamController { JSONObject result = new JSONObject(); result.put("error","device[ " + serial + " ]未找到"); resultDeferredResult.setResult(result); + return resultDeferredResult; }else if (device.getOnline() == 0) { JSONObject result = new JSONObject(); result.put("error","device[ " + code + " ]offline"); resultDeferredResult.setResult(result); + return resultDeferredResult; } resultDeferredResult.onTimeout(()->{ logger.info("播放等待超时"); @@ -102,10 +104,12 @@ public class ApiStreamController { JSONObject result = new JSONObject(); result.put("error","channel[ " + code + " ]未找到"); resultDeferredResult.setResult(result); + return resultDeferredResult; }else if (deviceChannel.getStatus() == 0) { JSONObject result = new JSONObject(); result.put("error","channel[ " + code + " ]offline"); resultDeferredResult.setResult(result); + return resultDeferredResult; } MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device); PlayResult play = playService.play(newMediaServerItem, serial, code, (mediaServerItem, response)->{ @@ -143,18 +147,6 @@ public class ApiStreamController { result.put("RelaySize", ""); result.put("ChannelPTZType", "0"); resultDeferredResult.setResult(result); -// Class aClass = responseEntity.getClass().getSuperclass(); -// Field body = null; -// try { -// // 使用反射动态修改返回的body -// body = aClass.getDeclaredField("body"); -// body.setAccessible(true); -// body.set(responseEntity, result); -// } catch (NoSuchFieldException e) { -// e.printStackTrace(); -// } catch (IllegalAccessException e) { -// e.printStackTrace(); -// } }, (eventResult) -> { JSONObject result = new JSONObject(); result.put("error", "channel[ " + code + " ] " + eventResult.msg);