Commit a004a978fa54779425d7498b4737c970b8c71f7b
1 parent
89244932
规范api
Showing
37 changed files
with
467 additions
and
245 deletions
src/main/java/com/genersoft/iot/vmp/conf/Swagger3Config.java
| @@ -23,12 +23,70 @@ public class Swagger3Config { | @@ -23,12 +23,70 @@ public class Swagger3Config { | ||
| 23 | public Docket createRestApi() { | 23 | public Docket createRestApi() { |
| 24 | return new Docket(DocumentationType.OAS_30) | 24 | return new Docket(DocumentationType.OAS_30) |
| 25 | .apiInfo(apiInfo()) | 25 | .apiInfo(apiInfo()) |
| 26 | + .groupName("全部") | ||
| 26 | .select() | 27 | .select() |
| 27 | .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager")) | 28 | .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager")) |
| 28 | .paths(PathSelectors.any()) | 29 | .paths(PathSelectors.any()) |
| 29 | .build() | 30 | .build() |
| 30 | .pathMapping("/"); | 31 | .pathMapping("/"); |
| 31 | } | 32 | } |
| 33 | + @Bean | ||
| 34 | + public Docket createRestGBApi() { | ||
| 35 | + return new Docket(DocumentationType.OAS_30) | ||
| 36 | + .apiInfo(apiInfo()) | ||
| 37 | + .groupName("国标") | ||
| 38 | + .select() | ||
| 39 | + .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.gb28181")) | ||
| 40 | + .paths(PathSelectors.any()) | ||
| 41 | + .build() | ||
| 42 | + .pathMapping("/"); | ||
| 43 | + } | ||
| 44 | + @Bean | ||
| 45 | + public Docket createRestStreamProxyApi() { | ||
| 46 | + return new Docket(DocumentationType.OAS_30) | ||
| 47 | + .apiInfo(apiInfo()) | ||
| 48 | + .groupName("拉流转发") | ||
| 49 | + .select() | ||
| 50 | + .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.streamProxy")) | ||
| 51 | + .paths(PathSelectors.any()) | ||
| 52 | + .build() | ||
| 53 | + .pathMapping("/"); | ||
| 54 | + } | ||
| 55 | + @Bean | ||
| 56 | + public Docket createRestStreamPushApi() { | ||
| 57 | + return new Docket(DocumentationType.OAS_30) | ||
| 58 | + .apiInfo(apiInfo()) | ||
| 59 | + .groupName("推流管理") | ||
| 60 | + .select() | ||
| 61 | + .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.streamPush")) | ||
| 62 | + .paths(PathSelectors.any()) | ||
| 63 | + .build() | ||
| 64 | + .pathMapping("/"); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + | ||
| 68 | + @Bean | ||
| 69 | + public Docket createServerApi() { | ||
| 70 | + return new Docket(DocumentationType.OAS_30) | ||
| 71 | + .apiInfo(apiInfo()) | ||
| 72 | + .groupName("服务管理") | ||
| 73 | + .select() | ||
| 74 | + .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.server")) | ||
| 75 | + .paths(PathSelectors.any()) | ||
| 76 | + .build() | ||
| 77 | + .pathMapping("/"); | ||
| 78 | + } | ||
| 79 | + @Bean | ||
| 80 | + public Docket createUserApi() { | ||
| 81 | + return new Docket(DocumentationType.OAS_30) | ||
| 82 | + .apiInfo(apiInfo()) | ||
| 83 | + .groupName("用户管理") | ||
| 84 | + .select() | ||
| 85 | + .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager.user")) | ||
| 86 | + .paths(PathSelectors.any()) | ||
| 87 | + .build() | ||
| 88 | + .pathMapping("/"); | ||
| 89 | + } | ||
| 32 | 90 | ||
| 33 | private ApiInfo apiInfo() { | 91 | private ApiInfo apiInfo() { |
| 34 | return new ApiInfoBuilder() | 92 | return new ApiInfoBuilder() |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java
| @@ -19,7 +19,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.request.SIPRequestAbstractProcesso | @@ -19,7 +19,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.request.SIPRequestAbstractProcesso | ||
| 19 | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; | 19 | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; |
| 20 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 20 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 21 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 21 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 22 | -import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; | 22 | +import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult; |
| 23 | import com.genersoft.iot.vmp.service.IPlayService; | 23 | import com.genersoft.iot.vmp.service.IPlayService; |
| 24 | import gov.nist.javax.sip.address.AddressImpl; | 24 | import gov.nist.javax.sip.address.AddressImpl; |
| 25 | import gov.nist.javax.sip.address.SipUri; | 25 | import gov.nist.javax.sip.address.SipUri; |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
| @@ -40,7 +40,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | @@ -40,7 +40,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | ||
| 40 | import com.genersoft.iot.vmp.utils.GpsUtil; | 40 | import com.genersoft.iot.vmp.utils.GpsUtil; |
| 41 | import com.genersoft.iot.vmp.utils.SpringBeanFactory; | 41 | import com.genersoft.iot.vmp.utils.SpringBeanFactory; |
| 42 | import com.genersoft.iot.vmp.utils.redis.RedisUtil; | 42 | import com.genersoft.iot.vmp.utils.redis.RedisUtil; |
| 43 | -import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 43 | +import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| 44 | 44 | ||
| 45 | import gov.nist.javax.sip.SipStackImpl; | 45 | import gov.nist.javax.sip.SipStackImpl; |
| 46 | import gov.nist.javax.sip.address.AddressImpl; | 46 | import gov.nist.javax.sip.address.AddressImpl; |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
| @@ -245,13 +245,13 @@ public class ZLMHttpHookListener { | @@ -245,13 +245,13 @@ public class ZLMHttpHookListener { | ||
| 245 | String streamId = json.getString("stream"); | 245 | String streamId = json.getString("stream"); |
| 246 | String schema = json.getString("schema"); | 246 | String schema = json.getString("schema"); |
| 247 | JSONArray tracks = json.getJSONArray("tracks"); | 247 | JSONArray tracks = json.getJSONArray("tracks"); |
| 248 | - String regist = json.getString("regist"); | 248 | + boolean regist = json.getBoolean("regist"); |
| 249 | if (tracks != null) { | 249 | if (tracks != null) { |
| 250 | System.out.println("222222" + schema); | 250 | System.out.println("222222" + schema); |
| 251 | } | 251 | } |
| 252 | if ("rtmp".equals(schema)){ | 252 | if ("rtmp".equals(schema)){ |
| 253 | 253 | ||
| 254 | - if ("rtp".equals(app) && regist != null ) { | 254 | + if ("rtp".equals(app) && !regist ) { |
| 255 | StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); | 255 | StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); |
| 256 | if (streamInfo!=null){ | 256 | if (streamInfo!=null){ |
| 257 | redisCatchStorage.stopPlay(streamInfo); | 257 | redisCatchStorage.stopPlay(streamInfo); |
| @@ -262,7 +262,7 @@ public class ZLMHttpHookListener { | @@ -262,7 +262,7 @@ public class ZLMHttpHookListener { | ||
| 262 | } | 262 | } |
| 263 | }else { | 263 | }else { |
| 264 | if (!"rtp".equals(app) ){ | 264 | if (!"rtp".equals(app) ){ |
| 265 | - if (regist == null) { | 265 | + if (regist) { |
| 266 | zlmMediaListManager.addMedia(app, streamId); | 266 | zlmMediaListManager.addMedia(app, streamId); |
| 267 | }else { | 267 | }else { |
| 268 | zlmMediaListManager.removeMedia(app, streamId); | 268 | zlmMediaListManager.removeMedia(app, streamId); |
src/main/java/com/genersoft/iot/vmp/service/IPlayService.java
| @@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.service; | @@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.service; | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | 4 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 5 | import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | 5 | import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; |
| 6 | -import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; | 6 | +import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * 点播处理 | 9 | * 点播处理 |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| @@ -13,7 +13,7 @@ import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | @@ -13,7 +13,7 @@ import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | ||
| 13 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 13 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 14 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 14 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 15 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 15 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 16 | -import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; | 16 | +import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult; |
| 17 | import com.genersoft.iot.vmp.service.IMediaService; | 17 | import com.genersoft.iot.vmp.service.IMediaService; |
| 18 | import com.genersoft.iot.vmp.service.IPlayService; | 18 | import com.genersoft.iot.vmp.service.IPlayService; |
| 19 | import org.slf4j.Logger; | 19 | import org.slf4j.Logger; |
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java
| @@ -5,7 +5,7 @@ import java.util.List; | @@ -5,7 +5,7 @@ import java.util.List; | ||
| 5 | import com.genersoft.iot.vmp.gb28181.bean.*; | 5 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 6 | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | 6 | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; |
| 7 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; | 7 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| 8 | -import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 8 | +import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| 9 | import com.github.pagehelper.PageInfo; | 9 | import com.github.pagehelper.PageInfo; |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.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.gb28181.bean.DeviceChannel; | 3 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 4 | -import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 4 | +import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| 5 | import org.apache.ibatis.annotations.*; | 5 | import org.apache.ibatis.annotations.*; |
| 6 | import org.springframework.stereotype.Repository; | 6 | import org.springframework.stereotype.Repository; |
| 7 | 7 |
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
| @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.storager.dao; | @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.storager.dao; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 4 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 5 | -import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 5 | +import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| 6 | import org.apache.ibatis.annotations.Delete; | 6 | import org.apache.ibatis.annotations.Delete; |
| 7 | import org.apache.ibatis.annotations.Insert; | 7 | import org.apache.ibatis.annotations.Insert; |
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
| @@ -7,7 +7,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | @@ -7,7 +7,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | ||
| 7 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; | 7 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| 8 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 8 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 9 | import com.genersoft.iot.vmp.storager.dao.*; | 9 | import com.genersoft.iot.vmp.storager.dao.*; |
| 10 | -import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 10 | +import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| 11 | import com.github.pagehelper.PageHelper; | 11 | import com.github.pagehelper.PageHelper; |
| 12 | import com.github.pagehelper.PageInfo; | 12 | import com.github.pagehelper.PageInfo; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
src/main/java/com/genersoft/iot/vmp/vmanager/MobilePosition/MobilePositionController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.MobilePosition; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.MobilePosition; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | 4 | ||
| @@ -58,9 +58,9 @@ public class MobilePositionController { | @@ -58,9 +58,9 @@ public class MobilePositionController { | ||
| 58 | */ | 58 | */ |
| 59 | @ApiOperation("查询历史轨迹") | 59 | @ApiOperation("查询历史轨迹") |
| 60 | @ApiImplicitParams({ | 60 | @ApiImplicitParams({ |
| 61 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 62 | - @ApiImplicitParam(name = "start", value = "开始时间", required = true), | ||
| 63 | - @ApiImplicitParam(name = "end", value = "结束时间", required = true), | 61 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 62 | + @ApiImplicitParam(name = "start", value = "开始时间", required = true, dataTypeClass = String.class), | ||
| 63 | + @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataTypeClass = String.class), | ||
| 64 | }) | 64 | }) |
| 65 | @GetMapping("/history/{deviceId}") | 65 | @GetMapping("/history/{deviceId}") |
| 66 | public ResponseEntity<List<MobilePosition>> positions(@PathVariable String deviceId, | 66 | public ResponseEntity<List<MobilePosition>> positions(@PathVariable String deviceId, |
| @@ -88,7 +88,7 @@ public class MobilePositionController { | @@ -88,7 +88,7 @@ public class MobilePositionController { | ||
| 88 | */ | 88 | */ |
| 89 | @ApiOperation("查询设备最新位置") | 89 | @ApiOperation("查询设备最新位置") |
| 90 | @ApiImplicitParams({ | 90 | @ApiImplicitParams({ |
| 91 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | 91 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 92 | }) | 92 | }) |
| 93 | @GetMapping("/latest/{deviceId}") | 93 | @GetMapping("/latest/{deviceId}") |
| 94 | public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) { | 94 | public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) { |
| @@ -106,7 +106,7 @@ public class MobilePositionController { | @@ -106,7 +106,7 @@ public class MobilePositionController { | ||
| 106 | */ | 106 | */ |
| 107 | @ApiOperation("获取移动位置信息") | 107 | @ApiOperation("获取移动位置信息") |
| 108 | @ApiImplicitParams({ | 108 | @ApiImplicitParams({ |
| 109 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | 109 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 110 | }) | 110 | }) |
| 111 | @GetMapping("/realtime/{deviceId}") | 111 | @GetMapping("/realtime/{deviceId}") |
| 112 | public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) { | 112 | public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) { |
| @@ -140,9 +140,9 @@ public class MobilePositionController { | @@ -140,9 +140,9 @@ public class MobilePositionController { | ||
| 140 | */ | 140 | */ |
| 141 | @ApiOperation("订阅位置信息") | 141 | @ApiOperation("订阅位置信息") |
| 142 | @ApiImplicitParams({ | 142 | @ApiImplicitParams({ |
| 143 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 144 | - @ApiImplicitParam(name = "expires", value = "订阅超时时间"), | ||
| 145 | - @ApiImplicitParam(name = "interval", value = "上报时间间隔"), | 143 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 144 | + @ApiImplicitParam(name = "expires", value = "订阅超时时间", dataTypeClass = String.class), | ||
| 145 | + @ApiImplicitParam(name = "interval", value = "上报时间间隔", dataTypeClass = String.class), | ||
| 146 | }) | 146 | }) |
| 147 | @GetMapping("/subscribe/{deviceId}") | 147 | @GetMapping("/subscribe/{deviceId}") |
| 148 | public ResponseEntity<String> positionSubscribe(@PathVariable String deviceId, | 148 | public ResponseEntity<String> positionSubscribe(@PathVariable String deviceId, |
src/main/java/com/genersoft/iot/vmp/vmanager/SseController/SseController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.SseController; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.SseController; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEventListener; | 3 | import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEventListener; |
| 4 | +import io.swagger.annotations.Api; | ||
| 5 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 6 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 7 | +import io.swagger.annotations.ApiOperation; | ||
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Controller; | 9 | import org.springframework.stereotype.Controller; |
| 6 | import org.springframework.web.bind.annotation.CrossOrigin; | 10 | import org.springframework.web.bind.annotation.CrossOrigin; |
| @@ -13,15 +17,18 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; | @@ -13,15 +17,18 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; | ||
| 13 | * @author: lawrencehj | 17 | * @author: lawrencehj |
| 14 | * @data: 2021-01-20 | 18 | * @data: 2021-01-20 |
| 15 | */ | 19 | */ |
| 16 | - | 20 | +@Api(tags = "SSE推送") |
| 17 | @CrossOrigin | 21 | @CrossOrigin |
| 18 | @Controller | 22 | @Controller |
| 19 | @RequestMapping("/api") | 23 | @RequestMapping("/api") |
| 20 | public class SseController { | 24 | public class SseController { |
| 21 | - @Autowired | 25 | + @Autowired |
| 22 | AlarmEventListener alarmEventListener; | 26 | AlarmEventListener alarmEventListener; |
| 23 | - | ||
| 24 | - //设置响应 | 27 | + |
| 28 | + @ApiOperation("设置响应") | ||
| 29 | + @ApiImplicitParams({ | ||
| 30 | + @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), | ||
| 31 | + }) | ||
| 25 | @RequestMapping("/emit") | 32 | @RequestMapping("/emit") |
| 26 | public SseEmitter emit(@RequestParam String browserId) { | 33 | public SseEmitter emit(@RequestParam String browserId) { |
| 27 | final SseEmitter sseEmitter = new SseEmitter(0L); | 34 | final SseEmitter sseEmitter = new SseEmitter(0L); |
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceConfig.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceConfig.java
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | * @date 2021年2月2日 | 5 | * @date 2021年2月2日 |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | -package com.genersoft.iot.vmp.vmanager.device; | 8 | +package com.genersoft.iot.vmp.vmanager.gb28181.device; |
| 9 | 9 | ||
| 10 | import javax.sip.message.Response; | 10 | import javax.sip.message.Response; |
| 11 | 11 | ||
| @@ -24,7 +24,6 @@ import io.swagger.annotations.ApiOperation; | @@ -24,7 +24,6 @@ import io.swagger.annotations.ApiOperation; | ||
| 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.http.HttpRequest; | ||
| 28 | import org.springframework.http.ResponseEntity; | 27 | import org.springframework.http.ResponseEntity; |
| 29 | import org.springframework.web.bind.annotation.*; | 28 | import org.springframework.web.bind.annotation.*; |
| 30 | import org.springframework.web.context.request.async.DeferredResult; | 29 | import org.springframework.web.context.request.async.DeferredResult; |
| @@ -59,12 +58,12 @@ public class DeviceConfig { | @@ -59,12 +58,12 @@ public class DeviceConfig { | ||
| 59 | @ApiOperation("看守位控制命令") | 58 | @ApiOperation("看守位控制命令") |
| 60 | @GetMapping("/basicParam/{deviceId}") | 59 | @GetMapping("/basicParam/{deviceId}") |
| 61 | @ApiImplicitParams({ | 60 | @ApiImplicitParams({ |
| 62 | - @ApiImplicitParam(name = "deviceId", value ="设备ID" ), | ||
| 63 | - @ApiImplicitParam(name = "channelId", value ="通道ID" ), | ||
| 64 | - @ApiImplicitParam(name = "name", value ="名称" ), | ||
| 65 | - @ApiImplicitParam(name = "expiration", value ="到期时间" ), | ||
| 66 | - @ApiImplicitParam(name = "heartBeatInterval", value ="心跳间隔" ), | ||
| 67 | - @ApiImplicitParam(name = "heartBeatCount", value ="心跳计数" ), | 61 | + @ApiImplicitParam(name = "deviceId", value ="设备ID" ,dataTypeClass = String.class), |
| 62 | + @ApiImplicitParam(name = "channelId", value ="通道ID",dataTypeClass = String.class ), | ||
| 63 | + @ApiImplicitParam(name = "name", value ="名称" ,dataTypeClass = String.class), | ||
| 64 | + @ApiImplicitParam(name = "expiration", value ="到期时间" ,dataTypeClass = String.class), | ||
| 65 | + @ApiImplicitParam(name = "heartBeatInterval", value ="心跳间隔" ,dataTypeClass = String.class), | ||
| 66 | + @ApiImplicitParam(name = "heartBeatCount", value ="心跳计数" ,dataTypeClass = String.class), | ||
| 68 | }) | 67 | }) |
| 69 | public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId, | 68 | public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId, |
| 70 | @RequestParam(required = false) String channelId, | 69 | @RequestParam(required = false) String channelId, |
| @@ -109,9 +108,9 @@ public class DeviceConfig { | @@ -109,9 +108,9 @@ public class DeviceConfig { | ||
| 109 | */ | 108 | */ |
| 110 | @ApiOperation("设备配置查询请求") | 109 | @ApiOperation("设备配置查询请求") |
| 111 | @ApiImplicitParams({ | 110 | @ApiImplicitParams({ |
| 112 | - @ApiImplicitParam(name = "deviceId", value ="设备ID" ), | ||
| 113 | - @ApiImplicitParam(name = "channelId", value ="通道ID" ), | ||
| 114 | - @ApiImplicitParam(name = "configType", value ="配置类型" ), | 111 | + @ApiImplicitParam(name = "deviceId", value ="设备ID" ,dataTypeClass = String.class), |
| 112 | + @ApiImplicitParam(name = "channelId", value ="通道ID" ,dataTypeClass = String.class), | ||
| 113 | + @ApiImplicitParam(name = "configType", value ="配置类型" ,dataTypeClass = String.class), | ||
| 115 | }) | 114 | }) |
| 116 | @GetMapping("/query/{deviceId}/{configType}") | 115 | @GetMapping("/query/{deviceId}/{configType}") |
| 117 | public DeferredResult<ResponseEntity<String>> configDownloadApi(@PathVariable String deviceId, | 116 | public DeferredResult<ResponseEntity<String>> configDownloadApi(@PathVariable String deviceId, |
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceControl.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | * @date 2021年2月1日 | 5 | * @date 2021年2月1日 |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | -package com.genersoft.iot.vmp.vmanager.device; | 8 | +package com.genersoft.iot.vmp.vmanager.gb28181.device; |
| 9 | 9 | ||
| 10 | import javax.sip.message.Response; | 10 | import javax.sip.message.Response; |
| 11 | 11 | ||
| @@ -53,7 +53,7 @@ public class DeviceControl { | @@ -53,7 +53,7 @@ public class DeviceControl { | ||
| 53 | */ | 53 | */ |
| 54 | @ApiOperation("远程启动控制命令") | 54 | @ApiOperation("远程启动控制命令") |
| 55 | @ApiImplicitParams({ | 55 | @ApiImplicitParams({ |
| 56 | - @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true), | 56 | + @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class), |
| 57 | }) | 57 | }) |
| 58 | @GetMapping("/teleboot/{deviceId}") | 58 | @GetMapping("/teleboot/{deviceId}") |
| 59 | public ResponseEntity<String> teleBootApi(@PathVariable String deviceId) { | 59 | public ResponseEntity<String> teleBootApi(@PathVariable String deviceId) { |
| @@ -82,10 +82,10 @@ public class DeviceControl { | @@ -82,10 +82,10 @@ public class DeviceControl { | ||
| 82 | */ | 82 | */ |
| 83 | @ApiOperation("录像控制命令") | 83 | @ApiOperation("录像控制命令") |
| 84 | @ApiImplicitParams({ | 84 | @ApiImplicitParams({ |
| 85 | - @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true), | ||
| 86 | - @ApiImplicitParam(name = "channelId", value ="通道编码"), | 85 | + @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class), |
| 86 | + @ApiImplicitParam(name = "channelId", value ="通道编码" ,dataTypeClass = String.class), | ||
| 87 | @ApiImplicitParam(name = "recordCmdStr", value ="命令, 可选值:Record(手动录像),StopRecord(停止手动录像)", | 87 | @ApiImplicitParam(name = "recordCmdStr", value ="命令, 可选值:Record(手动录像),StopRecord(停止手动录像)", |
| 88 | - required = true), | 88 | + required = true ,dataTypeClass = String.class), |
| 89 | }) | 89 | }) |
| 90 | @GetMapping("/record/{deviceId}/{recordCmdStr}") | 90 | @GetMapping("/record/{deviceId}/{recordCmdStr}") |
| 91 | public DeferredResult<ResponseEntity<String>> recordApi(@PathVariable String deviceId, | 91 | public DeferredResult<ResponseEntity<String>> recordApi(@PathVariable String deviceId, |
| @@ -122,8 +122,9 @@ public class DeviceControl { | @@ -122,8 +122,9 @@ public class DeviceControl { | ||
| 122 | */ | 122 | */ |
| 123 | @ApiOperation("录像控制命令") | 123 | @ApiOperation("录像控制命令") |
| 124 | @ApiImplicitParams({ | 124 | @ApiImplicitParams({ |
| 125 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 126 | - @ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true) | 125 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 126 | + @ApiImplicitParam(name = "guardCmdStr", value ="命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true, | ||
| 127 | + dataTypeClass = String.class) | ||
| 127 | }) | 128 | }) |
| 128 | @GetMapping("/guard/{deviceId}/{guardCmdStr}") | 129 | @GetMapping("/guard/{deviceId}/{guardCmdStr}") |
| 129 | public DeferredResult<ResponseEntity<String>> guardApi(@PathVariable String deviceId, @PathVariable String guardCmdStr) { | 130 | public DeferredResult<ResponseEntity<String>> guardApi(@PathVariable String deviceId, @PathVariable String guardCmdStr) { |
| @@ -160,9 +161,9 @@ public class DeviceControl { | @@ -160,9 +161,9 @@ public class DeviceControl { | ||
| 160 | */ | 161 | */ |
| 161 | @ApiOperation("报警复位") | 162 | @ApiOperation("报警复位") |
| 162 | @ApiImplicitParams({ | 163 | @ApiImplicitParams({ |
| 163 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 164 | - @ApiImplicitParam(name = "alarmMethod", value ="报警方式"), | ||
| 165 | - @ApiImplicitParam(name = "alarmType", value ="报警类型"), | 164 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 165 | + @ApiImplicitParam(name = "alarmMethod", value ="报警方式", dataTypeClass = String.class), | ||
| 166 | + @ApiImplicitParam(name = "alarmType", value ="报警类型", dataTypeClass = String.class), | ||
| 166 | }) | 167 | }) |
| 167 | @GetMapping("/reset_alarm/{deviceId}") | 168 | @GetMapping("/reset_alarm/{deviceId}") |
| 168 | public DeferredResult<ResponseEntity<String>> resetAlarmApi(@PathVariable String deviceId, | 169 | public DeferredResult<ResponseEntity<String>> resetAlarmApi(@PathVariable String deviceId, |
| @@ -200,8 +201,8 @@ public class DeviceControl { | @@ -200,8 +201,8 @@ public class DeviceControl { | ||
| 200 | */ | 201 | */ |
| 201 | @ApiOperation("强制关键帧") | 202 | @ApiOperation("强制关键帧") |
| 202 | @ApiImplicitParams({ | 203 | @ApiImplicitParams({ |
| 203 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 204 | - @ApiImplicitParam(name = "channelId", value ="通道ID", required = true), | 204 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 205 | + @ApiImplicitParam(name = "channelId", value ="通道ID", required = true, dataTypeClass = String.class), | ||
| 205 | }) | 206 | }) |
| 206 | @GetMapping("/i_frame/{deviceId}") | 207 | @GetMapping("/i_frame/{deviceId}") |
| 207 | public ResponseEntity<String> iFrame(@PathVariable String deviceId, | 208 | public ResponseEntity<String> iFrame(@PathVariable String deviceId, |
| @@ -234,11 +235,11 @@ public class DeviceControl { | @@ -234,11 +235,11 @@ public class DeviceControl { | ||
| 234 | */ | 235 | */ |
| 235 | @ApiOperation("看守位控制") | 236 | @ApiOperation("看守位控制") |
| 236 | @ApiImplicitParams({ | 237 | @ApiImplicitParams({ |
| 237 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 238 | - @ApiImplicitParam(name = "enabled", value = "是否开启看守位 1:开启,0:关闭", required = true), | ||
| 239 | - @ApiImplicitParam(name = "resetTime", value = "自动归位时间间隔"), | ||
| 240 | - @ApiImplicitParam(name = "presetIndex", value = "调用预置位编号"), | ||
| 241 | - @ApiImplicitParam(name = "channelId", value ="通道ID"), | 238 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 239 | + @ApiImplicitParam(name = "enabled", value = "是否开启看守位 1:开启,0:关闭", required = true, dataTypeClass = String.class), | ||
| 240 | + @ApiImplicitParam(name = "resetTime", value = "自动归位时间间隔", dataTypeClass = String.class), | ||
| 241 | + @ApiImplicitParam(name = "presetIndex", value = "调用预置位编号", dataTypeClass = String.class), | ||
| 242 | + @ApiImplicitParam(name = "channelId", value ="通道ID", dataTypeClass = String.class), | ||
| 242 | }) | 243 | }) |
| 243 | @GetMapping("/home_position/{deviceId}/{enabled}") | 244 | @GetMapping("/home_position/{deviceId}/{enabled}") |
| 244 | public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId, | 245 | public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId, |
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceQuery.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
| 1 | -package com.genersoft.iot.vmp.vmanager.device; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.device; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 3 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 4 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 4 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| @@ -22,7 +22,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | @@ -22,7 +22,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | ||
| 22 | 22 | ||
| 23 | import javax.sip.message.Response; | 23 | import javax.sip.message.Response; |
| 24 | 24 | ||
| 25 | -@Api(tags = "国标设备查询1", value = "国标设备查询") | 25 | +@Api(tags = "国标设备查询", value = "国标设备查询") |
| 26 | @SuppressWarnings("rawtypes") | 26 | @SuppressWarnings("rawtypes") |
| 27 | @CrossOrigin | 27 | @CrossOrigin |
| 28 | @RestController | 28 | @RestController |
| @@ -50,7 +50,7 @@ public class DeviceQuery { | @@ -50,7 +50,7 @@ public class DeviceQuery { | ||
| 50 | */ | 50 | */ |
| 51 | @ApiOperation("使用ID查询国标设备") | 51 | @ApiOperation("使用ID查询国标设备") |
| 52 | @ApiImplicitParams({ | 52 | @ApiImplicitParams({ |
| 53 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | 53 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), |
| 54 | }) | 54 | }) |
| 55 | @GetMapping("/devices/{deviceId}") | 55 | @GetMapping("/devices/{deviceId}") |
| 56 | public ResponseEntity<Device> devices(@PathVariable String deviceId){ | 56 | public ResponseEntity<Device> devices(@PathVariable String deviceId){ |
| @@ -71,8 +71,8 @@ public class DeviceQuery { | @@ -71,8 +71,8 @@ public class DeviceQuery { | ||
| 71 | */ | 71 | */ |
| 72 | @ApiOperation("分页查询国标设备") | 72 | @ApiOperation("分页查询国标设备") |
| 73 | @ApiImplicitParams({ | 73 | @ApiImplicitParams({ |
| 74 | - @ApiImplicitParam(name = "page", value = "当前页", required = true), | ||
| 75 | - @ApiImplicitParam(name = "count", value = "每页查询数量", required = true), | 74 | + @ApiImplicitParam(name = "page", value = "当前页", required = true, dataTypeClass = Integer.class), |
| 75 | + @ApiImplicitParam(name = "count", value = "每页查询数量", required = true, dataTypeClass = Integer.class), | ||
| 76 | }) | 76 | }) |
| 77 | @GetMapping("/devices") | 77 | @GetMapping("/devices") |
| 78 | public PageInfo<Device> devices(int page, int count){ | 78 | public PageInfo<Device> devices(int page, int count){ |
| @@ -98,12 +98,12 @@ public class DeviceQuery { | @@ -98,12 +98,12 @@ public class DeviceQuery { | ||
| 98 | @ApiOperation("分页查询通道") | 98 | @ApiOperation("分页查询通道") |
| 99 | @GetMapping("/devices/{deviceId}/channels") | 99 | @GetMapping("/devices/{deviceId}/channels") |
| 100 | @ApiImplicitParams({ | 100 | @ApiImplicitParams({ |
| 101 | - @ApiImplicitParam(name="deviceId", value = "设备id", required = true), | ||
| 102 | - @ApiImplicitParam(name="page", value = "当前页", required = true), | ||
| 103 | - @ApiImplicitParam(name="count", value = "每页查询数量", required = true), | ||
| 104 | - @ApiImplicitParam(name="query", value = "查询内容"), | ||
| 105 | - @ApiImplicitParam(name="online", value = "是否在线"), | ||
| 106 | - @ApiImplicitParam(name="channelType", value = "设备/子目录-> false/true"), | 101 | + @ApiImplicitParam(name="deviceId", value = "设备id", required = true ,dataTypeClass = String.class), |
| 102 | + @ApiImplicitParam(name="page", value = "当前页", required = true ,dataTypeClass = Integer.class), | ||
| 103 | + @ApiImplicitParam(name="count", value = "每页查询数量", required = true ,dataTypeClass = Integer.class), | ||
| 104 | + @ApiImplicitParam(name="query", value = "查询内容" ,dataTypeClass = String.class), | ||
| 105 | + @ApiImplicitParam(name="online", value = "是否在线" ,dataTypeClass = Boolean.class), | ||
| 106 | + @ApiImplicitParam(name="channelType", value = "设备/子目录-> false/true" ,dataTypeClass = Boolean.class), | ||
| 107 | }) | 107 | }) |
| 108 | public ResponseEntity<PageInfo> channels(@PathVariable String deviceId, | 108 | public ResponseEntity<PageInfo> channels(@PathVariable String deviceId, |
| 109 | int page, int count, | 109 | int page, int count, |
| @@ -128,7 +128,7 @@ public class DeviceQuery { | @@ -128,7 +128,7 @@ public class DeviceQuery { | ||
| 128 | */ | 128 | */ |
| 129 | @ApiOperation("同步设备通道") | 129 | @ApiOperation("同步设备通道") |
| 130 | @ApiImplicitParams({ | 130 | @ApiImplicitParams({ |
| 131 | - @ApiImplicitParam(name="deviceId", value = "设备id", required = true), | 131 | + @ApiImplicitParam(name="deviceId", value = "设备id", required = true ,dataTypeClass = String.class), |
| 132 | }) | 132 | }) |
| 133 | @PostMapping("/devices/{deviceId}/sync") | 133 | @PostMapping("/devices/{deviceId}/sync") |
| 134 | public DeferredResult<ResponseEntity<Device>> devicesSync(@PathVariable String deviceId){ | 134 | public DeferredResult<ResponseEntity<Device>> devicesSync(@PathVariable String deviceId){ |
| @@ -165,7 +165,7 @@ public class DeviceQuery { | @@ -165,7 +165,7 @@ public class DeviceQuery { | ||
| 165 | */ | 165 | */ |
| 166 | @ApiOperation("移除设备") | 166 | @ApiOperation("移除设备") |
| 167 | @ApiImplicitParams({ | 167 | @ApiImplicitParams({ |
| 168 | - @ApiImplicitParam(name="deviceId", value = "设备id", required = true), | 168 | + @ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class), |
| 169 | }) | 169 | }) |
| 170 | @DeleteMapping("/devices/{deviceId}/delete") | 170 | @DeleteMapping("/devices/{deviceId}/delete") |
| 171 | public ResponseEntity<String> delete(@PathVariable String deviceId){ | 171 | public ResponseEntity<String> delete(@PathVariable String deviceId){ |
| @@ -201,13 +201,13 @@ public class DeviceQuery { | @@ -201,13 +201,13 @@ public class DeviceQuery { | ||
| 201 | */ | 201 | */ |
| 202 | @ApiOperation("分页查询子目录通道") | 202 | @ApiOperation("分页查询子目录通道") |
| 203 | @ApiImplicitParams({ | 203 | @ApiImplicitParams({ |
| 204 | - @ApiImplicitParam(name="deviceId", value = "设备id", required = true), | ||
| 205 | - @ApiImplicitParam(name="channelId", value = "通道id", required = true), | ||
| 206 | - @ApiImplicitParam(name="page", value = "当前页", required = true), | ||
| 207 | - @ApiImplicitParam(name="count", value = "每页条数", required = true), | ||
| 208 | - @ApiImplicitParam(name="query", value = "查询内容"), | ||
| 209 | - @ApiImplicitParam(name="online", value = "是否在线"), | ||
| 210 | - @ApiImplicitParam(name="channelType", value = "通道类型, 子目录"), | 204 | + @ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class), |
| 205 | + @ApiImplicitParam(name="channelId", value = "通道id", required = true, dataTypeClass = String.class), | ||
| 206 | + @ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class), | ||
| 207 | + @ApiImplicitParam(name="count", value = "每页条数", required = true, dataTypeClass = Integer.class), | ||
| 208 | + @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), | ||
| 209 | + @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = String.class), | ||
| 210 | + @ApiImplicitParam(name="channelType", value = "通道类型, 子目录", dataTypeClass = Boolean.class), | ||
| 211 | }) | 211 | }) |
| 212 | @GetMapping("/sub_channels/{deviceId}/{channelId}/channels") | 212 | @GetMapping("/sub_channels/{deviceId}/{channelId}/channels") |
| 213 | public ResponseEntity<PageInfo> subChannels(@PathVariable String deviceId, | 213 | public ResponseEntity<PageInfo> subChannels(@PathVariable String deviceId, |
| @@ -239,8 +239,8 @@ public class DeviceQuery { | @@ -239,8 +239,8 @@ public class DeviceQuery { | ||
| 239 | */ | 239 | */ |
| 240 | @ApiOperation("更新通道信息") | 240 | @ApiOperation("更新通道信息") |
| 241 | @ApiImplicitParams({ | 241 | @ApiImplicitParams({ |
| 242 | - @ApiImplicitParam(name="deviceId", value = "设备id", required = true), | ||
| 243 | - @ApiImplicitParam(name="channel", value = "通道", required = true), | 242 | + @ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class), |
| 243 | + @ApiImplicitParam(name="channel", value = "通道", required = true, dataTypeClass = String.class), | ||
| 244 | }) | 244 | }) |
| 245 | @PostMapping("/channel/update/{deviceId}") | 245 | @PostMapping("/channel/update/{deviceId}") |
| 246 | public ResponseEntity<PageInfo> updateChannel(@PathVariable String deviceId,DeviceChannel channel){ | 246 | public ResponseEntity<PageInfo> updateChannel(@PathVariable String deviceId,DeviceChannel channel){ |
| @@ -256,7 +256,7 @@ public class DeviceQuery { | @@ -256,7 +256,7 @@ public class DeviceQuery { | ||
| 256 | */ | 256 | */ |
| 257 | @ApiOperation("修改数据流传输模式") | 257 | @ApiOperation("修改数据流传输模式") |
| 258 | @ApiImplicitParams({ | 258 | @ApiImplicitParams({ |
| 259 | - @ApiImplicitParam(name = "deviceId", value = "设备id", required = true), | 259 | + @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class), |
| 260 | @ApiImplicitParam(name = "streamMode", value = "数据流传输模式, 取值:" + | 260 | @ApiImplicitParam(name = "streamMode", value = "数据流传输模式, 取值:" + |
| 261 | "UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)"), | 261 | "UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)"), |
| 262 | }) | 262 | }) |
| @@ -275,7 +275,7 @@ public class DeviceQuery { | @@ -275,7 +275,7 @@ public class DeviceQuery { | ||
| 275 | */ | 275 | */ |
| 276 | @ApiOperation("设备状态查询") | 276 | @ApiOperation("设备状态查询") |
| 277 | @ApiImplicitParams({ | 277 | @ApiImplicitParams({ |
| 278 | - @ApiImplicitParam(name = "deviceId", value = "设备id", required = true), | 278 | + @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class), |
| 279 | }) | 279 | }) |
| 280 | @GetMapping("/devices/{deviceId}/status") | 280 | @GetMapping("/devices/{deviceId}/status") |
| 281 | public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) { | 281 | public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) { |
| @@ -316,13 +316,13 @@ public class DeviceQuery { | @@ -316,13 +316,13 @@ public class DeviceQuery { | ||
| 316 | */ | 316 | */ |
| 317 | @ApiOperation("设备报警查询") | 317 | @ApiOperation("设备报警查询") |
| 318 | @ApiImplicitParams({ | 318 | @ApiImplicitParams({ |
| 319 | - @ApiImplicitParam(name = "deviceId", value = "设备id", required = true), | ||
| 320 | - @ApiImplicitParam(name = "startPriority", value = "报警起始级别"), | ||
| 321 | - @ApiImplicitParam(name = "endPriority", value = "报警终止级别"), | ||
| 322 | - @ApiImplicitParam(name = "alarmMethod", value = "报警方式条件"), | ||
| 323 | - @ApiImplicitParam(name = "alarmType", value = "报警类型"), | ||
| 324 | - @ApiImplicitParam(name = "startTime", value = "报警发生起始时间"), | ||
| 325 | - @ApiImplicitParam(name = "endTime", value = "报警发生终止时间"), | 319 | + @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class), |
| 320 | + @ApiImplicitParam(name = "startPriority", value = "报警起始级别", dataTypeClass = String.class), | ||
| 321 | + @ApiImplicitParam(name = "endPriority", value = "报警终止级别", dataTypeClass = String.class), | ||
| 322 | + @ApiImplicitParam(name = "alarmMethod", value = "报警方式条件", dataTypeClass = String.class), | ||
| 323 | + @ApiImplicitParam(name = "alarmType", value = "报警类型", dataTypeClass = String.class), | ||
| 324 | + @ApiImplicitParam(name = "startTime", value = "报警发生起始时间", dataTypeClass = String.class), | ||
| 325 | + @ApiImplicitParam(name = "endTime", value = "报警发生终止时间", dataTypeClass = String.class), | ||
| 326 | }) | 326 | }) |
| 327 | @GetMapping("/alarm/{deviceId}") | 327 | @GetMapping("/alarm/{deviceId}") |
| 328 | public DeferredResult<ResponseEntity<String>> alarmApi(@PathVariable String deviceId, | 328 | public DeferredResult<ResponseEntity<String>> alarmApi(@PathVariable String deviceId, |
src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/GbStreamController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.gbStream; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.gbStream; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; | 3 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 4 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 4 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 5 | -import com.genersoft.iot.vmp.vmanager.gbStream.bean.GbStreamParam; | 5 | +import com.genersoft.iot.vmp.vmanager.gb28181.gbStream.bean.GbStreamParam; |
| 6 | import com.genersoft.iot.vmp.service.IGbStreamService; | 6 | import com.genersoft.iot.vmp.service.IGbStreamService; |
| 7 | import com.github.pagehelper.PageInfo; | 7 | import com.github.pagehelper.PageInfo; |
| 8 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| @@ -37,8 +37,8 @@ public class GbStreamController { | @@ -37,8 +37,8 @@ public class GbStreamController { | ||
| 37 | */ | 37 | */ |
| 38 | @ApiOperation("查询国标通道") | 38 | @ApiOperation("查询国标通道") |
| 39 | @ApiImplicitParams({ | 39 | @ApiImplicitParams({ |
| 40 | - @ApiImplicitParam(name = "page", value = "当前页", required = true ), | ||
| 41 | - @ApiImplicitParam(name = "count", value = "每页条数", required = true ), | 40 | + @ApiImplicitParam(name = "page", value = "当前页", required = true , dataTypeClass = Integer.class), |
| 41 | + @ApiImplicitParam(name = "count", value = "每页条数", required = true , dataTypeClass = Integer.class), | ||
| 42 | }) | 42 | }) |
| 43 | @GetMapping(value = "/list") | 43 | @GetMapping(value = "/list") |
| 44 | @ResponseBody | 44 | @ResponseBody |
| @@ -56,7 +56,8 @@ public class GbStreamController { | @@ -56,7 +56,8 @@ public class GbStreamController { | ||
| 56 | */ | 56 | */ |
| 57 | @ApiOperation("移除国标关联") | 57 | @ApiOperation("移除国标关联") |
| 58 | @ApiImplicitParams({ | 58 | @ApiImplicitParams({ |
| 59 | - @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ), | 59 | + @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true , |
| 60 | + dataTypeClass = GbStreamParam.class), | ||
| 60 | }) | 61 | }) |
| 61 | @DeleteMapping(value = "/del") | 62 | @DeleteMapping(value = "/del") |
| 62 | @ResponseBody | 63 | @ResponseBody |
| @@ -76,7 +77,7 @@ public class GbStreamController { | @@ -76,7 +77,7 @@ public class GbStreamController { | ||
| 76 | */ | 77 | */ |
| 77 | @ApiOperation("保存国标关联") | 78 | @ApiOperation("保存国标关联") |
| 78 | @ApiImplicitParams({ | 79 | @ApiImplicitParams({ |
| 79 | - @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ), | 80 | + @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true , dataTypeClass = GbStreamParam.class), |
| 80 | }) | 81 | }) |
| 81 | @PostMapping(value = "/add") | 82 | @PostMapping(value = "/add") |
| 82 | @ResponseBody | 83 | @ResponseBody |
src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/bean/GbStreamParam.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/bean/GbStreamParam.java
src/main/java/com/genersoft/iot/vmp/vmanager/media/MediaController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.media; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.media; |
| 2 | 2 | ||
| 3 | -import com.alibaba.fastjson.JSONObject; | ||
| 4 | import com.genersoft.iot.vmp.common.StreamInfo; | 3 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 5 | -import com.genersoft.iot.vmp.gb28181.bean.GbStream; | ||
| 6 | -import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream; | ||
| 7 | import com.genersoft.iot.vmp.service.IStreamPushService; | 4 | import com.genersoft.iot.vmp.service.IStreamPushService; |
| 8 | -import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | ||
| 9 | import com.genersoft.iot.vmp.service.IMediaService; | 5 | import com.genersoft.iot.vmp.service.IMediaService; |
| 10 | -import com.genersoft.iot.vmp.service.IStreamProxyService; | ||
| 11 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 6 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 12 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 13 | import io.swagger.annotations.ApiImplicitParam; | 8 | import io.swagger.annotations.ApiImplicitParam; |
| @@ -46,8 +41,8 @@ public class MediaController { | @@ -46,8 +41,8 @@ public class MediaController { | ||
| 46 | */ | 41 | */ |
| 47 | @ApiOperation("根据应用名和流id获取播放地址") | 42 | @ApiOperation("根据应用名和流id获取播放地址") |
| 48 | @ApiImplicitParams({ | 43 | @ApiImplicitParams({ |
| 49 | - @ApiImplicitParam(name = "app", value = "应用名"), | ||
| 50 | - @ApiImplicitParam(name = "stream", value = "流id"), | 44 | + @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), |
| 45 | + @ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class), | ||
| 51 | }) | 46 | }) |
| 52 | @RequestMapping(value = "/getStreamInfoByAppAndStream") | 47 | @RequestMapping(value = "/getStreamInfoByAppAndStream") |
| 53 | @ResponseBody | 48 | @ResponseBody |
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.platform; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.platform; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 5 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | 5 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 6 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 6 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 7 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 7 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 8 | -import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | ||
| 9 | -import com.genersoft.iot.vmp.vmanager.platform.bean.UpdateChannelParam; | 8 | +import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| 9 | +import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam; | ||
| 10 | import com.github.pagehelper.PageInfo; | 10 | import com.github.pagehelper.PageInfo; |
| 11 | import io.swagger.annotations.Api; | 11 | import io.swagger.annotations.Api; |
| 12 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 13 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 14 | +import io.swagger.annotations.ApiOperation; | ||
| 12 | import org.slf4j.Logger; | 15 | import org.slf4j.Logger; |
| 13 | import org.slf4j.LoggerFactory; | 16 | import org.slf4j.LoggerFactory; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -21,7 +24,7 @@ import com.genersoft.iot.vmp.conf.SipConfig; | @@ -21,7 +24,7 @@ import com.genersoft.iot.vmp.conf.SipConfig; | ||
| 21 | /** | 24 | /** |
| 22 | * 级联平台管理 | 25 | * 级联平台管理 |
| 23 | */ | 26 | */ |
| 24 | -@Api("级联平台管理") | 27 | +@Api(tags = "级联平台管理") |
| 25 | @CrossOrigin | 28 | @CrossOrigin |
| 26 | @RestController | 29 | @RestController |
| 27 | @RequestMapping("/api/platform") | 30 | @RequestMapping("/api/platform") |
| @@ -41,6 +44,11 @@ public class PlatformController { | @@ -41,6 +44,11 @@ public class PlatformController { | ||
| 41 | @Autowired | 44 | @Autowired |
| 42 | private SipConfig sipConfig; | 45 | private SipConfig sipConfig; |
| 43 | 46 | ||
| 47 | + /** | ||
| 48 | + * 获取国标服务的配置 | ||
| 49 | + * @return | ||
| 50 | + */ | ||
| 51 | + @ApiOperation("获取国标服务的配置") | ||
| 44 | @GetMapping("/server_config") | 52 | @GetMapping("/server_config") |
| 45 | public ResponseEntity<JSONObject> serverConfig() { | 53 | public ResponseEntity<JSONObject> serverConfig() { |
| 46 | JSONObject result = new JSONObject(); | 54 | JSONObject result = new JSONObject(); |
| @@ -51,7 +59,18 @@ public class PlatformController { | @@ -51,7 +59,18 @@ public class PlatformController { | ||
| 51 | return new ResponseEntity<>(result, HttpStatus.OK); | 59 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 52 | } | 60 | } |
| 53 | 61 | ||
| 62 | + /** | ||
| 63 | + * 分页查询级联平台 | ||
| 64 | + * @param page 当前页 | ||
| 65 | + * @param count 每页条数 | ||
| 66 | + * @return | ||
| 67 | + */ | ||
| 68 | + @ApiOperation("分页查询级联平台") | ||
| 54 | @GetMapping("/query/{count}/{page}") | 69 | @GetMapping("/query/{count}/{page}") |
| 70 | + @ApiImplicitParams({ | ||
| 71 | + @ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class), | ||
| 72 | + @ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class), | ||
| 73 | + }) | ||
| 55 | public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ | 74 | public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ |
| 56 | 75 | ||
| 57 | if (logger.isDebugEnabled()) { | 76 | if (logger.isDebugEnabled()) { |
| @@ -60,6 +79,15 @@ public class PlatformController { | @@ -60,6 +79,15 @@ public class PlatformController { | ||
| 60 | return storager.queryParentPlatformList(page, count); | 79 | return storager.queryParentPlatformList(page, count); |
| 61 | } | 80 | } |
| 62 | 81 | ||
| 82 | + /** | ||
| 83 | + * 保存上级平台信息 | ||
| 84 | + * @param parentPlatform | ||
| 85 | + * @return | ||
| 86 | + */ | ||
| 87 | + @ApiOperation("保存上级平台信息") | ||
| 88 | + @ApiImplicitParams({ | ||
| 89 | + @ApiImplicitParam(name = "parentPlatform", value = "上级平台信息", dataTypeClass = ParentPlatform.class), | ||
| 90 | + }) | ||
| 63 | @PostMapping("/save") | 91 | @PostMapping("/save") |
| 64 | @ResponseBody | 92 | @ResponseBody |
| 65 | public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){ | 93 | public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){ |
| @@ -96,13 +124,22 @@ public class PlatformController { | @@ -96,13 +124,22 @@ public class PlatformController { | ||
| 96 | commanderForPlatform.unregister(parentPlatform, null, null); | 124 | commanderForPlatform.unregister(parentPlatform, null, null); |
| 97 | } | 125 | } |
| 98 | 126 | ||
| 99 | - | 127 | + |
| 100 | return new ResponseEntity<>("success", HttpStatus.OK); | 128 | return new ResponseEntity<>("success", HttpStatus.OK); |
| 101 | } else { | 129 | } else { |
| 102 | return new ResponseEntity<>("fail", HttpStatus.OK); | 130 | return new ResponseEntity<>("fail", HttpStatus.OK); |
| 103 | } | 131 | } |
| 104 | } | 132 | } |
| 105 | 133 | ||
| 134 | + /** | ||
| 135 | + * 删除上级平台 | ||
| 136 | + * @param serverGBId 上级平台国标ID | ||
| 137 | + * @return | ||
| 138 | + */ | ||
| 139 | + @ApiOperation("删除上级平台") | ||
| 140 | + @ApiImplicitParams({ | ||
| 141 | + @ApiImplicitParam(name = "serverGBId", value = "上级平台国标ID", dataTypeClass = String.class), | ||
| 142 | + }) | ||
| 106 | @DeleteMapping("/delete/{serverGBId}") | 143 | @DeleteMapping("/delete/{serverGBId}") |
| 107 | @ResponseBody | 144 | @ResponseBody |
| 108 | public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId){ | 145 | public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId){ |
| @@ -139,17 +176,47 @@ public class PlatformController { | @@ -139,17 +176,47 @@ public class PlatformController { | ||
| 139 | } | 176 | } |
| 140 | } | 177 | } |
| 141 | 178 | ||
| 142 | - @GetMapping("/exit/{deviceGbId}") | 179 | + /** |
| 180 | + * 查询上级平台是否存在 | ||
| 181 | + * @param serverGBId 上级平台国标ID | ||
| 182 | + * @return | ||
| 183 | + */ | ||
| 184 | + @ApiOperation("查询上级平台是否存在") | ||
| 185 | + @ApiImplicitParams({ | ||
| 186 | + @ApiImplicitParam(name = "serverGBId", value = "上级平台国标ID", dataTypeClass = String.class), | ||
| 187 | + }) | ||
| 188 | + @GetMapping("/exit/{serverGBId}") | ||
| 143 | @ResponseBody | 189 | @ResponseBody |
| 144 | - public ResponseEntity<String> exitPlatform(@PathVariable String deviceGbId){ | 190 | + public ResponseEntity<String> exitPlatform(@PathVariable String serverGBId){ |
| 145 | 191 | ||
| 146 | if (logger.isDebugEnabled()) { | 192 | if (logger.isDebugEnabled()) { |
| 147 | - logger.debug("查询上级平台是否存在API调用:" + deviceGbId); | 193 | + logger.debug("查询上级平台是否存在API调用:" + serverGBId); |
| 148 | } | 194 | } |
| 149 | - ParentPlatform parentPlatform = storager.queryParentPlatById(deviceGbId); | 195 | + ParentPlatform parentPlatform = storager.queryParentPlatById(serverGBId); |
| 150 | return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK); | 196 | return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK); |
| 151 | } | 197 | } |
| 152 | 198 | ||
| 199 | + /** | ||
| 200 | + * 分页查询级联平台的所有所有通道 | ||
| 201 | + * @param page 当前页 | ||
| 202 | + * @param count 每页条数 | ||
| 203 | + * @param platformId 上级平台ID | ||
| 204 | + * @param query 查询内容 | ||
| 205 | + * @param online 是否在线 | ||
| 206 | + * @param choosed 是否已选中 | ||
| 207 | + * @param channelType 通道类型 | ||
| 208 | + * @return | ||
| 209 | + */ | ||
| 210 | + @ApiOperation("分页查询级联平台的所有所有通道") | ||
| 211 | + @ApiImplicitParams({ | ||
| 212 | + @ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class), | ||
| 213 | + @ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class), | ||
| 214 | + @ApiImplicitParam(name = "platformId", value = "上级平台ID", dataTypeClass = String.class), | ||
| 215 | + @ApiImplicitParam(name = "query", value = "查询内容", dataTypeClass = String.class), | ||
| 216 | + @ApiImplicitParam(name = "online", value = "是否在线", dataTypeClass = Boolean.class), | ||
| 217 | + @ApiImplicitParam(name = "choosed", value = "是否已选中", dataTypeClass = Boolean.class), | ||
| 218 | + @ApiImplicitParam(name = "channelType", value = "通道类型", dataTypeClass = Boolean.class), | ||
| 219 | + }) | ||
| 153 | @GetMapping("/channel_list") | 220 | @GetMapping("/channel_list") |
| 154 | @ResponseBody | 221 | @ResponseBody |
| 155 | public PageInfo<ChannelReduce> channelList(int page, int count, | 222 | public PageInfo<ChannelReduce> channelList(int page, int count, |
| @@ -172,7 +239,15 @@ public class PlatformController { | @@ -172,7 +239,15 @@ public class PlatformController { | ||
| 172 | return channelReduces; | 239 | return channelReduces; |
| 173 | } | 240 | } |
| 174 | 241 | ||
| 175 | - | 242 | + /** |
| 243 | + * 向上级平台添加国标通道 | ||
| 244 | + * @param param 通道关联参数 | ||
| 245 | + * @return | ||
| 246 | + */ | ||
| 247 | + @ApiOperation("向上级平台添加国标通道") | ||
| 248 | + @ApiImplicitParams({ | ||
| 249 | + @ApiImplicitParam(name = "param", value = "通道关联参数", dataTypeClass = UpdateChannelParam.class), | ||
| 250 | + }) | ||
| 176 | @PostMapping("/update_channel_for_gb") | 251 | @PostMapping("/update_channel_for_gb") |
| 177 | @ResponseBody | 252 | @ResponseBody |
| 178 | public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){ | 253 | public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){ |
| @@ -185,6 +260,15 @@ public class PlatformController { | @@ -185,6 +260,15 @@ public class PlatformController { | ||
| 185 | return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK); | 260 | return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK); |
| 186 | } | 261 | } |
| 187 | 262 | ||
| 263 | + /** | ||
| 264 | + * 从上级平台移除国标通道 | ||
| 265 | + * @param param 通道关联参数 | ||
| 266 | + * @return | ||
| 267 | + */ | ||
| 268 | + @ApiOperation("从上级平台移除国标通道") | ||
| 269 | + @ApiImplicitParams({ | ||
| 270 | + @ApiImplicitParam(name = "param", value = "通道关联参数", dataTypeClass = UpdateChannelParam.class), | ||
| 271 | + }) | ||
| 188 | @DeleteMapping("/del_channel_for_gb") | 272 | @DeleteMapping("/del_channel_for_gb") |
| 189 | @ResponseBody | 273 | @ResponseBody |
| 190 | public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){ | 274 | public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){ |
src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/ChannelReduce.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/ChannelReduce.java
src/main/java/com/genersoft/iot/vmp/vmanager/platform/bean/UpdateChannelParam.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/bean/UpdateChannelParam.java
src/main/java/com/genersoft/iot/vmp/vmanager/platformGbStream/PlatformGbStreamController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platformGbStream/PlatformGbStreamController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.platformGbStream; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.platformGbStream; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; | 3 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 4 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 4 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 5 | import com.genersoft.iot.vmp.service.IGbStreamService; | 5 | import com.genersoft.iot.vmp.service.IGbStreamService; |
| 6 | import com.github.pagehelper.PageInfo; | 6 | import com.github.pagehelper.PageInfo; |
| 7 | +import io.swagger.annotations.Api; | ||
| 8 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 9 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 10 | +import io.swagger.annotations.ApiOperation; | ||
| 7 | import org.slf4j.Logger; | 11 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; | 12 | import org.slf4j.LoggerFactory; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| 11 | 15 | ||
| 16 | +@Api(tags = "级联平台关联视频流") | ||
| 12 | @CrossOrigin | 17 | @CrossOrigin |
| 13 | @RestController | 18 | @RestController |
| 14 | -@RequestMapping("/api") | 19 | +@RequestMapping("/api/platform_gb_stream") |
| 15 | public class PlatformGbStreamController { | 20 | public class PlatformGbStreamController { |
| 16 | 21 | ||
| 17 | private final static Logger logger = LoggerFactory.getLogger(PlatformGbStreamController.class); | 22 | private final static Logger logger = LoggerFactory.getLogger(PlatformGbStreamController.class); |
| @@ -22,6 +27,11 @@ public class PlatformGbStreamController { | @@ -22,6 +27,11 @@ public class PlatformGbStreamController { | ||
| 22 | @Autowired | 27 | @Autowired |
| 23 | private IVideoManagerStorager storager; | 28 | private IVideoManagerStorager storager; |
| 24 | 29 | ||
| 30 | + @ApiOperation("分页查询级联平台关联的视频流") | ||
| 31 | + @ApiImplicitParams({ | ||
| 32 | + @ApiImplicitParam(name = "page", value = "当前页", dataTypeClass = Integer.class), | ||
| 33 | + @ApiImplicitParam(name = "count", value = "每页条数", dataTypeClass = Integer.class), | ||
| 34 | + }) | ||
| 25 | @RequestMapping(value = "/list") | 35 | @RequestMapping(value = "/list") |
| 26 | @ResponseBody | 36 | @ResponseBody |
| 27 | public PageInfo<GbStream> list(@RequestParam(required = false)Integer page, | 37 | public PageInfo<GbStream> list(@RequestParam(required = false)Integer page, |
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.play; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.play; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.common.StreamInfo; | 3 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 4 | import com.genersoft.iot.vmp.conf.MediaServerConfig; | 4 | import com.genersoft.iot.vmp.conf.MediaServerConfig; |
| @@ -7,9 +7,13 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | @@ -7,9 +7,13 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | ||
| 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| 8 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 8 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 9 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 9 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 10 | -import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; | 10 | +import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult; |
| 11 | import com.genersoft.iot.vmp.service.IMediaService; | 11 | import com.genersoft.iot.vmp.service.IMediaService; |
| 12 | import com.genersoft.iot.vmp.service.IPlayService; | 12 | import com.genersoft.iot.vmp.service.IPlayService; |
| 13 | +import io.swagger.annotations.Api; | ||
| 14 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 15 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 16 | +import io.swagger.annotations.ApiOperation; | ||
| 13 | import org.slf4j.Logger; | 17 | import org.slf4j.Logger; |
| 14 | import org.slf4j.LoggerFactory; | 18 | import org.slf4j.LoggerFactory; |
| 15 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -31,6 +35,7 @@ import java.util.UUID; | @@ -31,6 +35,7 @@ import java.util.UUID; | ||
| 31 | 35 | ||
| 32 | import javax.sip.message.Response; | 36 | import javax.sip.message.Response; |
| 33 | 37 | ||
| 38 | +@Api(tags = "国标设备点播") | ||
| 34 | @CrossOrigin | 39 | @CrossOrigin |
| 35 | @RestController | 40 | @RestController |
| 36 | @RequestMapping("/api/play") | 41 | @RequestMapping("/api/play") |
| @@ -59,6 +64,11 @@ public class PlayController { | @@ -59,6 +64,11 @@ public class PlayController { | ||
| 59 | @Autowired | 64 | @Autowired |
| 60 | private IMediaService mediaService; | 65 | private IMediaService mediaService; |
| 61 | 66 | ||
| 67 | + @ApiOperation("开始点播") | ||
| 68 | + @ApiImplicitParams({ | ||
| 69 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class), | ||
| 70 | + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 71 | + }) | ||
| 62 | @GetMapping("/start/{deviceId}/{channelId}") | 72 | @GetMapping("/start/{deviceId}/{channelId}") |
| 63 | public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, | 73 | public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, |
| 64 | @PathVariable String channelId) { | 74 | @PathVariable String channelId) { |
| @@ -79,6 +89,10 @@ public class PlayController { | @@ -79,6 +89,10 @@ public class PlayController { | ||
| 79 | return playResult.getResult(); | 89 | return playResult.getResult(); |
| 80 | } | 90 | } |
| 81 | 91 | ||
| 92 | + @ApiOperation("停止点播") | ||
| 93 | + @ApiImplicitParams({ | ||
| 94 | + @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), | ||
| 95 | + }) | ||
| 82 | @PostMapping("/stop/{streamId}") | 96 | @PostMapping("/stop/{streamId}") |
| 83 | public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) { | 97 | public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) { |
| 84 | 98 | ||
| @@ -139,6 +153,10 @@ public class PlayController { | @@ -139,6 +153,10 @@ public class PlayController { | ||
| 139 | * @param streamId 流ID | 153 | * @param streamId 流ID |
| 140 | * @return | 154 | * @return |
| 141 | */ | 155 | */ |
| 156 | + @ApiOperation("将不是h264的视频通过ffmpeg 转码为h264 + aac") | ||
| 157 | + @ApiImplicitParams({ | ||
| 158 | + @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), | ||
| 159 | + }) | ||
| 142 | @PostMapping("/convert/{streamId}") | 160 | @PostMapping("/convert/{streamId}") |
| 143 | public ResponseEntity<String> playConvert(@PathVariable String streamId) { | 161 | public ResponseEntity<String> playConvert(@PathVariable String streamId) { |
| 144 | StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); | 162 | StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); |
| @@ -179,6 +197,10 @@ public class PlayController { | @@ -179,6 +197,10 @@ public class PlayController { | ||
| 179 | * @param key | 197 | * @param key |
| 180 | * @return | 198 | * @return |
| 181 | */ | 199 | */ |
| 200 | + @ApiOperation("结束转码") | ||
| 201 | + @ApiImplicitParams({ | ||
| 202 | + @ApiImplicitParam(name = "key", value = "视频流key", dataTypeClass = String.class), | ||
| 203 | + }) | ||
| 182 | @PostMapping("/convertStop/{key}") | 204 | @PostMapping("/convertStop/{key}") |
| 183 | public ResponseEntity<String> playConvertStop(@PathVariable String key) { | 205 | public ResponseEntity<String> playConvertStop(@PathVariable String key) { |
| 184 | 206 | ||
| @@ -201,11 +223,10 @@ public class PlayController { | @@ -201,11 +223,10 @@ public class PlayController { | ||
| 201 | return new ResponseEntity<String>( result.toJSONString(), HttpStatus.OK); | 223 | return new ResponseEntity<String>( result.toJSONString(), HttpStatus.OK); |
| 202 | } | 224 | } |
| 203 | 225 | ||
| 204 | - /** | ||
| 205 | - * 语音广播命令API接口 | ||
| 206 | - * | ||
| 207 | - * @param deviceId | ||
| 208 | - */ | 226 | + @ApiOperation("语音广播命令") |
| 227 | + @ApiImplicitParams({ | ||
| 228 | + @ApiImplicitParam(name = "deviceId", value = "设备Id", dataTypeClass = String.class), | ||
| 229 | + }) | ||
| 209 | @GetMapping("/broadcast/{deviceId}") | 230 | @GetMapping("/broadcast/{deviceId}") |
| 210 | @PostMapping("/broadcast/{deviceId}") | 231 | @PostMapping("/broadcast/{deviceId}") |
| 211 | public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) { | 232 | public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) { |
src/main/java/com/genersoft/iot/vmp/vmanager/play/bean/PlayResult.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/bean/PlayResult.java
| 1 | -package com.genersoft.iot.vmp.vmanager.play.bean; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.play.bean; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 4 | import org.springframework.http.ResponseEntity; | 4 | import org.springframework.http.ResponseEntity; |
src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.playback; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.playback; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.common.StreamInfo; | 3 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 4 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 4 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| @@ -6,6 +6,10 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | @@ -6,6 +6,10 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | ||
| 6 | //import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 6 | //import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 7 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 7 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 8 | import com.genersoft.iot.vmp.service.IPlayService; | 8 | import com.genersoft.iot.vmp.service.IPlayService; |
| 9 | +import io.swagger.annotations.Api; | ||
| 10 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 11 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 12 | +import io.swagger.annotations.ApiOperation; | ||
| 9 | import org.slf4j.Logger; | 13 | import org.slf4j.Logger; |
| 10 | import org.slf4j.LoggerFactory; | 14 | import org.slf4j.LoggerFactory; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -26,6 +30,7 @@ import org.springframework.web.context.request.async.DeferredResult; | @@ -26,6 +30,7 @@ import org.springframework.web.context.request.async.DeferredResult; | ||
| 26 | import javax.sip.message.Response; | 30 | import javax.sip.message.Response; |
| 27 | import java.util.UUID; | 31 | import java.util.UUID; |
| 28 | 32 | ||
| 33 | +@Api(tags = "视频回放") | ||
| 29 | @CrossOrigin | 34 | @CrossOrigin |
| 30 | @RestController | 35 | @RestController |
| 31 | @RequestMapping("/api/playback") | 36 | @RequestMapping("/api/playback") |
| @@ -51,9 +56,16 @@ public class PlaybackController { | @@ -51,9 +56,16 @@ public class PlaybackController { | ||
| 51 | @Autowired | 56 | @Autowired |
| 52 | private DeferredResultHolder resultHolder; | 57 | private DeferredResultHolder resultHolder; |
| 53 | 58 | ||
| 59 | + @ApiOperation("开始视频回放") | ||
| 60 | + @ApiImplicitParams({ | ||
| 61 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class), | ||
| 62 | + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 63 | + @ApiImplicitParam(name = "startTime", value = "开始时间", dataTypeClass = String.class), | ||
| 64 | + @ApiImplicitParam(name = "endTime", value = "结束时间", dataTypeClass = String.class), | ||
| 65 | + }) | ||
| 54 | @GetMapping("/start/{deviceId}/{channelId}") | 66 | @GetMapping("/start/{deviceId}/{channelId}") |
| 55 | - public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId, String startTime, | ||
| 56 | - String endTime) { | 67 | + public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId, |
| 68 | + String startTime,String endTime) { | ||
| 57 | 69 | ||
| 58 | if (logger.isDebugEnabled()) { | 70 | if (logger.isDebugEnabled()) { |
| 59 | logger.debug(String.format("设备回放 API调用,deviceId:%s ,channelId:%s", deviceId, channelId)); | 71 | logger.debug(String.format("设备回放 API调用,deviceId:%s ,channelId:%s", deviceId, channelId)); |
| @@ -89,6 +101,10 @@ public class PlaybackController { | @@ -89,6 +101,10 @@ public class PlaybackController { | ||
| 89 | return result; | 101 | return result; |
| 90 | } | 102 | } |
| 91 | 103 | ||
| 104 | + @ApiOperation("停止视频回放") | ||
| 105 | + @ApiImplicitParams({ | ||
| 106 | + @ApiImplicitParam(name = "ssrc", value = "视频流标识", dataTypeClass = String.class), | ||
| 107 | + }) | ||
| 92 | @RequestMapping("/stop/{ssrc}") | 108 | @RequestMapping("/stop/{ssrc}") |
| 93 | public ResponseEntity<String> playStop(@PathVariable String ssrc) { | 109 | public ResponseEntity<String> playStop(@PathVariable String ssrc) { |
| 94 | 110 |
src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.ptz; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.ptz; |
| 2 | 2 | ||
| 3 | +import io.swagger.annotations.Api; | ||
| 4 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 5 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 6 | +import io.swagger.annotations.ApiOperation; | ||
| 3 | import org.slf4j.Logger; | 7 | import org.slf4j.Logger; |
| 4 | import org.slf4j.LoggerFactory; | 8 | import org.slf4j.LoggerFactory; |
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -17,22 +21,23 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | @@ -17,22 +21,23 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | ||
| 17 | import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; | 21 | import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; |
| 18 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 22 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 19 | 23 | ||
| 24 | +@Api(tags = "云台控制") | ||
| 20 | @CrossOrigin | 25 | @CrossOrigin |
| 21 | @RestController | 26 | @RestController |
| 22 | -@RequestMapping("/api") | 27 | +@RequestMapping("/api/ptz") |
| 23 | public class PtzController { | 28 | public class PtzController { |
| 24 | - | 29 | + |
| 25 | private final static Logger logger = LoggerFactory.getLogger(PtzController.class); | 30 | private final static Logger logger = LoggerFactory.getLogger(PtzController.class); |
| 26 | - | 31 | + |
| 27 | @Autowired | 32 | @Autowired |
| 28 | private SIPCommander cmder; | 33 | private SIPCommander cmder; |
| 29 | - | 34 | + |
| 30 | @Autowired | 35 | @Autowired |
| 31 | private IVideoManagerStorager storager; | 36 | private IVideoManagerStorager storager; |
| 32 | 37 | ||
| 33 | @Autowired | 38 | @Autowired |
| 34 | private DeferredResultHolder resultHolder; | 39 | private DeferredResultHolder resultHolder; |
| 35 | - | 40 | + |
| 36 | /*** | 41 | /*** |
| 37 | * 云台控制 | 42 | * 云台控制 |
| 38 | * @param deviceId 设备id | 43 | * @param deviceId 设备id |
| @@ -43,49 +48,54 @@ public class PtzController { | @@ -43,49 +48,54 @@ public class PtzController { | ||
| 43 | * @param zoomSpeed 缩放速度 | 48 | * @param zoomSpeed 缩放速度 |
| 44 | * @return String 控制结果 | 49 | * @return String 控制结果 |
| 45 | */ | 50 | */ |
| 46 | - @PostMapping("/ptz/{deviceId}/{channelId}") | 51 | + @ApiOperation("云台控制") |
| 52 | + @ApiImplicitParams({ | ||
| 53 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class), | ||
| 54 | + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 55 | + @ApiImplicitParam(name = "cmdCode", value = "指令码", dataTypeClass = Integer.class), | ||
| 56 | + @ApiImplicitParam(name = "horizonSpeed", value = "水平速度", dataTypeClass = Integer.class), | ||
| 57 | + @ApiImplicitParam(name = "verticalSpeed", value = "垂直速度", dataTypeClass = Integer.class), | ||
| 58 | + @ApiImplicitParam(name = "zoomSpeed", value = "缩放速度", dataTypeClass = Integer.class), | ||
| 59 | + }) | ||
| 60 | + @PostMapping("/control/{deviceId}/{channelId}") | ||
| 47 | public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed){ | 61 | public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed){ |
| 48 | - | 62 | + |
| 49 | if (logger.isDebugEnabled()) { | 63 | if (logger.isDebugEnabled()) { |
| 50 | logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d ,horizonSpeed:%d ,verticalSpeed:%d ,zoomSpeed:%d",deviceId, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed)); | 64 | logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d ,horizonSpeed:%d ,verticalSpeed:%d ,zoomSpeed:%d",deviceId, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed)); |
| 51 | } | 65 | } |
| 52 | Device device = storager.queryVideoDevice(deviceId); | 66 | Device device = storager.queryVideoDevice(deviceId); |
| 53 | - | 67 | + |
| 54 | cmder.frontEndCmd(device, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed); | 68 | cmder.frontEndCmd(device, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed); |
| 55 | return new ResponseEntity<String>("success",HttpStatus.OK); | 69 | return new ResponseEntity<String>("success",HttpStatus.OK); |
| 56 | } | 70 | } |
| 57 | 71 | ||
| 58 | - /** | ||
| 59 | - * 通用前端控制命令API接口 | ||
| 60 | - * | ||
| 61 | - * @param deviceId | ||
| 62 | - * @param channelId | ||
| 63 | - * @param cmdCode | ||
| 64 | - * @param parameter1 | ||
| 65 | - * @param parameter2 | ||
| 66 | - * @param combindCode2 | ||
| 67 | - * @return | ||
| 68 | - */ | ||
| 69 | - @PostMapping("/frontEndCommand/{deviceId}/{channelId}") | 72 | + @ApiOperation("通用前端控制命令") |
| 73 | + @ApiImplicitParams({ | ||
| 74 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class), | ||
| 75 | + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 76 | + @ApiImplicitParam(name = "cmdCode", value = "指令码", dataTypeClass = Integer.class), | ||
| 77 | + @ApiImplicitParam(name = "parameter1", value = "数据一", dataTypeClass = Integer.class), | ||
| 78 | + @ApiImplicitParam(name = "parameter2", value = "数据二", dataTypeClass = Integer.class), | ||
| 79 | + @ApiImplicitParam(name = "combindCode2", value = "组合码二", dataTypeClass = Integer.class), | ||
| 80 | + }) | ||
| 81 | + @PostMapping("/front_end_command/{deviceId}/{channelId}") | ||
| 70 | public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){ | 82 | public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){ |
| 71 | - | 83 | + |
| 72 | if (logger.isDebugEnabled()) { | 84 | if (logger.isDebugEnabled()) { |
| 73 | logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d parameter1:%d parameter2:%d",deviceId, channelId, cmdCode, parameter1, parameter2)); | 85 | logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d parameter1:%d parameter2:%d",deviceId, channelId, cmdCode, parameter1, parameter2)); |
| 74 | } | 86 | } |
| 75 | Device device = storager.queryVideoDevice(deviceId); | 87 | Device device = storager.queryVideoDevice(deviceId); |
| 76 | - | 88 | + |
| 77 | cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2); | 89 | cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2); |
| 78 | return new ResponseEntity<String>("success",HttpStatus.OK); | 90 | return new ResponseEntity<String>("success",HttpStatus.OK); |
| 79 | } | 91 | } |
| 80 | 92 | ||
| 81 | - /** | ||
| 82 | - * 预置位查询命令API接口 | ||
| 83 | - * | ||
| 84 | - * @param deviceId | ||
| 85 | - * @param channelId | ||
| 86 | - * @return | ||
| 87 | - */ | ||
| 88 | - @GetMapping("/presetQuery/{deviceId}/{channelId}") | 93 | + @ApiOperation("预置位查询") |
| 94 | + @ApiImplicitParams({ | ||
| 95 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class), | ||
| 96 | + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 97 | + }) | ||
| 98 | + @GetMapping("/preset/query/{deviceId}/{channelId}") | ||
| 89 | public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) { | 99 | public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) { |
| 90 | if (logger.isDebugEnabled()) { | 100 | if (logger.isDebugEnabled()) { |
| 91 | logger.debug("设备预置位查询API调用"); | 101 | logger.debug("设备预置位查询API调用"); |
src/main/java/com/genersoft/iot/vmp/vmanager/record/RecordController.java renamed to src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/record/RecordController.java
| 1 | -package com.genersoft.iot.vmp.vmanager.record; | 1 | +package com.genersoft.iot.vmp.vmanager.gb28181.record; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 3 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| 4 | +import io.swagger.annotations.Api; | ||
| 5 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 6 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 7 | +import io.swagger.annotations.ApiOperation; | ||
| 4 | import org.slf4j.Logger; | 8 | import org.slf4j.Logger; |
| 5 | import org.slf4j.LoggerFactory; | 9 | import org.slf4j.LoggerFactory; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -18,29 +22,37 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | @@ -18,29 +22,37 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | ||
| 18 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 22 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 19 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 23 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 20 | 24 | ||
| 25 | +@Api(tags = "国标录像") | ||
| 21 | @CrossOrigin | 26 | @CrossOrigin |
| 22 | @RestController | 27 | @RestController |
| 23 | -@RequestMapping("/api") | 28 | +@RequestMapping("/api/gb_record") |
| 24 | public class RecordController { | 29 | public class RecordController { |
| 25 | - | 30 | + |
| 26 | private final static Logger logger = LoggerFactory.getLogger(RecordController.class); | 31 | private final static Logger logger = LoggerFactory.getLogger(RecordController.class); |
| 27 | - | 32 | + |
| 28 | @Autowired | 33 | @Autowired |
| 29 | private SIPCommander cmder; | 34 | private SIPCommander cmder; |
| 30 | - | 35 | + |
| 31 | @Autowired | 36 | @Autowired |
| 32 | private IVideoManagerStorager storager; | 37 | private IVideoManagerStorager storager; |
| 33 | - | 38 | + |
| 34 | @Autowired | 39 | @Autowired |
| 35 | private DeferredResultHolder resultHolder; | 40 | private DeferredResultHolder resultHolder; |
| 36 | 41 | ||
| 37 | - @GetMapping("/record/{deviceId}/{channelId}") | 42 | + @ApiOperation("录像查询") |
| 43 | + @ApiImplicitParams({ | ||
| 44 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class), | ||
| 45 | + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 46 | + @ApiImplicitParam(name = "startTime", value = "开始时间", dataTypeClass = String.class), | ||
| 47 | + @ApiImplicitParam(name = "endTime", value = "结束时间", dataTypeClass = String.class), | ||
| 48 | + }) | ||
| 49 | + @GetMapping("/query/{deviceId}/{channelId}") | ||
| 38 | public DeferredResult<ResponseEntity<RecordInfo>> recordinfo(@PathVariable String deviceId,@PathVariable String channelId, String startTime, String endTime){ | 50 | public DeferredResult<ResponseEntity<RecordInfo>> recordinfo(@PathVariable String deviceId,@PathVariable String channelId, String startTime, String endTime){ |
| 39 | - | 51 | + |
| 40 | if (logger.isDebugEnabled()) { | 52 | if (logger.isDebugEnabled()) { |
| 41 | logger.debug(String.format("录像信息查询 API调用,deviceId:%s ,startTime:%s, startTime:%s",deviceId, startTime, endTime)); | 53 | logger.debug(String.format("录像信息查询 API调用,deviceId:%s ,startTime:%s, startTime:%s",deviceId, startTime, endTime)); |
| 42 | } | 54 | } |
| 43 | - | 55 | + |
| 44 | Device device = storager.queryVideoDevice(deviceId); | 56 | Device device = storager.queryVideoDevice(deviceId); |
| 45 | cmder.recordInfoQuery(device, channelId, startTime, endTime); | 57 | cmder.recordInfoQuery(device, channelId, startTime, endTime); |
| 46 | // 指定超时时间 1分钟30秒 | 58 | // 指定超时时间 1分钟30秒 |
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
| @@ -2,8 +2,9 @@ package com.genersoft.iot.vmp.vmanager.server; | @@ -2,8 +2,9 @@ package com.genersoft.iot.vmp.vmanager.server; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.VManageBootstrap; | 3 | import com.genersoft.iot.vmp.VManageBootstrap; |
| 4 | import com.genersoft.iot.vmp.utils.SpringBeanFactory; | 4 | import com.genersoft.iot.vmp.utils.SpringBeanFactory; |
| 5 | -import com.genersoft.iot.vmp.vmanager.gbStream.bean.GbStreamParam; | ||
| 6 | import gov.nist.javax.sip.SipStackImpl; | 5 | import gov.nist.javax.sip.SipStackImpl; |
| 6 | +import io.swagger.annotations.Api; | ||
| 7 | +import io.swagger.annotations.ApiOperation; | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.context.ConfigurableApplicationContext; | 9 | import org.springframework.context.ConfigurableApplicationContext; |
| 9 | import org.springframework.web.bind.annotation.*; | 10 | import org.springframework.web.bind.annotation.*; |
| @@ -13,6 +14,7 @@ import javax.sip.ObjectInUseException; | @@ -13,6 +14,7 @@ import javax.sip.ObjectInUseException; | ||
| 13 | import javax.sip.SipProvider; | 14 | import javax.sip.SipProvider; |
| 14 | import java.util.Iterator; | 15 | import java.util.Iterator; |
| 15 | 16 | ||
| 17 | +@Api(tags = "服务控制") | ||
| 16 | @CrossOrigin | 18 | @CrossOrigin |
| 17 | @RestController | 19 | @RestController |
| 18 | @RequestMapping("/api/server") | 20 | @RequestMapping("/api/server") |
| @@ -22,6 +24,7 @@ public class ServerController { | @@ -22,6 +24,7 @@ public class ServerController { | ||
| 22 | private ConfigurableApplicationContext context; | 24 | private ConfigurableApplicationContext context; |
| 23 | 25 | ||
| 24 | 26 | ||
| 27 | + @ApiOperation("重启服务") | ||
| 25 | @RequestMapping(value = "/restart") | 28 | @RequestMapping(value = "/restart") |
| 26 | @ResponseBody | 29 | @ResponseBody |
| 27 | public Object restart(){ | 30 | public Object restart(){ |
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
| @@ -5,6 +5,11 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | @@ -5,6 +5,11 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | ||
| 5 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 5 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 6 | import com.genersoft.iot.vmp.service.IStreamProxyService; | 6 | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| 7 | import com.github.pagehelper.PageInfo; | 7 | import com.github.pagehelper.PageInfo; |
| 8 | +import io.swagger.annotations.Api; | ||
| 9 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 10 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 11 | +import io.swagger.annotations.ApiOperation; | ||
| 12 | +import io.swagger.models.auth.In; | ||
| 8 | import org.slf4j.Logger; | 13 | import org.slf4j.Logger; |
| 9 | import org.slf4j.LoggerFactory; | 14 | import org.slf4j.LoggerFactory; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -14,6 +19,7 @@ import org.springframework.web.bind.annotation.*; | @@ -14,6 +19,7 @@ import org.springframework.web.bind.annotation.*; | ||
| 14 | /** | 19 | /** |
| 15 | * 拉流代理接口 | 20 | * 拉流代理接口 |
| 16 | */ | 21 | */ |
| 22 | +@Api(tags = "拉流代理") | ||
| 17 | @Controller | 23 | @Controller |
| 18 | @CrossOrigin | 24 | @CrossOrigin |
| 19 | @RequestMapping(value = "/api/proxy") | 25 | @RequestMapping(value = "/api/proxy") |
| @@ -28,16 +34,27 @@ public class StreamProxyController { | @@ -28,16 +34,27 @@ public class StreamProxyController { | ||
| 28 | private IStreamProxyService streamProxyService; | 34 | private IStreamProxyService streamProxyService; |
| 29 | 35 | ||
| 30 | 36 | ||
| 37 | + @ApiOperation("分页查询流代理") | ||
| 38 | + @ApiImplicitParams({ | ||
| 39 | + @ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class), | ||
| 40 | + @ApiImplicitParam(name="count", value = "每页查询数量", required = true, dataTypeClass = Integer.class), | ||
| 41 | + @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), | ||
| 42 | + @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), | ||
| 43 | + }) | ||
| 31 | @RequestMapping(value = "/list") | 44 | @RequestMapping(value = "/list") |
| 32 | @ResponseBody | 45 | @ResponseBody |
| 33 | public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page, | 46 | public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page, |
| 34 | @RequestParam(required = false)Integer count, | 47 | @RequestParam(required = false)Integer count, |
| 35 | - @RequestParam(required = false)String q, | 48 | + @RequestParam(required = false)String query, |
| 36 | @RequestParam(required = false)Boolean online ){ | 49 | @RequestParam(required = false)Boolean online ){ |
| 37 | 50 | ||
| 38 | return streamProxyService.getAll(page, count); | 51 | return streamProxyService.getAll(page, count); |
| 39 | } | 52 | } |
| 40 | 53 | ||
| 54 | + @ApiOperation("保存代理") | ||
| 55 | + @ApiImplicitParams({ | ||
| 56 | + @ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class), | ||
| 57 | + }) | ||
| 41 | @RequestMapping(value = "/save") | 58 | @RequestMapping(value = "/save") |
| 42 | @ResponseBody | 59 | @ResponseBody |
| 43 | public Object save(@RequestBody StreamProxyItem param){ | 60 | public Object save(@RequestBody StreamProxyItem param){ |
| @@ -46,6 +63,11 @@ public class StreamProxyController { | @@ -46,6 +63,11 @@ public class StreamProxyController { | ||
| 46 | return "success"; | 63 | return "success"; |
| 47 | } | 64 | } |
| 48 | 65 | ||
| 66 | + @ApiOperation("移除代理") | ||
| 67 | + @ApiImplicitParams({ | ||
| 68 | + @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), | ||
| 69 | + @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), | ||
| 70 | + }) | ||
| 49 | @RequestMapping(value = "/del") | 71 | @RequestMapping(value = "/del") |
| 50 | @ResponseBody | 72 | @ResponseBody |
| 51 | public Object del(String app, String stream){ | 73 | public Object del(String app, String stream){ |
| @@ -54,6 +76,11 @@ public class StreamProxyController { | @@ -54,6 +76,11 @@ public class StreamProxyController { | ||
| 54 | return "success"; | 76 | return "success"; |
| 55 | } | 77 | } |
| 56 | 78 | ||
| 79 | + @ApiOperation("启用代理") | ||
| 80 | + @ApiImplicitParams({ | ||
| 81 | + @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), | ||
| 82 | + @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), | ||
| 83 | + }) | ||
| 57 | @RequestMapping(value = "/start") | 84 | @RequestMapping(value = "/start") |
| 58 | @ResponseBody | 85 | @ResponseBody |
| 59 | public Object start(String app, String stream){ | 86 | public Object start(String app, String stream){ |
| @@ -62,6 +89,11 @@ public class StreamProxyController { | @@ -62,6 +89,11 @@ public class StreamProxyController { | ||
| 62 | return "success"; | 89 | return "success"; |
| 63 | } | 90 | } |
| 64 | 91 | ||
| 92 | + @ApiOperation("停用代理") | ||
| 93 | + @ApiImplicitParams({ | ||
| 94 | + @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), | ||
| 95 | + @ApiImplicitParam(name = "stream", value = "流ID", dataTypeClass = String.class), | ||
| 96 | + }) | ||
| 65 | @RequestMapping(value = "/stop") | 97 | @RequestMapping(value = "/stop") |
| 66 | @ResponseBody | 98 | @ResponseBody |
| 67 | public Object stop(String app, String stream){ | 99 | public Object stop(String app, String stream){ |
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
| 1 | package com.genersoft.iot.vmp.vmanager.streamPush; | 1 | package com.genersoft.iot.vmp.vmanager.streamPush; |
| 2 | 2 | ||
| 3 | -import com.alibaba.fastjson.JSONObject; | ||
| 4 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; | 3 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 5 | -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | ||
| 6 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; | 4 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| 7 | import com.genersoft.iot.vmp.service.IStreamPushService; | 5 | import com.genersoft.iot.vmp.service.IStreamPushService; |
| 8 | -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | ||
| 9 | -import com.genersoft.iot.vmp.vmanager.media.MediaController; | ||
| 10 | import com.github.pagehelper.PageInfo; | 6 | import com.github.pagehelper.PageInfo; |
| 7 | +import io.swagger.annotations.Api; | ||
| 8 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 9 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 10 | +import io.swagger.annotations.ApiOperation; | ||
| 11 | import org.slf4j.Logger; | 11 | import org.slf4j.Logger; |
| 12 | import org.slf4j.LoggerFactory; | 12 | import org.slf4j.LoggerFactory; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Controller; | 14 | import org.springframework.stereotype.Controller; |
| 15 | import org.springframework.web.bind.annotation.*; | 15 | import org.springframework.web.bind.annotation.*; |
| 16 | 16 | ||
| 17 | +@Api(tags = "推流信息管理") | ||
| 17 | @Controller | 18 | @Controller |
| 18 | @CrossOrigin | 19 | @CrossOrigin |
| 19 | @RequestMapping(value = "/api/push") | 20 | @RequestMapping(value = "/api/push") |
| @@ -24,18 +25,29 @@ public class StreamPushController { | @@ -24,18 +25,29 @@ public class StreamPushController { | ||
| 24 | @Autowired | 25 | @Autowired |
| 25 | private IStreamPushService streamPushService; | 26 | private IStreamPushService streamPushService; |
| 26 | 27 | ||
| 28 | + @ApiOperation("推流列表查询") | ||
| 29 | + @ApiImplicitParams({ | ||
| 30 | + @ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class), | ||
| 31 | + @ApiImplicitParam(name="count", value = "每页查询数量", required = true, dataTypeClass = Integer.class), | ||
| 32 | + @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), | ||
| 33 | + @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), | ||
| 34 | + }) | ||
| 27 | @RequestMapping(value = "/list") | 35 | @RequestMapping(value = "/list") |
| 28 | @ResponseBody | 36 | @ResponseBody |
| 29 | public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, | 37 | public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, |
| 30 | @RequestParam(required = false)Integer count, | 38 | @RequestParam(required = false)Integer count, |
| 31 | - @RequestParam(required = false)String q, | 39 | + @RequestParam(required = false)String query, |
| 32 | @RequestParam(required = false)Boolean online ){ | 40 | @RequestParam(required = false)Boolean online ){ |
| 33 | 41 | ||
| 34 | PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page - 1, page - 1 + count); | 42 | PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page - 1, page - 1 + count); |
| 35 | return pushList; | 43 | return pushList; |
| 36 | } | 44 | } |
| 37 | 45 | ||
| 38 | - @RequestMapping(value = "/saveToGB") | 46 | + @ApiOperation("将推流添加到国标") |
| 47 | + @ApiImplicitParams({ | ||
| 48 | + @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), | ||
| 49 | + }) | ||
| 50 | + @RequestMapping(value = "/save_to_gb") | ||
| 39 | @ResponseBody | 51 | @ResponseBody |
| 40 | public Object saveToGB(@RequestBody GbStream stream){ | 52 | public Object saveToGB(@RequestBody GbStream stream){ |
| 41 | if (streamPushService.saveToGB(stream)){ | 53 | if (streamPushService.saveToGB(stream)){ |
| @@ -45,7 +57,12 @@ public class StreamPushController { | @@ -45,7 +57,12 @@ public class StreamPushController { | ||
| 45 | } | 57 | } |
| 46 | } | 58 | } |
| 47 | 59 | ||
| 48 | - @RequestMapping(value = "/removeFormGB") | 60 | + |
| 61 | + @ApiOperation("将推流移出到国标") | ||
| 62 | + @ApiImplicitParams({ | ||
| 63 | + @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), | ||
| 64 | + }) | ||
| 65 | + @RequestMapping(value = "/remove_form_gb") | ||
| 49 | @ResponseBody | 66 | @ResponseBody |
| 50 | public Object removeFormGB(@RequestBody GbStream stream){ | 67 | public Object removeFormGB(@RequestBody GbStream stream){ |
| 51 | if (streamPushService.removeFromGB(stream)){ | 68 | if (streamPushService.removeFromGB(stream)){ |
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
| 1 | package com.genersoft.iot.vmp.vmanager.user; | 1 | package com.genersoft.iot.vmp.vmanager.user; |
| 2 | 2 | ||
| 3 | +import com.genersoft.iot.vmp.gb28181.bean.GbStream; | ||
| 4 | +import io.swagger.annotations.Api; | ||
| 5 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 6 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 7 | +import io.swagger.annotations.ApiOperation; | ||
| 3 | import org.springframework.beans.factory.annotation.Value; | 8 | import org.springframework.beans.factory.annotation.Value; |
| 4 | import org.springframework.util.StringUtils; | 9 | import org.springframework.util.StringUtils; |
| 5 | import org.springframework.web.bind.annotation.CrossOrigin; | 10 | import org.springframework.web.bind.annotation.CrossOrigin; |
| 6 | import org.springframework.web.bind.annotation.RequestMapping; | 11 | import org.springframework.web.bind.annotation.RequestMapping; |
| 7 | import org.springframework.web.bind.annotation.RestController; | 12 | import org.springframework.web.bind.annotation.RestController; |
| 8 | 13 | ||
| 14 | +@Api(tags = "用户管理") | ||
| 9 | @CrossOrigin | 15 | @CrossOrigin |
| 10 | @RestController | 16 | @RestController |
| 11 | -@RequestMapping("/api") | 17 | +@RequestMapping("/api/user") |
| 12 | public class UserController { | 18 | public class UserController { |
| 13 | 19 | ||
| 14 | @Value("${auth.username}") | 20 | @Value("${auth.username}") |
| @@ -17,7 +23,12 @@ public class UserController { | @@ -17,7 +23,12 @@ public class UserController { | ||
| 17 | @Value("${auth.password}") | 23 | @Value("${auth.password}") |
| 18 | private String passwordConfig; | 24 | private String passwordConfig; |
| 19 | 25 | ||
| 20 | - @RequestMapping("/user/login") | 26 | + @ApiOperation("登录") |
| 27 | + @ApiImplicitParams({ | ||
| 28 | + @ApiImplicitParam(name = "username", value = "用户名", dataTypeClass = String.class), | ||
| 29 | + @ApiImplicitParam(name = "password", value = "密码(32未md5加密)", dataTypeClass = String.class), | ||
| 30 | + }) | ||
| 31 | + @RequestMapping("/login") | ||
| 21 | public String login(String username, String password){ | 32 | public String login(String username, String password){ |
| 22 | if (!StringUtils.isEmpty(username) && username.equals(usernameConfig) | 33 | if (!StringUtils.isEmpty(username) && username.equals(usernameConfig) |
| 23 | && !StringUtils.isEmpty(password) && password.equals(passwordConfig)) { | 34 | && !StringUtils.isEmpty(password) && password.equals(passwordConfig)) { |
src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java
| @@ -9,7 +9,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | @@ -9,7 +9,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | ||
| 9 | // import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 9 | // import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 10 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 10 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 11 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 11 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 12 | -import com.genersoft.iot.vmp.vmanager.play.PlayController; | 12 | +import com.genersoft.iot.vmp.vmanager.gb28181.play.PlayController; |
| 13 | import org.slf4j.Logger; | 13 | import org.slf4j.Logger; |
| 14 | import org.slf4j.LoggerFactory; | 14 | import org.slf4j.LoggerFactory; |
| 15 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
web_src/index.html
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | <title>国标28181</title> | 6 | <title>国标28181</title> |
| 7 | </head> | 7 | </head> |
| 8 | <body> | 8 | <body> |
| 9 | - <!-- <script type="text/javascript" src="./js/EasyWasmPlayer.js"></script> --> | 9 | + <script type="text/javascript" src="./js/EasyWasmPlayer.js"></script> |
| 10 | <script type="text/javascript" src="/static/js/ZLMRTCClient.js"></script> | 10 | <script type="text/javascript" src="/static/js/ZLMRTCClient.js"></script> |
| 11 | <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rk73w8dv1rkE4UdZsataG68VarhYQzrx&s=1"></script> | 11 | <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rk73w8dv1rkE4UdZsataG68VarhYQzrx&s=1"></script> |
| 12 | <div id="app"></div> | 12 | <div id="app"></div> |
web_src/src/components/PushVideoList.vue
| @@ -155,7 +155,7 @@ | @@ -155,7 +155,7 @@ | ||
| 155 | }, | 155 | }, |
| 156 | removeFromGB: function(row){ | 156 | removeFromGB: function(row){ |
| 157 | var that = this; | 157 | var that = this; |
| 158 | - that.$axios.post(`/api/push/removeFormGB`, row) | 158 | + that.$axios.post(`/api/push/remove_form_gb`, row) |
| 159 | .then(function (res) { | 159 | .then(function (res) { |
| 160 | console.log(res); | 160 | console.log(res); |
| 161 | console.log(res.data == "success"); | 161 | console.log(res.data == "success"); |
web_src/src/components/dialog/addStreamTOGB.vue
| @@ -90,7 +90,7 @@ export default { | @@ -90,7 +90,7 @@ export default { | ||
| 90 | console.log("onSubmit"); | 90 | console.log("onSubmit"); |
| 91 | var that = this; | 91 | var that = this; |
| 92 | that.$axios | 92 | that.$axios |
| 93 | - .post(`/api/push/saveToGB`, that.proxyParam) | 93 | + .post(`/api/push/save_to_gb`, that.proxyParam) |
| 94 | .then(function (res) { | 94 | .then(function (res) { |
| 95 | console.log(res); | 95 | console.log(res); |
| 96 | console.log(res.data == "success"); | 96 | console.log(res.data == "success"); |
web_src/src/components/dialog/devicePlayer.vue
| @@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
| 26 | </div> | 26 | </div> |
| 27 | </el-tab-pane> | 27 | </el-tab-pane> |
| 28 | <!--{"code":0,"data":{"paths":["22-29-30.mp4"],"rootPath":"/home/kkkkk/Documents/ZLMediaKit/release/linux/Debug/www/record/hls/kkkkk/2020-05-11/"}}--> | 28 | <!--{"code":0,"data":{"paths":["22-29-30.mp4"],"rootPath":"/home/kkkkk/Documents/ZLMediaKit/release/linux/Debug/www/record/hls/kkkkk/2020-05-11/"}}--> |
| 29 | - <el-tab-pane label="录像查询" name="record" v-if="showRrecord"> | 29 | + <el-tab-pane label="录像查询" name="record" v-if="showRrecord"> |
| 30 | <el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker> | 30 | <el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker> |
| 31 | <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading"> | 31 | <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading"> |
| 32 | <el-table-column label="名称" prop="name"></el-table-column> | 32 | <el-table-column label="名称" prop="name"></el-table-column> |
| @@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
| 70 | <el-slider v-model="controSpeed" :max="255"></el-slider> | 70 | <el-slider v-model="controSpeed" :max="255"></el-slider> |
| 71 | </div> | 71 | </div> |
| 72 | </div> | 72 | </div> |
| 73 | - | 73 | + |
| 74 | <div class="control-panel"> | 74 | <div class="control-panel"> |
| 75 | <el-button-group> | 75 | <el-button-group> |
| 76 | <el-tag style="position :absolute; left: 0rem; top: 0rem; width: 5rem; text-align: center" size="medium" type="info">预置位编号</el-tag> | 76 | <el-tag style="position :absolute; left: 0rem; top: 0rem; width: 5rem; text-align: center" size="medium" type="info">预置位编号</el-tag> |
| @@ -136,7 +136,8 @@ | @@ -136,7 +136,8 @@ | ||
| 136 | </template> | 136 | </template> |
| 137 | 137 | ||
| 138 | <script> | 138 | <script> |
| 139 | -import player from '../dialog/rtcPlayer.vue' | 139 | +// import player from '../dialog/rtcPlayer.vue' |
| 140 | +import player from '../dialog/easyPlayer.vue' | ||
| 140 | export default { | 141 | export default { |
| 141 | name: 'devicePlayer', | 142 | name: 'devicePlayer', |
| 142 | props: {}, | 143 | props: {}, |
| @@ -250,7 +251,8 @@ export default { | @@ -250,7 +251,8 @@ export default { | ||
| 250 | 251 | ||
| 251 | this.hasaudio = hasAudio; | 252 | this.hasaudio = hasAudio; |
| 252 | this.isLoging = false; | 253 | this.isLoging = false; |
| 253 | - this.videoUrl = streamInfo.rtc; | 254 | + // this.videoUrl = streamInfo.rtc; |
| 255 | + this.videoUrl = streamInfo.ws_flv; | ||
| 254 | this.streamId = streamInfo.streamId; | 256 | this.streamId = streamInfo.streamId; |
| 255 | this.app = streamInfo.app; | 257 | this.app = streamInfo.app; |
| 256 | this.playFromStreamInfo(false, streamInfo) | 258 | this.playFromStreamInfo(false, streamInfo) |
| @@ -369,7 +371,7 @@ export default { | @@ -369,7 +371,7 @@ export default { | ||
| 369 | var endTime = this.videoHistory.date + " 23:59:59"; | 371 | var endTime = this.videoHistory.date + " 23:59:59"; |
| 370 | this.$axios({ | 372 | this.$axios({ |
| 371 | method: 'get', | 373 | method: 'get', |
| 372 | - url: '/api/record/' + this.deviceId + '/' + this.channelId + '?startTime=' + startTime + '&endTime=' + endTime | 374 | + url: '/api/gb_record/query/' + this.deviceId + '/' + this.channelId + '?startTime=' + startTime + '&endTime=' + endTime |
| 373 | }).then(function (res) { | 375 | }).then(function (res) { |
| 374 | // 处理时间信息 | 376 | // 处理时间信息 |
| 375 | that.videoHistory.searchHistoryResult = res.data.recordList; | 377 | that.videoHistory.searchHistoryResult = res.data.recordList; |
| @@ -420,7 +422,7 @@ export default { | @@ -420,7 +422,7 @@ export default { | ||
| 420 | method: 'post', | 422 | method: 'post', |
| 421 | // url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?leftRight=' + leftRight + '&upDown=' + upDown + | 423 | // url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?leftRight=' + leftRight + '&upDown=' + upDown + |
| 422 | // '&inOut=' + zoom + '&moveSpeed=50&zoomSpeed=50' | 424 | // '&inOut=' + zoom + '&moveSpeed=50&zoomSpeed=50' |
| 423 | - url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + (zoom * 16 + upDown * 4 + leftRight) + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed | 425 | + url: '/api/ptz/control/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + (zoom * 16 + upDown * 4 + leftRight) + '&horizonSpeed=' + this.controSpeed + '&verticalSpeed=' + this.controSpeed + '&zoomSpeed=' + this.controSpeed |
| 424 | }).then(function (res) {}); | 426 | }).then(function (res) {}); |
| 425 | }, | 427 | }, |
| 426 | //////////////////////播放器事件处理////////////////////////// | 428 | //////////////////////播放器事件处理////////////////////////// |
| @@ -432,7 +434,7 @@ export default { | @@ -432,7 +434,7 @@ export default { | ||
| 432 | let that = this; | 434 | let that = this; |
| 433 | this.$axios({ | 435 | this.$axios({ |
| 434 | method: 'post', | 436 | method: 'post', |
| 435 | - url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0' | 437 | + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0' |
| 436 | }).then(function (res) {}); | 438 | }).then(function (res) {}); |
| 437 | }, | 439 | }, |
| 438 | setSpeedOrTime: function (cmdCode, groupNum, parameter) { | 440 | setSpeedOrTime: function (cmdCode, groupNum, parameter) { |
| @@ -442,7 +444,7 @@ export default { | @@ -442,7 +444,7 @@ export default { | ||
| 442 | console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16)); | 444 | console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16)); |
| 443 | this.$axios({ | 445 | this.$axios({ |
| 444 | method: 'post', | 446 | method: 'post', |
| 445 | - url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2 | 447 | + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2 |
| 446 | }).then(function (res) {}); | 448 | }).then(function (res) {}); |
| 447 | }, | 449 | }, |
| 448 | setCommand: function (cmdCode, groupNum, parameter) { | 450 | setCommand: function (cmdCode, groupNum, parameter) { |
| @@ -450,7 +452,7 @@ export default { | @@ -450,7 +452,7 @@ export default { | ||
| 450 | console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0'); | 452 | console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0'); |
| 451 | this.$axios({ | 453 | this.$axios({ |
| 452 | method: 'post', | 454 | method: 'post', |
| 453 | - url: '/api/frontEndCommand/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0' | 455 | + url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0' |
| 454 | }).then(function (res) {}); | 456 | }).then(function (res) {}); |
| 455 | }, | 457 | }, |
| 456 | formatTooltip: function (val) { | 458 | formatTooltip: function (val) { |
web_src/src/components/dialog/player.vue deleted
100644 → 0
| 1 | -<template> | ||
| 2 | - <div id="player"> | ||
| 3 | - <div id="easyplayer"></div> | ||
| 4 | - </div> | ||
| 5 | -</template> | ||
| 6 | - | ||
| 7 | -<script> | ||
| 8 | -export default { | ||
| 9 | - name: 'player', | ||
| 10 | - data() { | ||
| 11 | - return { | ||
| 12 | - easyPlayer: null | ||
| 13 | - }; | ||
| 14 | - }, | ||
| 15 | - props: ['videoUrl', 'error', 'hasaudio'], | ||
| 16 | - mounted () { | ||
| 17 | - this.$nextTick(() =>{ | ||
| 18 | - console.log("初始化时的地址为: " + this.videoUrl) | ||
| 19 | - this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK) | ||
| 20 | - this.easyPlayer.play(this.videoUrl, 1) | ||
| 21 | - }) | ||
| 22 | - }, | ||
| 23 | - watch:{ | ||
| 24 | - videoUrl(newData, oldData){ | ||
| 25 | - this.easyPlayer.destroy() | ||
| 26 | - this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK) | ||
| 27 | - this.easyPlayer.play(newData, 1) | ||
| 28 | - }, | ||
| 29 | - immediate:true | ||
| 30 | - }, | ||
| 31 | - methods: { | ||
| 32 | - play: function (url) { | ||
| 33 | - this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK) | ||
| 34 | - this.easyPlayer.play(url, 1) | ||
| 35 | - }, | ||
| 36 | - pause: function () { | ||
| 37 | - this.easyPlayer.destroy(); | ||
| 38 | - }, | ||
| 39 | - eventcallbacK: function(type, message) { | ||
| 40 | - console.log("player 事件回调") | ||
| 41 | - console.log(type) | ||
| 42 | - console.log(message) | ||
| 43 | - } | ||
| 44 | - }, | ||
| 45 | -} | ||
| 46 | -</script> | ||
| 47 | - | ||
| 48 | -<style> | ||
| 49 | - .LodingTitle { | ||
| 50 | - min-width: 70px; | ||
| 51 | - } | ||
| 52 | - /* 隐藏logo */ | ||
| 53 | - /* .iconqingxiLOGO { | ||
| 54 | - display: none !important; | ||
| 55 | - } */ | ||
| 56 | - | ||
| 57 | -</style> | ||
| 58 | \ No newline at end of file | 0 | \ No newline at end of file |