Commit d564ee08ef8c2c64b539d9494e11a3e2800643d5

Authored by chenjunyu_1481036421
1 parent 1ae6cdcb

feat:海康视频增加观看人数逻辑

... ... @@ -35,7 +35,11 @@ public class HikVisionArtemisPostUtils {
35 35 }
36 36
37 37 public static String getCameraPreviewURL(String host, String appKey, String appSecret, int ssl,
38   - ProtocolType protocolType,String body) {
  38 + ProtocolType protocolType,String body,String sn ) {
  39 + String videoUrl = VideoNumbersUtils.getUrl(appKey+sn);
  40 + if(!StringUtils.isEmpty(videoUrl)){
  41 + return videoUrl;
  42 + }
39 43 //获取url链接
40 44 Map<String, String> path = getUrl(host, appKey, appSecret, ssl, FastIotConstants.HkwsBuinessType.GET_URL);
41 45 //设置参数提交方式
... ... @@ -58,6 +62,7 @@ public class HikVisionArtemisPostUtils {
58 62 }
59 63 throw new TkDataValidationException(message);
60 64 }
  65 + VideoNumbersUtils.putVideoUrl(appKey+sn,json.get("url").textValue());
61 66 return json.get("url").textValue();
62 67 }else{
63 68 String errorCode = json.get("code").asText();
... ...
... ... @@ -204,7 +204,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
204 204 String body = jsonBody.toString();
205 205 return HikVisionArtemisPostUtils.getCameraPreviewURL(videoDTO.getVideoPlatformDTO().getHost(),
206 206 videoDTO.getVideoPlatformDTO().getAppKey(), videoDTO.getVideoPlatformDTO().getAppSecret(),
207   - videoDTO.getVideoPlatformDTO().getSsl(),protocolType,body);
  207 + videoDTO.getVideoPlatformDTO().getSsl(),protocolType,body,videoDTO.getSn());
208 208 }
209 209
210 210 }
... ...