Browse Source

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

修正个别错误,优化代码
648540858 4 years ago
parent
commit
1b7afe679e
31 changed files with 13 additions and 61 deletions
  1. 0 6
      src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java
  2. 0 1
      src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
  3. 0 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java
  4. 0 1
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java
  5. 0 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java
  6. 0 1
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
  7. 0 6
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
  8. 1 1
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java
  9. 0 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/InviteResponseProcessor.java
  10. 0 3
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java
  11. 1 1
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java
  12. 0 3
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java
  13. 0 2
      src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaItem.java
  14. 1 1
      src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java
  15. 0 2
      src/main/java/com/genersoft/iot/vmp/service/IMediaService.java
  16. 0 2
      src/main/java/com/genersoft/iot/vmp/service/IStreamPushService.java
  17. 0 2
      src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
  18. 0 1
      src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
  19. 0 3
      src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java
  20. 0 1
      src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
  21. 0 1
      src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java
  22. 0 2
      src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
  23. 1 1
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java
  24. 1 0
      src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
  25. 0 1
      src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
  26. 0 1
      src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
  27. 0 3
      src/main/java/com/genersoft/iot/vmp/web/ApiDeviceController.java
  28. 0 1
      src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java
  29. 3 3
      web_src/src/components/Login.vue
  30. 4 4
      web_src/src/components/ParentPlatformList.vue
  31. 1 1
      web_src/src/components/channelList.vue

+ 0 - 6
src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java

@@ -1,21 +1,15 @@
 package com.genersoft.iot.vmp.conf;
 
-import io.swagger.annotations.ApiOperation;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import springfox.documentation.builders.ApiInfoBuilder;
 import springfox.documentation.builders.PathSelectors;
 import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.builders.RequestParameterBuilder;
-import springfox.documentation.schema.ScalarType;
 import springfox.documentation.service.ApiInfo;
 import springfox.documentation.service.Contact;
 import springfox.documentation.spi.DocumentationType;
 import springfox.documentation.spring.web.plugins.Docket;
 
-import java.util.ArrayList;
-import java.util.List;
-
 @Configuration
 public class Swagger3Config {
 

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java

@@ -16,7 +16,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
-// import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.DependsOn;
 import org.springframework.stereotype.Component;
 

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java

@@ -12,8 +12,6 @@ import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.gb28181.transmit.response.impl.*;
 import com.genersoft.iot.vmp.service.IPlayService;
-// import org.slf4j.Logger;
-// import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Component;

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java

@@ -4,7 +4,6 @@ import com.genersoft.iot.vmp.conf.SipConfig;
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
 import gov.nist.javax.sip.message.MessageFactoryImpl;
 import org.springframework.beans.factory.annotation.Autowired;
-// import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 import org.springframework.util.DigestUtils;
 

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java

@@ -6,14 +6,12 @@ import java.util.ArrayList;
 import javax.sip.InvalidArgumentException;
 import javax.sip.PeerUnavailableException;
 import javax.sip.SipFactory;
-// import javax.sip.SipProvider;
 import javax.sip.address.Address;
 import javax.sip.address.SipURI;
 import javax.sip.header.*;
 import javax.sip.message.Request;
 
 import org.springframework.beans.factory.annotation.Autowired;
-// import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import com.genersoft.iot.vmp.conf.SipConfig;

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java

@@ -23,7 +23,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
-// import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.DependsOn;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Component;

+ 0 - 6
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java

@@ -1,21 +1,15 @@
 package com.genersoft.iot.vmp.gb28181.transmit.cmd.impl;
 
-//import com.genersoft.iot.vmp.conf.SipConfig;
-//import com.genersoft.iot.vmp.gb28181.bean.Device;
 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
-//import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
 import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderPlarformProvider;
-//import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderProvider;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
-//import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
-// import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.DependsOn;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.lang.Nullable;

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java

@@ -178,7 +178,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor {
 					// 通知下级推流,
 					PlayResult playResult = playService.play(device.getDeviceId(), channelId, (responseJSON)->{
 						// 收到推流, 回复200OK, 等待ack
-						if (sendRtpItem == null) return;
+						// if (sendRtpItem == null) return;
 						sendRtpItem.setStatus(1);
 						redisCatchStorage.updateSendRTPSever(sendRtpItem);
 						// TODO 添加对tcp的支持

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/InviteResponseProcessor.java

@@ -12,8 +12,6 @@ import javax.sip.header.ViaHeader;
 import javax.sip.message.Request;
 import javax.sip.message.Response;
 
-// import org.slf4j.Logger;
-// import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
 import com.genersoft.iot.vmp.conf.SipConfig;

+ 0 - 3
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java

@@ -2,9 +2,6 @@ package com.genersoft.iot.vmp.media.zlm;
 
 import com.genersoft.iot.vmp.conf.MediaServerConfig;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
-// import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
-// import org.slf4j.Logger;
-// import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java

@@ -97,7 +97,7 @@ public class ZLMHttpHookSubscribe {
      * @return
      */
     public List<ZLMHttpHookSubscribe.Event> getSubscribes(HookType type) {
-        ZLMHttpHookSubscribe.Event event= null;
+        // ZLMHttpHookSubscribe.Event event= null;
         Map<JSONObject, Event> eventMap = allSubscribes.get(type);
         if (eventMap == null) {
             return null;

+ 0 - 3
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java

@@ -1,12 +1,9 @@
 package com.genersoft.iot.vmp.media.zlm;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.TypeReference;
 import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
 import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
 import com.genersoft.iot.vmp.gb28181.bean.GbStream;
-import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
 import com.genersoft.iot.vmp.service.IStreamPushService;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaItem.java

@@ -1,7 +1,5 @@
 package com.genersoft.iot.vmp.media.zlm.dto;
 
-import com.alibaba.fastjson.JSONObject;
-
 import java.util.List;
 
 public class MediaItem {

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java

@@ -87,7 +87,7 @@ public class StreamPushItem extends GbStream implements Comparable<StreamPushIte
 
     @Override
     public int compareTo(@NotNull StreamPushItem streamPushItem) {
-        return new Long(this.createStamp - streamPushItem.getCreateStamp().intValue()).intValue();
+        return Long.valueOf(this.createStamp - streamPushItem.getCreateStamp().intValue()).intValue();
     }
 
     public static class MediaSchema {

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/service/IMediaService.java

@@ -1,8 +1,6 @@
 package com.genersoft.iot.vmp.service;
 
 import com.genersoft.iot.vmp.common.StreamInfo;
-import com.genersoft.iot.vmp.gb28181.bean.GbStream;
-import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
 
 /**
  * 媒体信息业务

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/service/IStreamPushService.java

@@ -1,8 +1,6 @@
 package com.genersoft.iot.vmp.service;
 
-import com.alibaba.fastjson.JSONObject;
 import com.genersoft.iot.vmp.gb28181.bean.GbStream;
-import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
 import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
 import com.github.pagehelper.PageInfo;
 

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java

@@ -3,12 +3,10 @@ package com.genersoft.iot.vmp.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.genersoft.iot.vmp.common.StreamInfo;
 import com.genersoft.iot.vmp.conf.MediaServerConfig;
-import com.genersoft.iot.vmp.gb28181.bean.GbStream;
 import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
 import com.genersoft.iot.vmp.service.IMediaService;
-import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java

@@ -6,7 +6,6 @@ import com.alibaba.fastjson.TypeReference;
 import com.genersoft.iot.vmp.gb28181.bean.GbStream;
 import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
 import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
-import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
 import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
 import com.genersoft.iot.vmp.service.IStreamPushService;
 import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;

+ 0 - 3
src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java

@@ -1,14 +1,11 @@
 package com.genersoft.iot.vmp.storager;
 
-import com.alibaba.fastjson.JSONObject;
-import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
 import com.genersoft.iot.vmp.common.StreamInfo;
 import com.genersoft.iot.vmp.conf.MediaServerConfig;
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
 import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
 
-import java.util.List;
 import java.util.Map;
 
 public interface IRedisCatchStorage {

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java

@@ -1,6 +1,5 @@
 package com.genersoft.iot.vmp.storager.dao;
 
-import com.genersoft.iot.vmp.gb28181.bean.GbStream;
 import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
 import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
 import org.apache.ibatis.annotations.*;

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java

@@ -1,6 +1,5 @@
 package com.genersoft.iot.vmp.storager.dao;
 
-import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
 import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
 import org.apache.ibatis.annotations.*;
 import org.springframework.stereotype.Repository;

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java

@@ -1,7 +1,5 @@
 package com.genersoft.iot.vmp.storager.impl;
 
-import com.alibaba.fastjson.JSONObject;
-import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
 import com.genersoft.iot.vmp.common.StreamInfo;
 import com.genersoft.iot.vmp.common.VideoManagerConstants;
 import com.genersoft.iot.vmp.conf.MediaServerConfig;

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java

@@ -55,7 +55,7 @@ public class DeviceConfig {
 	 * @param heartBeatCount 心跳计数
 	 * @return
 	 */
-	@ApiOperation("看守位控制命令")
+	@ApiOperation("基本配置设置命令")
 	@GetMapping("/basicParam/{deviceId}")
 	@ApiImplicitParams({
 			@ApiImplicitParam(name = "deviceId", value ="设备ID" ,dataTypeClass = String.class),

+ 1 - 0
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java

@@ -14,6 +14,7 @@ import javax.sip.ObjectInUseException;
 import javax.sip.SipProvider;
 import java.util.Iterator;
 
+@SuppressWarnings("rawtypes")
 @Api(tags = "服务控制")
 @CrossOrigin
 @RestController

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java

@@ -9,7 +9,6 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.models.auth.In;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java

@@ -1,6 +1,5 @@
 package com.genersoft.iot.vmp.vmanager.user;
 
-import com.genersoft.iot.vmp.gb28181.bean.GbStream;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;

+ 0 - 3
src/main/java/com/genersoft/iot/vmp/web/ApiDeviceController.java

@@ -4,9 +4,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.genersoft.iot.vmp.gb28181.bean.Device;
 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
-// import com.genersoft.iot.vmp.gb28181.event.DeviceOffLineDetector;
-// import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
-// import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
 import com.github.pagehelper.PageInfo;
 import org.slf4j.Logger;

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java

@@ -6,7 +6,6 @@ import com.genersoft.iot.vmp.common.StreamInfo;
 import com.genersoft.iot.vmp.gb28181.bean.Device;
 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
-// import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
 import com.genersoft.iot.vmp.vmanager.gb28181.play.PlayController;

+ 3 - 3
web_src/src/components/Login.vue

@@ -62,9 +62,9 @@ export default {
       this.isLoging = true;
 
       this.$axios({
-					method: 'get',
-					url:"/api/user/login",
-          params: loginParam
+      	method: 'get',
+	url:"/api/user/login",
+        params: loginParam
       }).then(function (res) {
         console.log(JSON.stringify(res));
           if (res.data == "success") {

+ 4 - 4
web_src/src/components/ParentPlatformList.vue

@@ -122,8 +122,8 @@ export default {
     deletePlatformCommit: function(platform) {
         var that = this;
         that.$axios({
-					method: 'delete',
-					url:`/api/platform/delete/${platform.serverGBId}`
+		method: 'delete',
+		url:`/api/platform/delete/${platform.serverGBId}`
         }).then(function (res) {
             if (res.data == "success") {
                 that.$message({
@@ -157,8 +157,8 @@ export default {
       let that = this;
 
       this.$axios({
-					method: 'get',
-					url:`/api/platform/query/${that.count}/${that.currentPage}`
+      	method: 'get',
+	url:`/api/platform/query/${that.count}/${that.currentPage}`
       }).then(function (res) {
         that.total = res.data.total;
         that.platformList = res.data.list;

+ 1 - 1
web_src/src/components/channelList.vue

@@ -224,7 +224,7 @@ export default {
               if (error.response.status == 402) { // 已经停止过
                 that.initData();
               }else {
-                console.log(e)
+                console.log(error)
               }
             });
         },