| | |
| | | String code2 = data2.get("indexCode").toString(); |
| | | |
| | | //根据子节点编号获取设备播放地址 |
| | | String result3 = GetCameraPreviewURL.GetCameraPreviewURL(HkConstant.previewURLs, code2, ProtocolConstant.HLS); |
| | | String result3 = GetCameraPreviewURL.GetCameraPreviewURL(HkConstant.previewURLshttps, code2, ProtocolConstant.HLSS); |
| | | res = JSONObject.parseObject(result3); |
| | | } |
| | | |
| | | return R.data(res); |
| | | } |
| | | |
| | | /** |
| | | * 获取设备语音对讲的信息 |
| | | * @param equipmentPlayInfo 设备语音对讲对象,只需包含设备编号,以及设备语音对讲格式即可 |
| | | * @param response 响应域,设置跨域 |
| | | * @return |
| | | */ |
| | | @GetMapping("/EquimentVoice") |
| | | public R EquimentVoice(EquipmentPlayInfo equipmentPlayInfo,HttpServletResponse response){ |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | //返回 |
| | | // equipmentService.selectEquimentPlayInfo(equipmentPlayInfo) |
| | | |
| | | JSONObject res = new JSONObject(); |
| | | |
| | | //根据设备id获取设备编号 |
| | | String result1 = GetCameraPreviewURL.QueryCameraPreviewURL(HkConstant.camerasID, equipmentPlayInfo.getNumber(), "encodeDevice", "deviceCode"); |
| | | |
| | | JSONObject jsonObject1 = JSONObject.parseObject(result1); |
| | | JSONObject res1 = (JSONObject) jsonObject1.get("data"); |
| | | JSONArray arr1 = JSON.parseArray(res1.getString("list")); |
| | | if (arr1.size() > 0){ |
| | | JSONObject data1 = (JSONObject) arr1.get(0); |
| | | String code1 = data1.get("indexCode").toString(); |
| | | |
| | | //根据设备编号获取子节点编号 |
| | | String result2 = GetCameraPreviewURL.QueryCameraPreviewURL(HkConstant.camerasID, code1, "camera", "parentIndexCode"); |
| | | |
| | | JSONObject jsonObject2 = JSONObject.parseObject(result2); |
| | | JSONObject res2 = (JSONObject) jsonObject2.get("data"); |
| | | JSONArray arr2 = JSON.parseArray(res2.getString("list")); |
| | | JSONObject data2 = (JSONObject) arr2.get(0); |
| | | String code2 = data2.get("indexCode").toString(); |
| | | |
| | | //根据子节点获取设备语音对讲的信息 |
| | | String result4 = GetCameraPreviewURL.GetTalkURLs(HkConstant.talkURLs, code2); |
| | | res = JSONObject.parseObject(result4); |
| | | } |
| | | |
| | | return R.data(res); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |