Commit 11e8fad2e981b3dca22dad4048246d012ce326b7

Authored by 648540858
Committed by GitHub
2 parents d09ee0c2 f92a5da7

Merge pull request #113 from lawrencehj/wvp-28181-2.0

修正SSE、jar路径和API代理部分错误
Showing 30 changed files with 44 additions and 66 deletions
src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
@@ -3,7 +3,6 @@ package com.genersoft.iot.vmp; @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp;
3 import java.util.logging.LogManager; 3 import java.util.logging.LogManager;
4 4
5 import org.springframework.boot.SpringApplication; 5 import org.springframework.boot.SpringApplication;
6 -import org.springframework.boot.autoconfigure.EnableAutoConfiguration;  
7 import org.springframework.boot.autoconfigure.SpringBootApplication; 6 import org.springframework.boot.autoconfigure.SpringBootApplication;
8 import org.springframework.context.ConfigurableApplicationContext; 7 import org.springframework.context.ConfigurableApplicationContext;
9 import springfox.documentation.oas.annotations.EnableOpenApi; 8 import springfox.documentation.oas.annotations.EnableOpenApi;
src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
@@ -16,7 +16,7 @@ public class VideoManagerConstants { @@ -16,7 +16,7 @@ public class VideoManagerConstants {
16 16
17 public static final String CACHEKEY_PREFIX = "VMP_channel_"; 17 public static final String CACHEKEY_PREFIX = "VMP_channel_";
18 18
19 - public static final String KEEPLIVEKEY_PREFIX = "VMP_KEEPLIVE_"; 19 + public static final String KEEPLIVEKEY_PREFIX = "VMP_keeplive_";
20 20
21 public static final String PLAYER_PREFIX = "VMP_player_"; 21 public static final String PLAYER_PREFIX = "VMP_player_";
22 22
src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java
1 package com.genersoft.iot.vmp.conf; 1 package com.genersoft.iot.vmp.conf;
2 2
3 -import io.netty.util.internal.StringUtil;  
4 import org.springframework.beans.factory.annotation.Value; 3 import org.springframework.beans.factory.annotation.Value;
5 import org.springframework.context.annotation.Configuration; 4 import org.springframework.context.annotation.Configuration;
6 import org.springframework.util.StringUtils; 5 import org.springframework.util.StringUtils;
src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java
@@ -2,8 +2,7 @@ package com.genersoft.iot.vmp.conf; @@ -2,8 +2,7 @@ package com.genersoft.iot.vmp.conf;
2 2
3 import org.apache.http.HttpRequest; 3 import org.apache.http.HttpRequest;
4 import org.apache.http.HttpResponse; 4 import org.apache.http.HttpResponse;
5 -import org.apache.http.client.config.RequestConfig;  
6 -import org.apache.http.impl.client.HttpClientBuilder; 5 +import org.apache.catalina.connector.ClientAbortException;
7 import org.mitre.dsmiley.httpproxy.ProxyServlet; 6 import org.mitre.dsmiley.httpproxy.ProxyServlet;
8 import org.slf4j.Logger; 7 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
@@ -14,16 +13,11 @@ import org.springframework.context.annotation.Configuration; @@ -14,16 +13,11 @@ import org.springframework.context.annotation.Configuration;
14 import org.springframework.util.StringUtils; 13 import org.springframework.util.StringUtils;
15 14
16 import javax.servlet.ServletException; 15 import javax.servlet.ServletException;
17 -import javax.servlet.ServletRequest;  
18 -import javax.servlet.ServletResponse;  
19 import javax.servlet.http.HttpServletRequest; 16 import javax.servlet.http.HttpServletRequest;
20 -import javax.servlet.http.HttpServletResponse;  
21 import java.io.IOException; 17 import java.io.IOException;
22 import java.net.ConnectException; 18 import java.net.ConnectException;
23 -import java.util.Locale;  
24 -import java.util.Map;  
25 -  
26 19
  20 +@SuppressWarnings(value = {"rawtypes", "unchecked"})
27 @Configuration 21 @Configuration
28 public class ProxyServletConfig { 22 public class ProxyServletConfig {
29 23
@@ -61,7 +55,7 @@ public class ProxyServletConfig { @@ -61,7 +55,7 @@ public class ProxyServletConfig {
61 55
62 @Override 56 @Override
63 protected void handleRequestException(HttpRequest proxyRequest, HttpResponse proxyResonse, Exception e){ 57 protected void handleRequestException(HttpRequest proxyRequest, HttpResponse proxyResonse, Exception e){
64 - System.out.println(e.getMessage()); 58 + //System.out.println(e.getMessage());
65 try { 59 try {
66 super.handleRequestException(proxyRequest, proxyResonse, e); 60 super.handleRequestException(proxyRequest, proxyResonse, e);
67 } catch (ServletException servletException) { 61 } catch (ServletException servletException) {
@@ -69,7 +63,9 @@ public class ProxyServletConfig { @@ -69,7 +63,9 @@ public class ProxyServletConfig {
69 } catch (IOException ioException) { 63 } catch (IOException ioException) {
70 if (ioException instanceof ConnectException) { 64 if (ioException instanceof ConnectException) {
71 logger.error("zlm 连接失败"); 65 logger.error("zlm 连接失败");
72 - }else { 66 + } else if (ioException instanceof ClientAbortException) {
  67 + logger.error("用户已中断连接,代理终止");
  68 + } else {
73 logger.error("zlm 代理失败: ", e); 69 logger.error("zlm 代理失败: ", e);
74 } 70 }
75 } catch (RuntimeException exception){ 71 } catch (RuntimeException exception){
src/main/java/com/genersoft/iot/vmp/conf/SipDeviceRunner.java
1 package com.genersoft.iot.vmp.conf; 1 package com.genersoft.iot.vmp.conf;
2 2
3 -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;  
4 -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;  
5 -import com.genersoft.iot.vmp.gb28181.event.EventPublisher;  
6 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 3 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
7 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 4 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
8 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,7 +7,6 @@ import org.springframework.boot.CommandLineRunner; @@ -10,7 +7,6 @@ import org.springframework.boot.CommandLineRunner;
10 import org.springframework.core.annotation.Order; 7 import org.springframework.core.annotation.Order;
11 import org.springframework.stereotype.Component; 8 import org.springframework.stereotype.Component;
12 9
13 -import java.util.List;  
14 10
15 /** 11 /**
16 * 系统启动时控制设备离线 12 * 系统启动时控制设备离线
src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
@@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.conf.security; @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.conf.security;
2 2
3 import com.genersoft.iot.vmp.conf.UserSetup; 3 import com.genersoft.iot.vmp.conf.UserSetup;
4 import org.springframework.beans.factory.annotation.Autowired; 4 import org.springframework.beans.factory.annotation.Autowired;
5 -import org.springframework.beans.factory.annotation.Value;  
6 import org.springframework.context.annotation.Bean; 5 import org.springframework.context.annotation.Bean;
7 import org.springframework.context.annotation.Configuration; 6 import org.springframework.context.annotation.Configuration;
8 import org.springframework.security.authentication.AuthenticationManager; 7 import org.springframework.security.authentication.AuthenticationManager;
src/main/java/com/genersoft/iot/vmp/gb28181/session/SsrcUtil.java
@@ -5,7 +5,6 @@ import java.util.List; @@ -5,7 +5,6 @@ import java.util.List;
5 import java.util.Random; 5 import java.util.Random;
6 6
7 import com.genersoft.iot.vmp.conf.SipConfig; 7 import com.genersoft.iot.vmp.conf.SipConfig;
8 -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;  
9 import com.genersoft.iot.vmp.utils.SpringBeanFactory; 8 import com.genersoft.iot.vmp.utils.SpringBeanFactory;
10 import org.slf4j.Logger; 9 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
1 package com.genersoft.iot.vmp.gb28181.transmit.cmd.impl; 1 package com.genersoft.iot.vmp.gb28181.transmit.cmd.impl;
2 2
3 -import com.genersoft.iot.vmp.conf.MediaConfig;  
4 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; 3 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
5 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; 4 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
6 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; 5 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
@@ -12,7 +11,6 @@ import org.slf4j.Logger; @@ -12,7 +11,6 @@ import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 11 import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.beans.factory.annotation.Qualifier; 13 import org.springframework.beans.factory.annotation.Qualifier;
15 -import org.springframework.beans.factory.annotation.Value;  
16 import org.springframework.context.annotation.DependsOn; 14 import org.springframework.context.annotation.DependsOn;
17 import org.springframework.context.annotation.Lazy; 15 import org.springframework.context.annotation.Lazy;
18 import org.springframework.lang.Nullable; 16 import org.springframework.lang.Nullable;
@@ -23,8 +21,6 @@ import javax.sip.header.CallIdHeader; @@ -23,8 +21,6 @@ import javax.sip.header.CallIdHeader;
23 import javax.sip.header.WWWAuthenticateHeader; 21 import javax.sip.header.WWWAuthenticateHeader;
24 import javax.sip.message.Request; 22 import javax.sip.message.Request;
25 import java.text.ParseException; 23 import java.text.ParseException;
26 -import java.util.Timer;  
27 -import java.util.TimerTask;  
28 import java.util.UUID; 24 import java.util.UUID;
29 25
30 @Component 26 @Component
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java
@@ -2,10 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.request.impl; @@ -2,10 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.request.impl;
2 2
3 import java.security.NoSuchAlgorithmException; 3 import java.security.NoSuchAlgorithmException;
4 import java.text.ParseException; 4 import java.text.ParseException;
5 -import java.text.SimpleDateFormat;  
6 -import java.time.LocalDateTime;  
7 import java.util.Calendar; 5 import java.util.Calendar;
8 -import java.util.Date;  
9 import java.util.Locale; 6 import java.util.Locale;
10 7
11 import javax.sip.InvalidArgumentException; 8 import javax.sip.InvalidArgumentException;
@@ -22,7 +19,6 @@ import javax.sip.message.Response; @@ -22,7 +19,6 @@ import javax.sip.message.Response;
22 import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate; 19 import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate;
23 import gov.nist.javax.sip.RequestEventExt; 20 import gov.nist.javax.sip.RequestEventExt;
24 import gov.nist.javax.sip.header.SIPDateHeader; 21 import gov.nist.javax.sip.header.SIPDateHeader;
25 -import gov.nist.javax.sip.message.SIPRequest;  
26 import org.slf4j.Logger; 22 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory; 23 import org.slf4j.LoggerFactory;
28 import org.springframework.util.StringUtils; 24 import org.springframework.util.StringUtils;
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java
@@ -5,7 +5,6 @@ import com.genersoft.iot.vmp.gb28181.SipLayer; @@ -5,7 +5,6 @@ import com.genersoft.iot.vmp.gb28181.SipLayer;
5 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; 5 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
6 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; 6 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
7 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; 7 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
8 -import com.genersoft.iot.vmp.gb28181.transmit.request.impl.RegisterRequestProcessor;  
9 import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor; 8 import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor;
10 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 9 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
11 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 10 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -15,10 +15,8 @@ import com.genersoft.iot.vmp.service.IPlayService; @@ -15,10 +15,8 @@ import com.genersoft.iot.vmp.service.IPlayService;
15 import org.slf4j.Logger; 15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory; 16 import org.slf4j.LoggerFactory;
17 import org.springframework.beans.factory.annotation.Autowired; 17 import org.springframework.beans.factory.annotation.Autowired;
18 -import org.springframework.beans.factory.annotation.Value;  
19 import org.springframework.http.HttpStatus; 18 import org.springframework.http.HttpStatus;
20 import org.springframework.http.ResponseEntity; 19 import org.springframework.http.ResponseEntity;
21 -import org.springframework.util.StringUtils;  
22 import org.springframework.web.bind.annotation.PostMapping; 20 import org.springframework.web.bind.annotation.PostMapping;
23 import org.springframework.web.bind.annotation.RequestBody; 21 import org.springframework.web.bind.annotation.RequestBody;
24 import org.springframework.web.bind.annotation.RequestMapping; 22 import org.springframework.web.bind.annotation.RequestMapping;
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
@@ -8,7 +8,6 @@ import com.genersoft.iot.vmp.gb28181.session.SsrcUtil; @@ -8,7 +8,6 @@ import com.genersoft.iot.vmp.gb28181.session.SsrcUtil;
8 import org.slf4j.Logger; 8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 9 import org.slf4j.LoggerFactory;
10 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
11 -import org.springframework.beans.factory.annotation.Value;  
12 import org.springframework.stereotype.Component; 11 import org.springframework.stereotype.Component;
13 12
14 import java.util.HashMap; 13 import java.util.HashMap;
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerConfig.java
1 package com.genersoft.iot.vmp.media.zlm; 1 package com.genersoft.iot.vmp.media.zlm;
2 2
3 import com.alibaba.fastjson.annotation.JSONField; 3 import com.alibaba.fastjson.annotation.JSONField;
4 -import org.springframework.util.StringUtils;  
5 4
6 public class ZLMServerConfig { 5 public class ZLMServerConfig {
7 6
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerManger.java
1 package com.genersoft.iot.vmp.media.zlm; 1 package com.genersoft.iot.vmp.media.zlm;
2 2
3 -import com.alibaba.fastjson.annotation.JSONField;  
4 import com.genersoft.iot.vmp.conf.MediaConfig; 3 import com.genersoft.iot.vmp.conf.MediaConfig;
5 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 4 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
6 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
src/main/java/com/genersoft/iot/vmp/onvif/impl/ONVIFServerIMpl.java
@@ -12,8 +12,6 @@ import org.slf4j.Logger; @@ -12,8 +12,6 @@ import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 12 import org.slf4j.LoggerFactory;
13 import org.springframework.stereotype.Service; 13 import org.springframework.stereotype.Service;
14 14
15 -import java.net.URI;  
16 -import java.net.URISyntaxException;  
17 import java.util.ArrayList; 15 import java.util.ArrayList;
18 import java.util.HashMap; 16 import java.util.HashMap;
19 import java.util.List; 17 import java.util.List;
src/main/java/com/genersoft/iot/vmp/service/IMediaService.java
1 package com.genersoft.iot.vmp.service; 1 package com.genersoft.iot.vmp.service;
2 2
3 import com.alibaba.fastjson.JSONArray; 3 import com.alibaba.fastjson.JSONArray;
4 -import com.alibaba.fastjson.JSONObject;  
5 import com.genersoft.iot.vmp.common.StreamInfo; 4 import com.genersoft.iot.vmp.common.StreamInfo;
6 5
7 /** 6 /**
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
@@ -24,7 +24,6 @@ import gov.nist.javax.sip.stack.SIPDialog; @@ -24,7 +24,6 @@ import gov.nist.javax.sip.stack.SIPDialog;
24 import org.slf4j.Logger; 24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory; 25 import org.slf4j.LoggerFactory;
26 import org.springframework.beans.factory.annotation.Autowired; 26 import org.springframework.beans.factory.annotation.Autowired;
27 -import org.springframework.beans.factory.annotation.Value;  
28 import org.springframework.http.HttpStatus; 27 import org.springframework.http.HttpStatus;
29 import org.springframework.http.ResponseEntity; 28 import org.springframework.http.ResponseEntity;
30 import org.springframework.stereotype.Service; 29 import org.springframework.stereotype.Service;
@@ -32,13 +31,11 @@ import org.springframework.util.ResourceUtils; @@ -32,13 +31,11 @@ import org.springframework.util.ResourceUtils;
32 import org.springframework.web.context.request.async.DeferredResult; 31 import org.springframework.web.context.request.async.DeferredResult;
33 32
34 import javax.sip.ClientTransaction; 33 import javax.sip.ClientTransaction;
35 -import javax.sip.Dialog;  
36 -import javax.sip.header.CallIdHeader;  
37 import javax.sip.message.Response; 34 import javax.sip.message.Response;
38 -import java.io.File;  
39 import java.io.FileNotFoundException; 35 import java.io.FileNotFoundException;
40 import java.util.UUID; 36 import java.util.UUID;
41 37
  38 +@SuppressWarnings(value = {"rawtypes", "unchecked"})
42 @Service 39 @Service
43 public class PlayServiceImpl implements IPlayService { 40 public class PlayServiceImpl implements IPlayService {
44 41
@@ -97,7 +94,20 @@ public class PlayServiceImpl implements IPlayService { @@ -97,7 +94,20 @@ public class PlayServiceImpl implements IPlayService {
97 result.onCompletion(()->{ 94 result.onCompletion(()->{
98 // 点播结束时调用截图接口 95 // 点播结束时调用截图接口
99 try { 96 try {
100 - String path = ResourceUtils.getURL("classpath:").getPath()+"static/static/snap/"; 97 + String classPath = ResourceUtils.getURL("classpath:").getPath();
  98 + // System.out.println(classPath);
  99 + String path = classPath + "static/static/snap/";
  100 + if(classPath.contains("jar")) {
  101 + classPath = classPath.substring(0, classPath.lastIndexOf("."));
  102 + classPath = classPath.substring(0, classPath.lastIndexOf("/"));
  103 + path = classPath + "/snap/";
  104 + }
  105 + if (path.startsWith("file:")) {
  106 + path = path.substring(path.indexOf(":") + 1, path.length());
  107 + }
  108 + if(System.getProperty("os.name").contains("indows")) {
  109 + path = path.substring(1, path.length());
  110 + }
101 String fileName = deviceId + "_" + channelId + ".jpg"; 111 String fileName = deviceId + "_" + channelId + ".jpg";
102 ResponseEntity responseEntity = (ResponseEntity)result.getResult(); 112 ResponseEntity responseEntity = (ResponseEntity)result.getResult();
103 if (responseEntity != null && responseEntity.getStatusCode() == HttpStatus.OK) { 113 if (responseEntity != null && responseEntity.getStatusCode() == HttpStatus.OK) {
@@ -109,7 +119,6 @@ public class PlayServiceImpl implements IPlayService { @@ -109,7 +119,6 @@ public class PlayServiceImpl implements IPlayService {
109 zlmresTfulUtils.getSnap(flvUrl, 5, 1, path, fileName); 119 zlmresTfulUtils.getSnap(flvUrl, 5, 1, path, fileName);
110 } 120 }
111 } 121 }
112 -  
113 System.out.println(path); 122 System.out.println(path);
114 } catch (FileNotFoundException e) { 123 } catch (FileNotFoundException e) {
115 e.printStackTrace(); 124 e.printStackTrace();
src/main/java/com/genersoft/iot/vmp/service/impl/RecordInfoServerImpl.java
1 package com.genersoft.iot.vmp.service.impl; 1 package com.genersoft.iot.vmp.service.impl;
2 2
3 -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;  
4 import com.genersoft.iot.vmp.service.IRecordInfoServer; 3 import com.genersoft.iot.vmp.service.IRecordInfoServer;
5 import com.genersoft.iot.vmp.storager.dao.RecordInfoDao; 4 import com.genersoft.iot.vmp.storager.dao.RecordInfoDao;
6 import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo; 5 import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo;
src/main/java/com/genersoft/iot/vmp/storager/dao/RecordInfoDao.java
1 package com.genersoft.iot.vmp.storager.dao; 1 package com.genersoft.iot.vmp.storager.dao;
2 2
3 import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo; 3 import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo;
4 -import com.genersoft.iot.vmp.storager.dao.dto.User;  
5 import org.apache.ibatis.annotations.Delete; 4 import org.apache.ibatis.annotations.Delete;
6 import org.apache.ibatis.annotations.Insert; 5 import org.apache.ibatis.annotations.Insert;
7 import org.apache.ibatis.annotations.Mapper; 6 import org.apache.ibatis.annotations.Mapper;
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.storager.impl; @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.storager.impl;
3 import java.text.SimpleDateFormat; 3 import java.text.SimpleDateFormat;
4 import java.util.*; 4 import java.util.*;
5 5
6 -import com.genersoft.iot.vmp.common.StreamInfo;  
7 import com.genersoft.iot.vmp.gb28181.bean.*; 6 import com.genersoft.iot.vmp.gb28181.bean.*;
8 import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; 7 import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
9 import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; 8 import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java
@@ -8,7 +8,7 @@ import io.swagger.annotations.ApiOperation; @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiOperation;
8 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.stereotype.Controller; 9 import org.springframework.stereotype.Controller;
10 import org.springframework.web.bind.annotation.CrossOrigin; 10 import org.springframework.web.bind.annotation.CrossOrigin;
11 -import org.springframework.web.bind.annotation.PostMapping; 11 +import org.springframework.web.bind.annotation.GetMapping;
12 import org.springframework.web.bind.annotation.RequestMapping; 12 import org.springframework.web.bind.annotation.RequestMapping;
13 import org.springframework.web.bind.annotation.RequestParam; 13 import org.springframework.web.bind.annotation.RequestParam;
14 import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; 14 import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
@@ -30,7 +30,7 @@ public class SseController { @@ -30,7 +30,7 @@ public class SseController {
30 @ApiImplicitParams({ 30 @ApiImplicitParams({
31 @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), 31 @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class),
32 }) 32 })
33 - @PostMapping("/emit") 33 + @GetMapping("/emit")
34 public SseEmitter emit(@RequestParam String browserId) { 34 public SseEmitter emit(@RequestParam String browserId) {
35 final SseEmitter sseEmitter = new SseEmitter(0L); 35 final SseEmitter sseEmitter = new SseEmitter(0L);
36 try { 36 try {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java
@@ -120,7 +120,7 @@ public class DeviceControl { @@ -120,7 +120,7 @@ public class DeviceControl {
120 * @param deviceId 设备ID 120 * @param deviceId 设备ID
121 * @param guardCmdStr SetGuard:布防,ResetGuard:撤防 121 * @param guardCmdStr SetGuard:布防,ResetGuard:撤防
122 */ 122 */
123 - @ApiOperation("录像控制命令") 123 + @ApiOperation("布防/撤防命令")
124 @ApiImplicitParams({ 124 @ApiImplicitParams({
125 @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), 125 @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
126 @ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true, 126 @ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true,
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
@@ -19,7 +19,6 @@ import org.slf4j.LoggerFactory; @@ -19,7 +19,6 @@ import org.slf4j.LoggerFactory;
19 import org.springframework.beans.factory.annotation.Autowired; 19 import org.springframework.beans.factory.annotation.Autowired;
20 import org.springframework.http.HttpStatus; 20 import org.springframework.http.HttpStatus;
21 import org.springframework.http.ResponseEntity; 21 import org.springframework.http.ResponseEntity;
22 -import org.springframework.util.ResourceUtils;  
23 import org.springframework.web.bind.annotation.CrossOrigin; 22 import org.springframework.web.bind.annotation.CrossOrigin;
24 import org.springframework.web.bind.annotation.GetMapping; 23 import org.springframework.web.bind.annotation.GetMapping;
25 import org.springframework.web.bind.annotation.PathVariable; 24 import org.springframework.web.bind.annotation.PathVariable;
@@ -32,7 +31,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; @@ -32,7 +31,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
32 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 31 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
33 import org.springframework.web.context.request.async.DeferredResult; 32 import org.springframework.web.context.request.async.DeferredResult;
34 33
35 -import java.io.FileNotFoundException;  
36 import java.util.UUID; 34 import java.util.UUID;
37 35
38 import javax.sip.message.Response; 36 import javax.sip.message.Response;
src/main/java/com/genersoft/iot/vmp/vmanager/onvif/ONVIFController.java
@@ -17,6 +17,7 @@ import org.springframework.web.context.request.async.DeferredResult; @@ -17,6 +17,7 @@ import org.springframework.web.context.request.async.DeferredResult;
17 import java.util.List; 17 import java.util.List;
18 import java.util.UUID; 18 import java.util.UUID;
19 19
  20 +@SuppressWarnings(value = {"rawtypes", "unchecked"})
20 @Api(tags = "onvif设备") 21 @Api(tags = "onvif设备")
21 @CrossOrigin 22 @CrossOrigin
22 @RestController 23 @RestController
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
@@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.vmanager.server; @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.vmanager.server;
3 import com.genersoft.iot.vmp.VManageBootstrap; 3 import com.genersoft.iot.vmp.VManageBootstrap;
4 import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig; 4 import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig;
5 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 5 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
6 -import com.genersoft.iot.vmp.storager.impl.RedisCatchStorageImpl;  
7 import com.genersoft.iot.vmp.utils.SpringBeanFactory; 6 import com.genersoft.iot.vmp.utils.SpringBeanFactory;
8 import gov.nist.javax.sip.SipStackImpl; 7 import gov.nist.javax.sip.SipStackImpl;
9 import io.swagger.annotations.Api; 8 import io.swagger.annotations.Api;
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
16 import org.springframework.stereotype.Controller; 16 import org.springframework.stereotype.Controller;
17 import org.springframework.web.bind.annotation.*; 17 import org.springframework.web.bind.annotation.*;
18 18
  19 +@SuppressWarnings("rawtypes")
19 /** 20 /**
20 * 拉流代理接口 21 * 拉流代理接口
21 */ 22 */
src/main/resources/application-dev.yml
@@ -15,6 +15,8 @@ spring: @@ -15,6 +15,8 @@ spring:
15 datasource: 15 datasource:
16 name: eiot 16 name: eiot
17 url: jdbc:sqlite::resource:wvp.sqlite 17 url: jdbc:sqlite::resource:wvp.sqlite
  18 + # 打包为jar运行时把wvp.sqlite发到jar同级文件夹,同时url改为:
  19 + # url: jdbc:sqlite:wvp.sqlite
18 username: 20 username:
19 password: 21 password:
20 type: com.alibaba.druid.pool.DruidDataSource 22 type: com.alibaba.druid.pool.DruidDataSource
@@ -59,6 +61,18 @@ media: @@ -59,6 +61,18 @@ media:
59 # 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用 61 # 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用
60 recordAssistPort: 0 62 recordAssistPort: 0
61 63
  64 +
  65 +# [可选] 日志配置, 一般不需要改
  66 +logging:
  67 + file:
  68 + name: logs/wvp.log
  69 + max-history: 30
  70 + max-size: 10MB
  71 + total-size-cap: 300MB
  72 + level:
  73 + com:
  74 + genersoft:
  75 + iot: info
62 # [根据业务需求配置] 76 # [根据业务需求配置]
63 userSettings: 77 userSettings:
64 # [可选] 自动点播, 使用固定流地址进行播放时,如果未点播则自动进行点播, 需要rtp.enable=true 78 # [可选] 自动点播, 使用固定流地址进行播放时,如果未点播则自动进行点播, 需要rtp.enable=true
@@ -73,15 +87,3 @@ springfox: @@ -73,15 +87,3 @@ springfox:
73 documentation: 87 documentation:
74 swagger-ui: 88 swagger-ui:
75 enabled: true 89 enabled: true
76 -  
77 -# [可选] 日志配置, 一般不需要改  
78 -logging:  
79 - file:  
80 - name: logs/wvp.log  
81 - max-history: 30  
82 - max-size: 10MB  
83 - total-size-cap: 300MB  
84 - level:  
85 - com:  
86 - genersoft:  
87 - iot: info  
88 \ No newline at end of file 90 \ No newline at end of file
web_src/src/components/Login.vue
@@ -80,7 +80,7 @@ export default { @@ -80,7 +80,7 @@ export default {
80 80
81 this.$axios({ 81 this.$axios({
82 method: 'get', 82 method: 'get',
83 - url:"/api/user/login", 83 + url:"/api/user/login",
84 params: loginParam 84 params: loginParam
85 }).then(function (res) { 85 }).then(function (res) {
86 console.log(JSON.stringify(res)); 86 console.log(JSON.stringify(res));
web_src/src/components/ParentPlatformList.vue
@@ -156,7 +156,7 @@ export default { @@ -156,7 +156,7 @@ export default {
156 156
157 this.$axios({ 157 this.$axios({
158 method: 'get', 158 method: 'get',
159 - url:`/api/platform/query/${that.count}/${that.currentPage}` 159 + url:`/api/platform/query/${that.count}/${that.currentPage}`
160 }).then(function (res) { 160 }).then(function (res) {
161 that.total = res.data.total; 161 that.total = res.data.total;
162 that.platformList = res.data.list; 162 that.platformList = res.data.list;
web_src/src/main.js
@@ -47,7 +47,7 @@ axios.interceptors.response.use(function (response) { @@ -47,7 +47,7 @@ axios.interceptors.response.use(function (response) {
47 }, function (error) { 47 }, function (error) {
48 // 对响应错误做点什么 48 // 对响应错误做点什么
49 if (error.response.status === 401) { 49 if (error.response.status === 401) {
50 - console.log((1111)) 50 + console.log("Received 401 Response")
51 router.push('/login'); 51 router.push('/login');
52 } 52 }
53 return Promise.reject(error); 53 return Promise.reject(error);