|
|
@ -87,6 +87,7 @@ public class YDeviceImageService extends ServiceImpl<YDeviceImageMapper, DeviceI |
|
|
|
|
|
|
|
|
|
|
|
public DeviceImage getImage(Device device) { |
|
|
|
System.out.println("111111111111111111111111111"+device.getName()); |
|
|
|
// 访问接口 把图片保存到本地
|
|
|
|
String url = "https://api2.hik-cloud.com/api/v1/open/basic/channels/actions/capture"; |
|
|
|
String picName = ""; |
|
|
@ -105,6 +106,10 @@ public class YDeviceImageService extends ServiceImpl<YDeviceImageMapper, DeviceI |
|
|
|
L.info("未知错误4:{}", jsonObject.get("code")); |
|
|
|
return null; |
|
|
|
} |
|
|
|
if (jsonObject.get("code").toString().equals("510205")) { |
|
|
|
L.info("设备不在线:{}", jsonObject.get("code")); |
|
|
|
return null; |
|
|
|
} |
|
|
|
JSONObject dataJson = (JSONObject) jsonObject.get("data"); |
|
|
|
String picUrl = dataJson.get("picUrl").toString(); |
|
|
|
|
|
|
|