Commit 1947edb69af115eed2cbb4b2b9f60075fce18cbb

Authored by 648540858
1 parent a7f224b1

引入lombok框架

优化redis存储结构
... ... @@ -156,9 +156,14 @@
156 156 <artifactId>okhttp</artifactId>
157 157 <version>4.9.0</version>
158 158 </dependency>
  159 + <dependency>
  160 + <groupId>org.projectlombok</groupId>
  161 + <artifactId>lombok</artifactId>
  162 + <version>1.18.12</version>
  163 + </dependency>
159 164  
160 165  
161   - </dependencies>
  166 + </dependencies>
162 167  
163 168 <build>
164 169 <plugins>
... ...
src/main/java/com/genersoft/iot/vmp/common/PageResult.java
1 1 package com.genersoft.iot.vmp.common;
2 2  
  3 +import lombok.Data;
  4 +
3 5 import java.util.List;
4 6  
  7 +@Data
5 8 public class PageResult<T> {
6 9  
7 10 private int page;
... ... @@ -14,31 +17,4 @@ public class PageResult&lt;T&gt; {
14 17 return data;
15 18 }
16 19  
17   - public void setData(List<T> data) {
18   - this.data = data;
19   - }
20   -
21   - public int getPage() {
22   - return page;
23   - }
24   -
25   - public void setPage(int page) {
26   - this.page = page;
27   - }
28   -
29   - public int getCount() {
30   - return count;
31   - }
32   -
33   - public void setCount(int count) {
34   - this.count = count;
35   - }
36   -
37   - public int getTotal() {
38   - return total;
39   - }
40   -
41   - public void setTotal(int total) {
42   - this.total = total;
43   - }
44 20 }
... ...
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
1 1 package com.genersoft.iot.vmp.common;
2 2  
3 3 import com.alibaba.fastjson.JSONArray;
  4 +import lombok.Data;
4 5  
  6 +@Data
5 7 public class StreamInfo {
6 8  
7 9 private String ssrc;
... ... @@ -14,75 +16,4 @@ public class StreamInfo {
14 16 private String rtsp;
15 17 private JSONArray tracks;
16 18  
17   - public String getSsrc() {
18   - return ssrc;
19   - }
20   -
21   - public void setSsrc(String ssrc) {
22   - this.ssrc = ssrc;
23   - }
24   -
25   - public String getFlv() {
26   - return flv;
27   - }
28   -
29   - public void setFlv(String flv) {
30   - this.flv = flv;
31   - }
32   -
33   - public String getWs_flv() {
34   - return ws_flv;
35   - }
36   -
37   - public void setWs_flv(String ws_flv) {
38   - this.ws_flv = ws_flv;
39   - }
40   -
41   - public String getRtmp() {
42   - return rtmp;
43   - }
44   -
45   - public void setRtmp(String rtmp) {
46   - this.rtmp = rtmp;
47   - }
48   -
49   - public String getHls() {
50   - return hls;
51   - }
52   -
53   - public void setHls(String hls) {
54   - this.hls = hls;
55   - }
56   -
57   - public String getRtsp() {
58   - return rtsp;
59   - }
60   -
61   - public void setRtsp(String rtsp) {
62   - this.rtsp = rtsp;
63   - }
64   -
65   - public String getDeviceID() {
66   - return deviceID;
67   - }
68   -
69   - public void setDeviceID(String deviceID) {
70   - this.deviceID = deviceID;
71   - }
72   -
73   - public String getCahnnelId() {
74   - return cahnnelId;
75   - }
76   -
77   - public void setCahnnelId(String cahnnelId) {
78   - this.cahnnelId = cahnnelId;
79   - }
80   -
81   - public JSONArray getTracks() {
82   - return tracks;
83   - }
84   -
85   - public void setTracks(JSONArray tracks) {
86   - this.tracks = tracks;
87   - }
88 19 }
... ...
src/main/java/com/genersoft/iot/vmp/conf/MediaServerConfig.java
1 1 package com.genersoft.iot.vmp.conf;
2 2  
3 3 import com.alibaba.fastjson.annotation.JSONField;
  4 +import lombok.Data;
4 5  
  6 +@Data
5 7 public class MediaServerConfig {
6 8  
7 9 @JSONField(name = "api.apiDebug")
... ... @@ -198,525 +200,4 @@ public class MediaServerConfig {
198 200  
199 201 @JSONField(name = "shell.shell")
200 202 private String shellPhell;
201   -
202   -
203   - public String getApiDebug() {
204   - return apiDebug;
205   - }
206   -
207   - public void setApiDebug(String apiDebug) {
208   - this.apiDebug = apiDebug;
209   - }
210   -
211   - public String getApiSecret() {
212   - return apiSecret;
213   - }
214   -
215   - public void setApiSecret(String apiSecret) {
216   - this.apiSecret = apiSecret;
217   - }
218   -
219   - public String getFfmpegBin() {
220   - return ffmpegBin;
221   - }
222   -
223   - public void setFfmpegBin(String ffmpegBin) {
224   - this.ffmpegBin = ffmpegBin;
225   - }
226   -
227   - public String getFfmpegCmd() {
228   - return ffmpegCmd;
229   - }
230   -
231   - public void setFfmpegCmd(String ffmpegCmd) {
232   - this.ffmpegCmd = ffmpegCmd;
233   - }
234   -
235   - public String getFfmpegLog() {
236   - return ffmpegLog;
237   - }
238   -
239   - public void setFfmpegLog(String ffmpegLog) {
240   - this.ffmpegLog = ffmpegLog;
241   - }
242   -
243   - public String getGeneralEnableVhost() {
244   - return generalEnableVhost;
245   - }
246   -
247   - public void setGeneralEnableVhost(String generalEnableVhost) {
248   - this.generalEnableVhost = generalEnableVhost;
249   - }
250   -
251   - public String getGeneralFlowThreshold() {
252   - return generalFlowThreshold;
253   - }
254   -
255   - public void setGeneralFlowThreshold(String generalFlowThreshold) {
256   - this.generalFlowThreshold = generalFlowThreshold;
257   - }
258   -
259   - public String getGeneralMaxStreamWaitMS() {
260   - return generalMaxStreamWaitMS;
261   - }
262   -
263   - public void setGeneralMaxStreamWaitMS(String generalMaxStreamWaitMS) {
264   - this.generalMaxStreamWaitMS = generalMaxStreamWaitMS;
265   - }
266   -
267   - public String getGeneralStreamNoneReaderDelayMS() {
268   - return generalStreamNoneReaderDelayMS;
269   - }
270   -
271   - public void setGeneralStreamNoneReaderDelayMS(String generalStreamNoneReaderDelayMS) {
272   - this.generalStreamNoneReaderDelayMS = generalStreamNoneReaderDelayMS;
273   - }
274   -
275   - public String getHlsFileBufSize() {
276   - return hlsFileBufSize;
277   - }
278   -
279   - public void setHlsFileBufSize(String hlsFileBufSize) {
280   - this.hlsFileBufSize = hlsFileBufSize;
281   - }
282   -
283   - public String getHlsFilePath() {
284   - return hlsFilePath;
285   - }
286   -
287   - public void setHlsFilePath(String hlsFilePath) {
288   - this.hlsFilePath = hlsFilePath;
289   - }
290   -
291   - public String getHlsSegDur() {
292   - return hlsSegDur;
293   - }
294   -
295   - public void setHlsSegDur(String hlsSegDur) {
296   - this.hlsSegDur = hlsSegDur;
297   - }
298   -
299   - public String getHlsSegNum() {
300   - return hlsSegNum;
301   - }
302   -
303   - public void setHlsSegNum(String hlsSegNum) {
304   - this.hlsSegNum = hlsSegNum;
305   - }
306   -
307   - public String getHookAccessFileExceptHLS() {
308   - return hookAccessFileExceptHLS;
309   - }
310   -
311   - public void setHookAccessFileExceptHLS(String hookAccessFileExceptHLS) {
312   - this.hookAccessFileExceptHLS = hookAccessFileExceptHLS;
313   - }
314   -
315   - public String getHookAdminParams() {
316   - return hookAdminParams;
317   - }
318   -
319   - public void setHookAdminParams(String hookAdminParams) {
320   - this.hookAdminParams = hookAdminParams;
321   - }
322   -
323   - public String getHookEnable() {
324   - return hookEnable;
325   - }
326   -
327   - public void setHookEnable(String hookEnable) {
328   - this.hookEnable = hookEnable;
329   - }
330   -
331   - public String getHookOnFlowReport() {
332   - return hookOnFlowReport;
333   - }
334   -
335   - public void setHookOnFlowReport(String hookOnFlowReport) {
336   - this.hookOnFlowReport = hookOnFlowReport;
337   - }
338   -
339   - public String getHookOnHttpAccess() {
340   - return hookOnHttpAccess;
341   - }
342   -
343   - public void setHookOnHttpAccess(String hookOnHttpAccess) {
344   - this.hookOnHttpAccess = hookOnHttpAccess;
345   - }
346   -
347   - public String getHookOnPlay() {
348   - return hookOnPlay;
349   - }
350   -
351   - public void setHookOnPlay(String hookOnPlay) {
352   - this.hookOnPlay = hookOnPlay;
353   - }
354   -
355   - public String getHookOnPublish() {
356   - return hookOnPublish;
357   - }
358   -
359   - public void setHookOnPublish(String hookOnPublish) {
360   - this.hookOnPublish = hookOnPublish;
361   - }
362   -
363   - public String getHookOnRecordMp4() {
364   - return hookOnRecordMp4;
365   - }
366   -
367   - public void setHookOnRecordMp4(String hookOnRecordMp4) {
368   - this.hookOnRecordMp4 = hookOnRecordMp4;
369   - }
370   -
371   - public String getHookOnRtspAuth() {
372   - return hookOnRtspAuth;
373   - }
374   -
375   - public void setHookOnRtspAuth(String hookOnRtspAuth) {
376   - this.hookOnRtspAuth = hookOnRtspAuth;
377   - }
378   -
379   - public String getHookOnRtspRealm() {
380   - return hookOnRtspRealm;
381   - }
382   -
383   - public void setHookOnRtspRealm(String hookOnRtspRealm) {
384   - this.hookOnRtspRealm = hookOnRtspRealm;
385   - }
386   -
387   - public String getHookOnShellLogin() {
388   - return hookOnShellLogin;
389   - }
390   -
391   - public void setHookOnShellLogin(String hookOnShellLogin) {
392   - this.hookOnShellLogin = hookOnShellLogin;
393   - }
394   -
395   - public String getHookOnStreamChanged() {
396   - return hookOnStreamChanged;
397   - }
398   -
399   - public void setHookOnStreamChanged(String hookOnStreamChanged) {
400   - this.hookOnStreamChanged = hookOnStreamChanged;
401   - }
402   -
403   - public String getHookOnStreamNoneReader() {
404   - return hookOnStreamNoneReader;
405   - }
406   -
407   - public void setHookOnStreamNoneReader(String hookOnStreamNoneReader) {
408   - this.hookOnStreamNoneReader = hookOnStreamNoneReader;
409   - }
410   -
411   - public String getHookOnStreamNotFound() {
412   - return hookOnStreamNotFound;
413   - }
414   -
415   - public void setHookOnStreamNotFound(String hookOnStreamNotFound) {
416   - this.hookOnStreamNotFound = hookOnStreamNotFound;
417   - }
418   -
419   - public String getHookTimeoutSec() {
420   - return hookTimeoutSec;
421   - }
422   -
423   - public void setHookTimeoutSec(String hookTimeoutSec) {
424   - this.hookTimeoutSec = hookTimeoutSec;
425   - }
426   -
427   - public String getHttpCharSet() {
428   - return httpCharSet;
429   - }
430   -
431   - public void setHttpCharSet(String httpCharSet) {
432   - this.httpCharSet = httpCharSet;
433   - }
434   -
435   - public String getHttpKeepAliveSecond() {
436   - return httpKeepAliveSecond;
437   - }
438   -
439   - public void setHttpKeepAliveSecond(String httpKeepAliveSecond) {
440   - this.httpKeepAliveSecond = httpKeepAliveSecond;
441   - }
442   -
443   - public String getHttpMaxReqCount() {
444   - return httpMaxReqCount;
445   - }
446   -
447   - public void setHttpMaxReqCount(String httpMaxReqCount) {
448   - this.httpMaxReqCount = httpMaxReqCount;
449   - }
450   -
451   - public String getHttpMaxReqSize() {
452   - return httpMaxReqSize;
453   - }
454   -
455   - public void setHttpMaxReqSize(String httpMaxReqSize) {
456   - this.httpMaxReqSize = httpMaxReqSize;
457   - }
458   -
459   - public String getHttpNotFound() {
460   - return httpNotFound;
461   - }
462   -
463   - public void setHttpNotFound(String httpNotFound) {
464   - this.httpNotFound = httpNotFound;
465   - }
466   -
467   - public String getHttpPort() {
468   - return httpPort;
469   - }
470   -
471   - public void setHttpPort(String httpPort) {
472   - this.httpPort = httpPort;
473   - }
474   -
475   - public String getHttpRootPath() {
476   - return httpRootPath;
477   - }
478   -
479   - public void setHttpRootPath(String httpRootPath) {
480   - this.httpRootPath = httpRootPath;
481   - }
482   -
483   - public String getHttpSendBufSize() {
484   - return httpSendBufSize;
485   - }
486   -
487   - public void setHttpSendBufSize(String httpSendBufSize) {
488   - this.httpSendBufSize = httpSendBufSize;
489   - }
490   -
491   - public String getHttpSSLport() {
492   - return httpSSLport;
493   - }
494   -
495   - public void setHttpSSLport(String httpSSLport) {
496   - this.httpSSLport = httpSSLport;
497   - }
498   -
499   - public String getMulticastAddrMax() {
500   - return multicastAddrMax;
501   - }
502   -
503   - public void setMulticastAddrMax(String multicastAddrMax) {
504   - this.multicastAddrMax = multicastAddrMax;
505   - }
506   -
507   - public String getMulticastAddrMin() {
508   - return multicastAddrMin;
509   - }
510   -
511   - public void setMulticastAddrMin(String multicastAddrMin) {
512   - this.multicastAddrMin = multicastAddrMin;
513   - }
514   -
515   - public String getMulticastUdpTTL() {
516   - return multicastUdpTTL;
517   - }
518   -
519   - public void setMulticastUdpTTL(String multicastUdpTTL) {
520   - this.multicastUdpTTL = multicastUdpTTL;
521   - }
522   -
523   - public String getRecordAppName() {
524   - return recordAppName;
525   - }
526   -
527   - public void setRecordAppName(String recordAppName) {
528   - this.recordAppName = recordAppName;
529   - }
530   -
531   - public String getRecordFilePath() {
532   - return recordFilePath;
533   - }
534   -
535   - public void setRecordFilePath(String recordFilePath) {
536   - this.recordFilePath = recordFilePath;
537   - }
538   -
539   - public String getRecordFileSecond() {
540   - return recordFileSecond;
541   - }
542   -
543   - public void setRecordFileSecond(String recordFileSecond) {
544   - this.recordFileSecond = recordFileSecond;
545   - }
546   -
547   - public String getRecordFileSampleMS() {
548   - return recordFileSampleMS;
549   - }
550   -
551   - public void setRecordFileSampleMS(String recordFileSampleMS) {
552   - this.recordFileSampleMS = recordFileSampleMS;
553   - }
554   -
555   - public String getRtmpHandshakeSecond() {
556   - return rtmpHandshakeSecond;
557   - }
558   -
559   - public void setRtmpHandshakeSecond(String rtmpHandshakeSecond) {
560   - this.rtmpHandshakeSecond = rtmpHandshakeSecond;
561   - }
562   -
563   - public String getRtmpKeepAliveSecond() {
564   - return rtmpKeepAliveSecond;
565   - }
566   -
567   - public void setRtmpKeepAliveSecond(String rtmpKeepAliveSecond) {
568   - this.rtmpKeepAliveSecond = rtmpKeepAliveSecond;
569   - }
570   -
571   - public String getRtmpModifyStamp() {
572   - return rtmpModifyStamp;
573   - }
574   -
575   - public void setRtmpModifyStamp(String rtmpModifyStamp) {
576   - this.rtmpModifyStamp = rtmpModifyStamp;
577   - }
578   -
579   - public String getRtmpPort() {
580   - return rtmpPort;
581   - }
582   -
583   - public void setRtmpPort(String rtmpPort) {
584   - this.rtmpPort = rtmpPort;
585   - }
586   -
587   - public String getRtpAudioMtuSize() {
588   - return rtpAudioMtuSize;
589   - }
590   -
591   - public void setRtpAudioMtuSize(String rtpAudioMtuSize) {
592   - this.rtpAudioMtuSize = rtpAudioMtuSize;
593   - }
594   -
595   - public String getRtpClearCount() {
596   - return rtpClearCount;
597   - }
598   -
599   - public void setRtpClearCount(String rtpClearCount) {
600   - this.rtpClearCount = rtpClearCount;
601   - }
602   -
603   - public String getRtpCycleMS() {
604   - return rtpCycleMS;
605   - }
606   -
607   - public void setRtpCycleMS(String rtpCycleMS) {
608   - this.rtpCycleMS = rtpCycleMS;
609   - }
610   -
611   - public String getRtpMaxRtpCount() {
612   - return rtpMaxRtpCount;
613   - }
614   -
615   - public void setRtpMaxRtpCount(String rtpMaxRtpCount) {
616   - this.rtpMaxRtpCount = rtpMaxRtpCount;
617   - }
618   -
619   - public String getRtpVideoMtuSize() {
620   - return rtpVideoMtuSize;
621   - }
622   -
623   - public void setRtpVideoMtuSize(String rtpVideoMtuSize) {
624   - this.rtpVideoMtuSize = rtpVideoMtuSize;
625   - }
626   -
627   - public String getRtspAuthBasic() {
628   - return rtspAuthBasic;
629   - }
630   -
631   - public void setRtspAuthBasic(String rtspAuthBasic) {
632   - this.rtspAuthBasic = rtspAuthBasic;
633   - }
634   -
635   - public String getRtspHandshakeSecond() {
636   - return rtspHandshakeSecond;
637   - }
638   -
639   - public void setRtspHandshakeSecond(String rtspHandshakeSecond) {
640   - this.rtspHandshakeSecond = rtspHandshakeSecond;
641   - }
642   -
643   - public String getRtspKeepAliveSecond() {
644   - return rtspKeepAliveSecond;
645   - }
646   -
647   - public void setRtspKeepAliveSecond(String rtspKeepAliveSecond) {
648   - this.rtspKeepAliveSecond = rtspKeepAliveSecond;
649   - }
650   -
651   - public String getRtspPort() {
652   - return rtspPort;
653   - }
654   -
655   - public void setRtspPort(String rtspPort) {
656   - this.rtspPort = rtspPort;
657   - }
658   -
659   - public String getRtspSSlport() {
660   - return rtspSSlport;
661   - }
662   -
663   - public void setRtspSSlport(String rtspSSlport) {
664   - this.rtspSSlport = rtspSSlport;
665   - }
666   -
667   - public String getShellMaxReqSize() {
668   - return shellMaxReqSize;
669   - }
670   -
671   - public void setShellMaxReqSize(String shellMaxReqSize) {
672   - this.shellMaxReqSize = shellMaxReqSize;
673   - }
674   -
675   - public String getShellPhell() {
676   - return shellPhell;
677   - }
678   -
679   - public void setShellPhell(String shellPhell) {
680   - this.shellPhell = shellPhell;
681   - }
682   -
683   - public String getLocalIP() {
684   - return localIP;
685   - }
686   -
687   - public void setLocalIP(String localIP) {
688   - this.localIP = localIP;
689   - }
690   -
691   - public String getRtpProxyCheckSource() {
692   - return rtpProxyCheckSource;
693   - }
694   -
695   - public void setRtpProxyCheckSource(String rtpProxyCheckSource) {
696   - this.rtpProxyCheckSource = rtpProxyCheckSource;
697   - }
698   -
699   - public String getRtpProxyDumpDir() {
700   - return rtpProxyDumpDir;
701   - }
702   -
703   - public void setRtpProxyDumpDir(String rtpProxyDumpDir) {
704   - this.rtpProxyDumpDir = rtpProxyDumpDir;
705   - }
706   -
707   - public String getRtpProxyPort() {
708   - return rtpProxyPort;
709   - }
710   -
711   - public void setRtpProxyPort(String rtpProxyPort) {
712   - this.rtpProxyPort = rtpProxyPort;
713   - }
714   -
715   - public String getRtpProxyTimeoutSec() {
716   - return rtpProxyTimeoutSec;
717   - }
718   -
719   - public void setRtpProxyTimeoutSec(String rtpProxyTimeoutSec) {
720   - this.rtpProxyTimeoutSec = rtpProxyTimeoutSec;
721   - }
722 203 }
... ...
src/main/java/com/genersoft/iot/vmp/conf/SipConfig.java
1 1 package com.genersoft.iot.vmp.conf;
2 2  
  3 +import lombok.Data;
3 4 import org.springframework.beans.factory.annotation.Value;
4 5 import org.springframework.context.annotation.Configuration;
5 6  
  7 +@Data
6 8 @Configuration("sipConfig")
7 9 public class SipConfig {
8 10  
... ... @@ -20,51 +22,4 @@ public class SipConfig {
20 22 @Value("${sip.ptz.speed:50}")
21 23 Integer speed;
22 24  
23   - public String getSipIp() {
24   - return sipIp;
25   - }
26   -
27   - public void setSipIp(String sipIp) {
28   - this.sipIp = sipIp;
29   - }
30   -
31   - public Integer getSipPort() {
32   - return sipPort;
33   - }
34   -
35   - public void setSipPort(Integer sipPort) {
36   - this.sipPort = sipPort;
37   - }
38   -
39   - public String getSipDomain() {
40   - return sipDomain;
41   - }
42   -
43   - public void setSipDomain(String sipDomain) {
44   - this.sipDomain = sipDomain;
45   - }
46   -
47   - public String getSipPassword() {
48   - return sipPassword;
49   - }
50   -
51   - public void setSipPassword(String sipPassword) {
52   - this.sipPassword = sipPassword;
53   - }
54   -
55   - public Integer getSpeed() {
56   - return speed;
57   - }
58   -
59   - public void setSpeed(Integer speed) {
60   - this.speed = speed;
61   - }
62   -
63   - public String getSipId() {
64   - return sipId;
65   - }
66   -
67   - public void setSipId(String sipId) {
68   - this.sipId = sipId;
69   - }
70 25 }
... ...
src/main/java/com/genersoft/iot/vmp/conf/VManagerConfig.java
1 1 package com.genersoft.iot.vmp.conf;
2 2  
  3 +import lombok.Data;
3 4 import org.springframework.beans.factory.annotation.Value;
4 5 import org.springframework.context.annotation.Configuration;
5 6  
... ... @@ -8,20 +9,12 @@ import org.springframework.context.annotation.Configuration;
8 9 * @author: swwheihei
9 10 * @date: 2020年5月6日 下午2:46:00
10 11 */
  12 +@Data
11 13 @Configuration("vmConfig")
12 14 public class VManagerConfig {
13 15  
14 16 @Value("${spring.application.database:redis}")
15 17 private String database;
16 18  
17   - public String getDatabase() {
18   - return database;
19   - }
20 19  
21   - public void setDatabase(String database) {
22   - this.database = database;
23   - }
24   -
25   -
26   -
27 20 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
1 1 package com.genersoft.iot.vmp.gb28181.bean;
2 2  
3   -import java.util.Map;
  3 +import lombok.Data;
4 4  
  5 +import java.util.List;
  6 +import java.util.Map;
5 7  
  8 +@Data
6 9 public class Device {
7 10  
8 11 /**
... ... @@ -53,84 +56,6 @@ public class Device {
53 56  
54 57 private int channelCount;
55 58  
  59 + private List<String> channelList;
56 60  
57   - public String getDeviceId() {
58   - return deviceId;
59   - }
60   -
61   - public void setDeviceId(String deviceId) {
62   - this.deviceId = deviceId;
63   - }
64   -
65   - public String getName() {
66   - return name;
67   - }
68   -
69   - public void setName(String name) {
70   - this.name = name;
71   - }
72   -
73   - public String getTransport() {
74   - return transport;
75   - }
76   -
77   - public void setTransport(String transport) {
78   - this.transport = transport;
79   - }
80   -
81   - public Host getHost() {
82   - return host;
83   - }
84   -
85   - public void setHost(Host host) {
86   - this.host = host;
87   - }
88   -
89   -// public Map<String, DeviceChannel> getChannelMap() {
90   -// return channelMap;
91   -// }
92   -//
93   -// public void setChannelMap(Map<String, DeviceChannel> channelMap) {
94   -// this.channelMap = channelMap;
95   -// }
96   -
97   - public String getManufacturer() {
98   - return manufacturer;
99   - }
100   -
101   - public void setManufacturer(String manufacturer) {
102   - this.manufacturer = manufacturer;
103   - }
104   -
105   - public String getModel() {
106   - return model;
107   - }
108   -
109   - public void setModel(String model) {
110   - this.model = model;
111   - }
112   -
113   - public String getFirmware() {
114   - return firmware;
115   - }
116   -
117   - public void setFirmware(String firmware) {
118   - this.firmware = firmware;
119   - }
120   -
121   - public int getOnline() {
122   - return online;
123   - }
124   -
125   - public void setOnline(int online) {
126   - this.online = online;
127   - }
128   -
129   - public int getChannelCount() {
130   - return channelCount;
131   - }
132   -
133   - public void setChannelCount(int channelCount) {
134   - this.channelCount = channelCount;
135   - }
136 61 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceAlarm.java
1 1 package com.genersoft.iot.vmp.gb28181.bean;
2 2  
  3 +import lombok.Data;
  4 +
  5 +@Data
3 6 public class DeviceAlarm {
4 7  
5 8 /**
... ... @@ -43,68 +46,5 @@ public class DeviceAlarm {
43 46 */
44 47 private String alarmType;
45 48  
46   - public String getDeviceId() {
47   - return deviceId;
48   - }
49   -
50   - public void setDeviceId(String deviceId) {
51   - this.deviceId = deviceId;
52   - }
53   -
54   - public String getAlarmPriorit() {
55   - return alarmPriorit;
56   - }
57   -
58   - public void setAlarmPriorit(String alarmPriorit) {
59   - this.alarmPriorit = alarmPriorit;
60   - }
61   -
62   - public String getAlarmMethod() {
63   - return alarmMethod;
64   - }
65   -
66   - public void setAlarmMethod(String alarmMethod) {
67   - this.alarmMethod = alarmMethod;
68   - }
69   -
70   - public String getAlarmTime() {
71   - return alarmTime;
72   - }
73   -
74   - public void setAlarmTime(String alarmTime) {
75   - this.alarmTime = alarmTime;
76   - }
77   -
78   - public String getAlarmDescription() {
79   - return alarmDescription;
80   - }
81   -
82   - public void setAlarmDescription(String alarmDescription) {
83   - this.alarmDescription = alarmDescription;
84   - }
85   -
86   - public double getLongitude() {
87   - return longitude;
88   - }
89   -
90   - public void setLongitude(double longitude) {
91   - this.longitude = longitude;
92   - }
93   -
94   - public double getLatitude() {
95   - return latitude;
96   - }
97   -
98   - public void setLatitude(double latitude) {
99   - this.latitude = latitude;
100   - }
101   -
102   - public String getAlarmType() {
103   - return alarmType;
104   - }
105   -
106   - public void setAlarmType(String alarmType) {
107   - this.alarmType = alarmType;
108   - }
109 49  
110 50 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
1 1 package com.genersoft.iot.vmp.gb28181.bean;
2 2  
  3 +import lombok.Data;
  4 +
  5 +@Data
3 6 public class DeviceChannel {
4 7  
5 8 /**
... ... @@ -153,193 +156,6 @@ public class DeviceChannel {
153 156 */
154 157 private boolean play;
155 158  
156   - public String getChannelId() {
157   - return channelId;
158   - }
159   -
160   - public void setChannelId(String channelId) {
161   - this.channelId = channelId;
162   - }
163   -
164   - public String getName() {
165   - return name;
166   - }
167   -
168   - public void setName(String name) {
169   - this.name = name;
170   - }
171   -
172   - public int getStatus() {
173   - return status;
174   - }
175   -
176   - public void setStatus(int status) {
177   - this.status = status;
178   - }
179   -
180   - public String getManufacture() {
181   - return manufacture;
182   - }
183   -
184   - public void setManufacture(String manufacture) {
185   - this.manufacture = manufacture;
186   - }
187   -
188   - public String getModel() {
189   - return model;
190   - }
191   -
192   - public void setModel(String model) {
193   - this.model = model;
194   - }
195   -
196   - public String getOwner() {
197   - return owner;
198   - }
199   -
200   - public void setOwner(String owner) {
201   - this.owner = owner;
202   - }
203   -
204   - public String getCivilCode() {
205   - return civilCode;
206   - }
207   -
208   - public void setCivilCode(String civilCode) {
209   - this.civilCode = civilCode;
210   - }
211   -
212   - public String getBlock() {
213   - return block;
214   - }
215   -
216   - public void setBlock(String block) {
217   - this.block = block;
218   - }
219   -
220   - public String getAddress() {
221   - return address;
222   - }
223   -
224   - public void setAddress(String address) {
225   - this.address = address;
226   - }
227   -
228   - public int getParental() {
229   - return parental;
230   - }
231   -
232   - public void setParental(int parental) {
233   - this.parental = parental;
234   - }
235   -
236   - public String getParentId() {
237   - return parentId;
238   - }
239   -
240   - public void setParentId(String parentId) {
241   - this.parentId = parentId;
242   - }
243   -
244   - public int getSafetyWay() {
245   - return safetyWay;
246   - }
247   -
248   - public void setSafetyWay(int safetyWay) {
249   - this.safetyWay = safetyWay;
250   - }
251   -
252   - public int getRegisterWay() {
253   - return registerWay;
254   - }
255   -
256   - public void setRegisterWay(int registerWay) {
257   - this.registerWay = registerWay;
258   - }
259   -
260   - public String getCertNum() {
261   - return certNum;
262   - }
263   -
264   - public void setCertNum(String certNum) {
265   - this.certNum = certNum;
266   - }
267   -
268   - public int getCertifiable() {
269   - return certifiable;
270   - }
271   -
272   - public void setCertifiable(int certifiable) {
273   - this.certifiable = certifiable;
274   - }
275   -
276   - public int getErrCode() {
277   - return errCode;
278   - }
279   -
280   - public void setErrCode(int errCode) {
281   - this.errCode = errCode;
282   - }
283   -
284   - public String getEndTime() {
285   - return endTime;
286   - }
287   -
288   - public void setEndTime(String endTime) {
289   - this.endTime = endTime;
290   - }
291   -
292   - public String getSecrecy() {
293   - return secrecy;
294   - }
295   -
296   - public void setSecrecy(String secrecy) {
297   - this.secrecy = secrecy;
298   - }
299   -
300   - public String getIpAddress() {
301   - return ipAddress;
302   - }
303   -
304   - public void setIpAddress(String ipAddress) {
305   - this.ipAddress = ipAddress;
306   - }
307   -
308   - public int getPort() {
309   - return port;
310   - }
311   -
312   - public void setPort(int port) {
313   - this.port = port;
314   - }
315   -
316   - public String getPassword() {
317   - return password;
318   - }
319   -
320   - public void setPassword(String password) {
321   - this.password = password;
322   - }
323   -
324   - public double getLongitude() {
325   - return longitude;
326   - }
327   -
328   - public void setLongitude(double longitude) {
329   - this.longitude = longitude;
330   - }
331   -
332   - public double getLatitude() {
333   - return latitude;
334   - }
335   -
336   - public void setLatitude(double latitude) {
337   - this.latitude = latitude;
338   - }
339   -
340   - public int getPTZType() {
341   - return PTZType;
342   - }
343 159  
344 160 public void setPTZType(int PTZType) {
345 161 this.PTZType = PTZType;
... ... @@ -361,44 +177,4 @@ public class DeviceChannel {
361 177 break;
362 178 }
363 179 }
364   -
365   - public String getPTZTypeText() {
366   - return PTZTypeText;
367   - }
368   -
369   - public String getSsrc() {
370   - return ssrc;
371   - }
372   -
373   - public void setSsrc(String ssrc) {
374   - this.ssrc = ssrc;
375   - }
376   -
377   - public int getSubCount() {
378   - return subCount;
379   - }
380   -
381   - public void setSubCount(int subCount) {
382   - this.subCount = subCount;
383   - }
384   -
385   - public void setPTZTypeText(String PTZTypeText) {
386   - this.PTZTypeText = PTZTypeText;
387   - }
388   -
389   - public boolean isHasAudio() {
390   - return hasAudio;
391   - }
392   -
393   - public void setHasAudio(boolean hasAudio) {
394   - this.hasAudio = hasAudio;
395   - }
396   -
397   - public boolean isPlay() {
398   - return play;
399   - }
400   -
401   - public void setPlay(boolean play) {
402   - this.play = play;
403   - }
404 180 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Host.java
1 1 package com.genersoft.iot.vmp.gb28181.bean;
2 2  
  3 +import lombok.Data;
  4 +
  5 +@Data
3 6 public class Host {
4 7  
5 8 private String ip;
6 9 private int port;
7 10 private String address;
8 11  
9   - public String getIp() {
10   - return ip;
11   - }
12   - public void setIp(String ip) {
13   - this.ip = ip;
14   - }
15   - public int getPort() {
16   - return port;
17   - }
18   - public void setPort(int port) {
19   - this.port = port;
20   - }
21   - public String getAddress() {
22   - return address;
23   - }
24   - public void setAddress(String address) {
25   - this.address = address;
26   - }
27   -
  12 +
28 13  
29 14  
30 15 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordInfo.java
1 1 package com.genersoft.iot.vmp.gb28181.bean;
2 2  
  3 +import lombok.Data;
  4 +
3 5 import java.util.List;
4 6  
5 7 /**
... ... @@ -7,6 +9,7 @@ import java.util.List;
7 9 * @author: swwheihei
8 10 * @date: 2020年5月8日 下午2:05:56
9 11 */
  12 +@Data
10 13 public class RecordInfo {
11 14  
12 15 private String deviceId;
... ... @@ -17,35 +20,4 @@ public class RecordInfo {
17 20  
18 21 private List<RecordItem> recordList;
19 22  
20   - public String getDeviceId() {
21   - return deviceId;
22   - }
23   -
24   - public void setDeviceId(String deviceId) {
25   - this.deviceId = deviceId;
26   - }
27   -
28   - public String getName() {
29   - return name;
30   - }
31   -
32   - public void setName(String name) {
33   - this.name = name;
34   - }
35   -
36   - public int getSumNum() {
37   - return sumNum;
38   - }
39   -
40   - public void setSumNum(int sumNum) {
41   - this.sumNum = sumNum;
42   - }
43   -
44   - public List<RecordItem> getRecordList() {
45   - return recordList;
46   - }
47   -
48   - public void setRecordList(List<RecordItem> recordList) {
49   - this.recordList = recordList;
50   - }
51 23 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java
1 1 package com.genersoft.iot.vmp.gb28181.bean;
2 2  
3   -/**
  3 +import lombok.Data;
  4 +
  5 +/**
4 6 * @Description:设备录像bean
5 7 * @author: swwheihei
6 8 * @date: 2020年5月8日 下午2:06:54
7 9 */
  10 +
  11 +@Data
8 12 public class RecordItem {
9 13  
10 14 private String deviceId;
... ... @@ -25,75 +29,4 @@ public class RecordItem {
25 29  
26 30 private String recorderId;
27 31  
28   - public String getDeviceId() {
29   - return deviceId;
30   - }
31   -
32   - public void setDeviceId(String deviceId) {
33   - this.deviceId = deviceId;
34   - }
35   -
36   - public String getName() {
37   - return name;
38   - }
39   -
40   - public void setName(String name) {
41   - this.name = name;
42   - }
43   -
44   - public String getFilePath() {
45   - return filePath;
46   - }
47   -
48   - public void setFilePath(String filePath) {
49   - this.filePath = filePath;
50   - }
51   -
52   - public String getAddress() {
53   - return address;
54   - }
55   -
56   - public void setAddress(String address) {
57   - this.address = address;
58   - }
59   -
60   - public String getStartTime() {
61   - return startTime;
62   - }
63   -
64   - public void setStartTime(String startTime) {
65   - this.startTime = startTime;
66   - }
67   -
68   - public int getSecrecy() {
69   - return secrecy;
70   - }
71   -
72   - public void setSecrecy(int secrecy) {
73   - this.secrecy = secrecy;
74   - }
75   -
76   - public String getType() {
77   - return type;
78   - }
79   -
80   - public void setType(String type) {
81   - this.type = type;
82   - }
83   -
84   - public String getRecorderId() {
85   - return recorderId;
86   - }
87   -
88   - public void setRecordId(String recorderId) {
89   - this.recorderId = recorderId;
90   - }
91   -
92   - public String getEndTime() {
93   - return endTime;
94   - }
95   -
96   - public void setEndTime(String endTime) {
97   - this.endTime = endTime;
98   - }
99 32 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
... ... @@ -308,7 +308,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
308 308 record.setEndTime(DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(XmlUtil.getText(itemRecord,"EndTime")));
309 309 record.setSecrecy(itemRecord.element("Secrecy") == null? 0:Integer.parseInt(XmlUtil.getText(itemRecord,"Secrecy")));
310 310 record.setType(XmlUtil.getText(itemRecord,"Type"));
311   - record.setRecordId(XmlUtil.getText(itemRecord,"RecorderID"));
  311 + record.setRecorderId(XmlUtil.getText(itemRecord,"RecorderID"));
312 312 recordList.add(record);
313 313 }
314 314 recordInfo.setRecordList(recordList);
... ...
src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
... ... @@ -66,7 +66,6 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
66 66 if (deviceMap.get(device.getDeviceId()) == null) {
67 67 deviceMap.put(device.getDeviceId(), new HashMap<String, HashSet<String>>());
68 68 }
69   -// List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + device.getDeviceId() + "_" + "*");
70 69 // 更新device中的通道数量
71 70 device.setChannelCount(deviceMap.get(device.getDeviceId()).size());
72 71 // 存储device
... ... @@ -90,7 +89,6 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
90 89 // 存储通道
91 90 redis.set(VideoManagerConstants.CACHEKEY_PREFIX + deviceId +
92 91 "_" + channel.getChannelId() +
93   - ":" + channel.getName() +
94 92 "_" + (channel.getStatus() == 1 ? "on":"off") +
95 93 "_" + (channelMap.get(channelId).size() > 0)+
96 94 "_" + (StringUtils.isEmpty(channel.getParentId())?null:channel.getParentId()),
... ... @@ -117,7 +115,6 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
117 115 // deviceChannel);
118 116 redis.set(VideoManagerConstants.CACHEKEY_PREFIX + deviceId +
119 117 "_" + deviceChannel.getChannelId() +
120   - ":" + deviceChannel.getName() +
121 118 "_" + (deviceChannel.getStatus() == 1 ? "on":"off") +
122 119 "_" + (channelMap.get(deviceChannel.getChannelId()).size() > 0)+
123 120 "_" + (StringUtils.isEmpty(deviceChannel.getParentId())?null:deviceChannel.getParentId()),
... ... @@ -156,7 +153,8 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
156 153 "_" + queryOnline + // 搜索是否在线
157 154 "_" + queryHasSubChannel + // 搜索是否含有子节点
158 155 "_" + "*";
159   - List<Object> deviceChannelList = redis.keys(queryStr);
  156 +// List<Object> deviceChannelList = redis.keys(queryStr);
  157 + List<Object> deviceChannelList = redis.scan(queryStr);
160 158 pageResult.setPage(page);
161 159 pageResult.setCount(count);
162 160 pageResult.setTotal(deviceChannelList.size());
... ... @@ -180,10 +178,12 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
180 178 @Override
181 179 public List<DeviceChannel> queryChannelsByDeviceId(String deviceId) {
182 180 List<DeviceChannel> result = new ArrayList<>();
183   - List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
  181 +// List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
  182 + List<Object> deviceChannelList = redis.scan(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
  183 +
184 184 if (deviceChannelList != null && deviceChannelList.size() > 0 ) {
185 185 for (int i = 0; i < deviceChannelList.size(); i++) {
186   - result.add((DeviceChannel)redis.get((String)deviceChannelList.get(i)));
  186 + result.add((DeviceChannel)redis.get((String) deviceChannelList.get(i)));
187 187 }
188 188 }
189 189 return result;
... ... @@ -204,7 +204,8 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
204 204 "_" + queryHasSubChannel + // 搜索是否含有子节点
205 205 "_" + parentChannelId;
206 206  
207   - List<Object> deviceChannelList = redis.keys(queryStr);
  207 +// List<Object> deviceChannelList = redis.keys(queryStr);
  208 + List<Object> deviceChannelList = redis.scan(queryStr);
208 209  
209 210 if (deviceChannelList != null && deviceChannelList.size() > 0 ) {
210 211 for (int i = 0; i < deviceChannelList.size(); i++) {
... ... @@ -230,7 +231,8 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
230 231  
231 232 public List<DeviceChannel> querySubChannels(String deviceId, String parentChannelId) {
232 233 List<DeviceChannel> allDeviceChannels = new ArrayList<>();
233   - List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
  234 +// List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
  235 + List<Object> deviceChannelList = redis.scan(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
234 236  
235 237 if (deviceChannelList != null && deviceChannelList.size() > 0 ) {
236 238 for (int i = 0; i < deviceChannelList.size(); i++) {
... ... @@ -247,7 +249,8 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
247 249 @Override
248 250 public DeviceChannel queryChannel(String deviceId, String channelId) {
249 251 DeviceChannel deviceChannel = null;
250   - List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId +
  252 +// List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId +
  253 + List<Object> deviceChannelList = redis.scan(VideoManagerConstants.CACHEKEY_PREFIX + deviceId +
251 254 "_" + channelId + "*");
252 255 if (deviceChannelList != null && deviceChannelList.size() > 0 ) {
253 256 deviceChannel = (DeviceChannel)redis.get((String)deviceChannelList.get(0));
... ... @@ -271,7 +274,8 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
271 274  
272 275 if (deviceIds == null || deviceIds.length == 0) {
273 276  
274   - List<Object> deviceIdList = redis.keys(VideoManagerConstants.DEVICE_PREFIX+"*");
  277 +// List<Object> deviceIdList = redis.keys(VideoManagerConstants.DEVICE_PREFIX+"*");
  278 + List<Object> deviceIdList = redis.scan(VideoManagerConstants.DEVICE_PREFIX+"*");
275 279 pageResult.setTotal(deviceIdList.size());
276 280 int maxCount = (page + 1)* count;
277 281 for (int i = page * count; i < (pageResult.getTotal() > maxCount ? maxCount : pageResult.getTotal() ); i++) {
... ... @@ -297,7 +301,8 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
297 301 List<Device> devices = new ArrayList<>();
298 302  
299 303 if (deviceIds == null || deviceIds.length == 0) {
300   - List<Object> deviceIdList = redis.keys(VideoManagerConstants.DEVICE_PREFIX+"*");
  304 +// List<Object> deviceIdList = redis.keys(VideoManagerConstants.DEVICE_PREFIX+"*");
  305 + List<Object> deviceIdList = redis.scan(VideoManagerConstants.DEVICE_PREFIX+"*");
301 306 for (int i = 0; i < deviceIdList.size(); i++) {
302 307 devices.add((Device)redis.get((String)deviceIdList.get(i)));
303 308 }
... ... @@ -392,14 +397,16 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
392 397 }
393 398 @Override
394 399 public StreamInfo queryPlayBySSRC(String ssrc) {
395   - List<Object> playLeys = redis.keys(String.format("%S_%s_*", VideoManagerConstants.PLAYER_PREFIX, ssrc));
  400 +// List<Object> playLeys = redis.keys(String.format("%S_%s_*", VideoManagerConstants.PLAYER_PREFIX, ssrc));
  401 + List<Object> playLeys = redis.scan(String.format("%S_%s_*", VideoManagerConstants.PLAYER_PREFIX, ssrc));
396 402 if (playLeys == null || playLeys.size() == 0) return null;
397 403 return (StreamInfo)redis.get(playLeys.get(0).toString());
398 404 }
399 405  
400 406 @Override
401 407 public StreamInfo queryPlayByDevice(String deviceId, String code) {
402   - List<Object> playLeys = redis.keys(String.format("%S_*_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
  408 +// List<Object> playLeys = redis.keys(String.format("%S_*_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
  409 + List<Object> playLeys = redis.scan(String.format("%S_*_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
403 410 deviceId,
404 411 code));
405 412 if (playLeys == null || playLeys.size() == 0) return null;
... ... @@ -434,20 +441,21 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
434 441 for (Device device : devices) {
435 442 // 更新设备下的通道
436 443 HashMap<String, HashSet<String>> channelMap = new HashMap<String, HashSet<String>>();
437   - List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX +
  444 +// List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX +
  445 + List<Object> deviceChannelList = redis.scan(VideoManagerConstants.CACHEKEY_PREFIX +
438 446 device.getDeviceId() + "_" + "*");
439 447 if (deviceChannelList != null && deviceChannelList.size() > 0 ) {
440 448 for (int i = 0; i < deviceChannelList.size(); i++) {
441 449 String key = (String)deviceChannelList.get(i);
442 450 String[] s = key.split("_");
443   - String channelId = s[3].split(":")[0];
  451 + String channelId = s[3];
444 452 HashSet<String> subChannel = channelMap.get(channelId);
445 453 if (subChannel == null) {
446 454 subChannel = new HashSet<>();
447 455 }
448 456 System.out.println(key);
449   - if (s.length == 7 && !"null".equals(s[6])) {
450   - subChannel.add(s[6]);
  457 + if (s.length == 6 && !"null".equals(s[5])) {
  458 + subChannel.add(s[5]);
451 459 }
452 460 channelMap.put(channelId, subChannel);
453 461 }
... ... @@ -459,7 +467,8 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
459 467 @Override
460 468 public void cleanChannelsForDevice(String deviceId) {
461 469 List<DeviceChannel> result = new ArrayList<>();
462   - List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
  470 +// List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
  471 + List<Object> deviceChannelList = redis.scan(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
463 472 if (deviceChannelList != null && deviceChannelList.size() > 0 ) {
464 473 for (int i = 0; i < deviceChannelList.size(); i++) {
465 474 redis.del((String)deviceChannelList.get(i));
... ... @@ -470,7 +479,8 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
470 479 @Override
471 480 public Map<String, StreamInfo> queryPlayByDeviceId(String deviceId) {
472 481 Map<String, StreamInfo> streamInfos = new HashMap<>();
473   - List<Object> playLeys = redis.keys(String.format("%S_*_%S_*", VideoManagerConstants.PLAYER_PREFIX, deviceId));
  482 +// List<Object> playLeys = redis.keys(String.format("%S_*_%S_*", VideoManagerConstants.PLAYER_PREFIX, deviceId));
  483 + List<Object> playLeys = redis.scan(String.format("%S_*_%S_*", VideoManagerConstants.PLAYER_PREFIX, deviceId));
474 484 if (playLeys.size() == 0) return streamInfos;
475 485 for (int i = 0; i < playLeys.size(); i++) {
476 486 String key = (String) playLeys.get(i);
... ...
src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java
1 1 package com.genersoft.iot.vmp.utils.redis;
2 2  
3   -import java.util.ArrayList;
4   -import java.util.List;
5   -import java.util.Map;
6   -import java.util.Set;
  3 +import java.util.*;
7 4 import java.util.concurrent.TimeUnit;
8 5  
9 6 import org.springframework.beans.factory.annotation.Autowired;
10   -import org.springframework.data.redis.core.RedisTemplate;
11   -import org.springframework.data.redis.core.ZSetOperations;
  7 +import org.springframework.dao.DataAccessException;
  8 +import org.springframework.data.redis.connection.RedisConnection;
  9 +import org.springframework.data.redis.core.*;
12 10 import org.springframework.stereotype.Component;
13 11 import org.springframework.util.CollectionUtils;
14 12  
... ... @@ -661,7 +659,7 @@ public class RedisUtil {
661 659 return 0;
662 660 }
663 661 }
664   -
  662 +
665 663 /**
666 664 * 模糊查询
667 665 * @param key 键
... ... @@ -669,11 +667,67 @@ public class RedisUtil {
669 667 */
670 668 public List<Object> keys(String key) {
671 669 try {
672   - Set<String> set = redisTemplate.keys(key);
  670 + Set<String> set = redisTemplate.keys(key);
673 671 return new ArrayList<>(set);
674 672 } catch (Exception e) {
675 673 e.printStackTrace();
676 674 return null;
677 675 }
678 676 }
  677 +
  678 +
  679 + /**
  680 + * 模糊查询
  681 + * @param query 查询参数
  682 + * @return
  683 + */
  684 +// public List<Object> scan(String query) {
  685 +// List<Object> result = new ArrayList<>();
  686 +// try {
  687 +// Cursor<Map.Entry<Object,Object>> cursor = redisTemplate.opsForHash().scan("field",
  688 +// ScanOptions.scanOptions().match(query).count(1000).build());
  689 +// while (cursor.hasNext()) {
  690 +// Map.Entry<Object,Object> entry = cursor.next();
  691 +// result.add(entry.getKey());
  692 +// Object key = entry.getKey();
  693 +// Object valueSet = entry.getValue();
  694 +// }
  695 +// //关闭cursor
  696 +// cursor.close();
  697 +// } catch (Exception e) {
  698 +// e.printStackTrace();
  699 +// }
  700 +// return result;
  701 +// }
  702 +
  703 + /**
  704 + * 模糊查询
  705 + * @param query 查询参数
  706 + * @return
  707 + */
  708 + public List<Object> scan(String query) {
  709 + Set<String> keys = (Set<String>) redisTemplate.execute((RedisCallback<Set<String>>) connection -> {
  710 + Set<String> keysTmp = new HashSet<>();
  711 + Cursor<byte[]> cursor = connection.scan(new ScanOptions.ScanOptionsBuilder().match(query).count(1000).build());
  712 + while (cursor.hasNext()) {
  713 + keysTmp.add(new String(cursor.next()));
  714 + }
  715 + return keysTmp;
  716 + });
  717 +// Set<String> keys = (Set<String>) redisTemplate.execute(new RedisCallback<Set<String>>(){
  718 +//
  719 +// @Override
  720 +// public Set<String> doInRedis(RedisConnection connection) throws DataAccessException {
  721 +// Set<String> keysTmp = new HashSet<>();
  722 +// Cursor<byte[]> cursor = connection.scan(new ScanOptions.ScanOptionsBuilder().match(query).count(1000).build());
  723 +// while (cursor.hasNext()) {
  724 +// keysTmp.add(new String(cursor.next()));
  725 +// }
  726 +// return keysTmp;
  727 +// }
  728 +// });
  729 +
  730 + return new ArrayList<>(keys);
  731 + }
  732 +
679 733 }
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/device/entity/Device.java
... ... @@ -12,12 +12,14 @@ import javax.validation.constraints.Size;
12 12  
13 13 import io.swagger.annotations.ApiModel;
14 14 import io.swagger.annotations.ApiModelProperty;
  15 +import lombok.Data;
15 16  
16 17 /**
17 18 * @Description:视频设备信息
18 19 * @author: songww
19 20 * @date: 2020年5月8日 下午2:05:56
20 21 */
  22 +@Data
21 23 @ApiModel(value = "视频设备信息", description = "视频设备信息")
22 24 @Table(name="VMP_VIDEODEVICES")
23 25 public class Device {
... ... @@ -222,180 +224,4 @@ public class Device {
222 224 @Transient
223 225 private List<DeviceChannel> channelList;
224 226  
225   - public String getDeviceId() {
226   - return deviceId;
227   - }
228   -
229   - public void setDeviceId(String deviceId) {
230   - this.deviceId = deviceId;
231   - }
232   -
233   - public String getDeviceName() {
234   - return deviceName;
235   - }
236   -
237   - public void setDeviceName(String deviceName) {
238   - this.deviceName = deviceName;
239   - }
240   -
241   - public String getTransport() {
242   - return transport;
243   - }
244   -
245   - public void setTransport(String transport) {
246   - this.transport = transport;
247   - }
248   -
249   - public String getIp() {
250   - return ip;
251   - }
252   -
253   - public void setIp(String ip) {
254   - this.ip = ip;
255   - }
256   -
257   - public Integer getPort() {
258   - return port;
259   - }
260   -
261   - public void setPort(Integer port) {
262   - this.port = port;
263   - }
264   -
265   - public String getManufacturer() {
266   - return manufacturer;
267   - }
268   -
269   - public void setManufacturer(String manufacturer) {
270   - this.manufacturer = manufacturer;
271   - }
272   -
273   - public String getModel() {
274   - return model;
275   - }
276   -
277   - public void setModel(String model) {
278   - this.model = model;
279   - }
280   -
281   - public String getFirmware() {
282   - return firmware;
283   - }
284   -
285   - public void setFirmware(String firmware) {
286   - this.firmware = firmware;
287   - }
288   -
289   - public String getOnline() {
290   - return online;
291   - }
292   -
293   - public void setOnline(String online) {
294   - this.online = online;
295   - }
296   -
297   - public String getStreamMode() {
298   - return streamMode;
299   - }
300   -
301   - public void setStreamMode(String streamMode) {
302   - this.streamMode = streamMode;
303   - }
304   -
305   - public List<DeviceChannel> getChannelList() {
306   - return channelList;
307   - }
308   -
309   - public void setChannelList(List<DeviceChannel> channelList) {
310   - this.channelList = channelList;
311   - }
312   -
313   - public Integer getChannelSum() {
314   - return channelSum;
315   - }
316   -
317   - public void setChannelSum(Integer channelSum) {
318   - this.channelSum = channelSum;
319   - }
320   -
321   - public String getCreateTime() {
322   - return createTime;
323   - }
324   -
325   - public void setCreateTime(String createTime) {
326   - this.createTime = createTime;
327   - }
328   -
329   - public String getRegisterTime() {
330   - return registerTime;
331   - }
332   -
333   - public void setRegisterTime(String registerTime) {
334   - this.registerTime = registerTime;
335   - }
336   -
337   - public String getHeartbeatTime() {
338   - return heartbeatTime;
339   - }
340   -
341   - public void setHeartbeatTime(String heartbeatTime) {
342   - this.heartbeatTime = heartbeatTime;
343   - }
344   -
345   - public String getUpdateTime() {
346   - return updateTime;
347   - }
348   -
349   - public void setUpdateTime(String updateTime) {
350   - this.updateTime = updateTime;
351   - }
352   -
353   - public String getUpdatePerson() {
354   - return updatePerson;
355   - }
356   -
357   - public void setUpdatePerson(String updatePerson) {
358   - this.updatePerson = updatePerson;
359   - }
360   -
361   - public String getSyncTime() {
362   - return syncTime;
363   - }
364   -
365   - public void setSyncTime(String syncTime) {
366   - this.syncTime = syncTime;
367   - }
368   -
369   - public String getSyncPerson() {
370   - return syncPerson;
371   - }
372   -
373   - public void setSyncPerson(String syncPerson) {
374   - this.syncPerson = syncPerson;
375   - }
376   -
377   - public String getUsername() {
378   - return username;
379   - }
380   -
381   - public void setUsername(String username) {
382   - this.username = username;
383   - }
384   -
385   - public String getPassword() {
386   - return password;
387   - }
388   -
389   - public void setPassword(String password) {
390   - this.password = password;
391   - }
392   -
393   - public String getProtocol() {
394   - return protocol;
395   - }
396   -
397   - public void setProtocol(String protocol) {
398   - this.protocol = protocol;
399   - }
400   -
401 227 }
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/device/entity/DeviceChannel.java
... ... @@ -6,12 +6,14 @@ import javax.persistence.Table;
6 6  
7 7 import io.swagger.annotations.ApiModel;
8 8 import io.swagger.annotations.ApiModelProperty;
  9 +import lombok.Data;
9 10  
10 11 /**
11 12 * @Description:设备通道信息
12 13 * @author: songww
13 14 * @date: 2020年5月20日 下午9:00:46
14 15 */
  16 +@Data
15 17 @ApiModel(value = "设备通道信息", description = "设备通道信息")
16 18 @Table(name="VMP_VIDEOCHANNELS")
17 19 public class DeviceChannel {
... ... @@ -191,195 +193,4 @@ public class DeviceChannel {
191 193 @Column(name="LATITUDE")
192 194 private double latitude;
193 195  
194   - public String getChannelId() {
195   - return channelId;
196   - }
197   -
198   - public void setChannelId(String channelId) {
199   - this.channelId = channelId;
200   - }
201   -
202   - public String getDeviceId() {
203   - return deviceId;
204   - }
205   -
206   - public void setDeviceId(String deviceId) {
207   - this.deviceId = deviceId;
208   - }
209   -
210   - public String getChannelName() {
211   - return channelName;
212   - }
213   -
214   - public void setChannelName(String channelName) {
215   - this.channelName = channelName;
216   - }
217   -
218   - public String getOnline() {
219   - return online;
220   - }
221   -
222   - public void setOnline(String online) {
223   - this.online = online;
224   - }
225   -
226   - public String getManufacture() {
227   - return manufacture;
228   - }
229   -
230   - public void setManufacture(String manufacture) {
231   - this.manufacture = manufacture;
232   - }
233   -
234   - public String getModel() {
235   - return model;
236   - }
237   -
238   - public void setModel(String model) {
239   - this.model = model;
240   - }
241   -
242   - public String getOwner() {
243   - return owner;
244   - }
245   -
246   - public void setOwner(String owner) {
247   - this.owner = owner;
248   - }
249   -
250   - public String getCivilCode() {
251   - return civilCode;
252   - }
253   -
254   - public void setCivilCode(String civilCode) {
255   - this.civilCode = civilCode;
256   - }
257   -
258   - public String getBlock() {
259   - return block;
260   - }
261   -
262   - public void setBlock(String block) {
263   - this.block = block;
264   - }
265   -
266   - public String getAddress() {
267   - return address;
268   - }
269   -
270   - public void setAddress(String address) {
271   - this.address = address;
272   - }
273   -
274   - public String getParental() {
275   - return parental;
276   - }
277   -
278   - public void setParental(String parental) {
279   - this.parental = parental;
280   - }
281   -
282   - public String getParentId() {
283   - return parentId;
284   - }
285   -
286   - public void setParentId(String parentId) {
287   - this.parentId = parentId;
288   - }
289   -
290   - public String getSafetyWay() {
291   - return safetyWay;
292   - }
293   -
294   - public void setSafetyWay(String safetyWay) {
295   - this.safetyWay = safetyWay;
296   - }
297   -
298   - public String getRegisterWay() {
299   - return registerWay;
300   - }
301   -
302   - public void setRegisterWay(String registerWay) {
303   - this.registerWay = registerWay;
304   - }
305   -
306   - public String getCertNum() {
307   - return certNum;
308   - }
309   -
310   - public void setCertNum(String certNum) {
311   - this.certNum = certNum;
312   - }
313   -
314   - public String getCertValid() {
315   - return certValid;
316   - }
317   -
318   - public void setCertValid(String certValid) {
319   - this.certValid = certValid;
320   - }
321   -
322   - public String getCertErrCode() {
323   - return certErrCode;
324   - }
325   -
326   - public void setCertErrCode(String certErrCode) {
327   - this.certErrCode = certErrCode;
328   - }
329   -
330   - public String getCertEndTime() {
331   - return certEndTime;
332   - }
333   -
334   - public void setCertEndTime(String certEndTime) {
335   - this.certEndTime = certEndTime;
336   - }
337   -
338   - public String getSecrecy() {
339   - return secrecy;
340   - }
341   -
342   - public void setSecrecy(String secrecy) {
343   - this.secrecy = secrecy;
344   - }
345   -
346   - public String getIp() {
347   - return ip;
348   - }
349   -
350   - public void setIp(String ip) {
351   - this.ip = ip;
352   - }
353   -
354   - public Integer getPort() {
355   - return port;
356   - }
357   -
358   - public void setPort(Integer port) {
359   - this.port = port;
360   - }
361   -
362   - public String getPassword() {
363   - return password;
364   - }
365   -
366   - public void setPassword(String password) {
367   - this.password = password;
368   - }
369   -
370   - public double getLongitude() {
371   - return longitude;
372   - }
373   -
374   - public void setLongitude(double longitude) {
375   - this.longitude = longitude;
376   - }
377   -
378   - public double getLatitude() {
379   - return latitude;
380   - }
381   -
382   - public void setLatitude(double latitude) {
383   - this.latitude = latitude;
384   - }
385 196 }
... ...