...
|
...
|
@@ -68,18 +68,24 @@ public class HikVisionArtemisPostUtils { |
68
|
68
|
//返回url地址
|
69
|
69
|
if (StringUtils.isNotEmpty(result)) {
|
70
|
70
|
JsonNode json = JacksonUtil.toJsonNode(result);
|
71
|
|
- json = json.get("data");
|
72
|
|
- String message = null;
|
73
|
|
- if(null == json || json.get("url") == null){
|
74
|
|
- if(null == json){
|
75
|
|
- message = ErrorMessage.VIDEO_PLATFORM_CONFIG_ERROR.getMessage();
|
76
|
|
- }else if(json.get("url") == null && Objects.equals(protocolType.getValue(),
|
77
|
|
- ProtocolType.HLSS.getValue())){
|
78
|
|
- message = ErrorMessage.VIDEO_PLATFORM_NEED_ENABLE_HLS_HTTPS.getMessage();
|
|
71
|
+ if(json.get("code").equals("0")){
|
|
72
|
+ json = json.get("data");
|
|
73
|
+ String message = null;
|
|
74
|
+ if(null == json || json.get("url") == null){
|
|
75
|
+ if(null == json){
|
|
76
|
+ message = ErrorMessage.HIKVISION_GET_URL_ERROR.getMessage();
|
|
77
|
+ }else if(json.get("url") == null && Objects.equals(protocolType.getValue(),
|
|
78
|
+ ProtocolType.HLSS.getValue())){
|
|
79
|
+ message = ErrorMessage.VIDEO_PLATFORM_NEED_ENABLE_HLS_HTTPS.getMessage();
|
|
80
|
+ }
|
|
81
|
+ throw new TkDataValidationException(message);
|
79
|
82
|
}
|
80
|
|
- throw new TkDataValidationException(message);
|
|
83
|
+ return json.get("url").textValue();
|
|
84
|
+ }else{
|
|
85
|
+ String errorCode = json.get("code").toString();
|
|
86
|
+ throw new TkDataValidationException(String.format(ErrorMessage.HIKVISION_API_ERROR.getMessage(),errorCode));
|
81
|
87
|
}
|
82
|
|
- return json.get("url").textValue();
|
|
88
|
+
|
83
|
89
|
} else {
|
84
|
90
|
throw new TkDataValidationException(ErrorMessage.VIDEO_PLATFORM_CONFIG_ERROR.getMessage());
|
85
|
91
|
}
|
...
|
...
|
|