Browse Source

修改获取视频流接口错误处理

develop
Mr.Wang 4 months ago
parent
commit
b88ed488e7
  1. 10
      zc-business/src/main/java/com/zc/business/controller/VideoController.java

10
zc-business/src/main/java/com/zc/business/controller/VideoController.java

@ -442,7 +442,7 @@ public class VideoController extends BaseController {
*/ */
@ApiOperation("获取视频流信息") @ApiOperation("获取视频流信息")
@GetMapping(value = "/externalVideoStreaming") @GetMapping(value = "/externalVideoStreaming")
public JSONObject externalVideoStreaming(@ApiParam(value = "摄像头标识", name = "camId", required = true) String camId) throws HttpException, IOException { public JSONObject externalVideoStreaming(@ApiParam(value = "摄像头标识", name = "camId", required = true) String camId) {
JSONObject cameraInfo = JSONObject.parseObject(configService.selectConfigByKey("dc.cameraInfo")); JSONObject cameraInfo = JSONObject.parseObject(configService.selectConfigByKey("dc.cameraInfo"));
JSONObject jsonResult = null; JSONObject jsonResult = null;
@ -453,6 +453,7 @@ public class VideoController extends BaseController {
requestParams.put("type", UniversalEnum.ONE.getValue()); requestParams.put("type", UniversalEnum.ONE.getValue());
requestParams.put("camId", camId); requestParams.put("camId", camId);
try {
Map<String, String> header = new HashMap<>(); Map<String, String> header = new HashMap<>();
if (VideoController.TOKEN == null) { if (VideoController.TOKEN == null) {
@ -494,6 +495,13 @@ public class VideoController extends BaseController {
} }
} }
} }
}catch (Exception e) {
jsonResult = new JSONObject();
jsonResult.put("code",200);
jsonResult.put("data", new JSONObject());
jsonResult.put("msg","摄像机连接失败");
}
return jsonResult; return jsonResult;
} }

Loading…
Cancel
Save