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 | 23 | public Docket createRestApi() { |
| 24 | 24 | return new Docket(DocumentationType.OAS_30) |
| 25 | 25 | .apiInfo(apiInfo()) |
| 26 | + .groupName("全部") | |
| 26 | 27 | .select() |
| 27 | 28 | .apis(RequestHandlerSelectors.basePackage("com.genersoft.iot.vmp.vmanager")) |
| 28 | 29 | .paths(PathSelectors.any()) |
| 29 | 30 | .build() |
| 30 | 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 | 91 | private ApiInfo apiInfo() { |
| 34 | 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 | 19 | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; |
| 20 | 20 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 21 | 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 | 23 | import com.genersoft.iot.vmp.service.IPlayService; |
| 24 | 24 | import gov.nist.javax.sip.address.AddressImpl; |
| 25 | 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 | 40 | import com.genersoft.iot.vmp.utils.GpsUtil; |
| 41 | 41 | import com.genersoft.iot.vmp.utils.SpringBeanFactory; |
| 42 | 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 | 45 | import gov.nist.javax.sip.SipStackImpl; |
| 46 | 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 | 245 | String streamId = json.getString("stream"); |
| 246 | 246 | String schema = json.getString("schema"); |
| 247 | 247 | JSONArray tracks = json.getJSONArray("tracks"); |
| 248 | - String regist = json.getString("regist"); | |
| 248 | + boolean regist = json.getBoolean("regist"); | |
| 249 | 249 | if (tracks != null) { |
| 250 | 250 | System.out.println("222222" + schema); |
| 251 | 251 | } |
| 252 | 252 | if ("rtmp".equals(schema)){ |
| 253 | 253 | |
| 254 | - if ("rtp".equals(app) && regist != null ) { | |
| 254 | + if ("rtp".equals(app) && !regist ) { | |
| 255 | 255 | StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); |
| 256 | 256 | if (streamInfo!=null){ |
| 257 | 257 | redisCatchStorage.stopPlay(streamInfo); |
| ... | ... | @@ -262,7 +262,7 @@ public class ZLMHttpHookListener { |
| 262 | 262 | } |
| 263 | 263 | }else { |
| 264 | 264 | if (!"rtp".equals(app) ){ |
| 265 | - if (regist == null) { | |
| 265 | + if (regist) { | |
| 266 | 266 | zlmMediaListManager.addMedia(app, streamId); |
| 267 | 267 | }else { |
| 268 | 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 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | 4 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 5 | 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 | 13 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 14 | 14 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 15 | 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 | 17 | import com.genersoft.iot.vmp.service.IMediaService; |
| 18 | 18 | import com.genersoft.iot.vmp.service.IPlayService; |
| 19 | 19 | import org.slf4j.Logger; | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java
| ... | ... | @@ -5,7 +5,7 @@ import java.util.List; |
| 5 | 5 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 6 | 6 | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; |
| 7 | 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 | 9 | import com.github.pagehelper.PageInfo; |
| 10 | 10 | |
| 11 | 11 | /** | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| 1 | 1 | package com.genersoft.iot.vmp.storager.dao; |
| 2 | 2 | |
| 3 | 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 | 5 | import org.apache.ibatis.annotations.*; |
| 6 | 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 | 2 | |
| 3 | 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 4 | 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 | 6 | import org.apache.ibatis.annotations.Delete; |
| 7 | 7 | import org.apache.ibatis.annotations.Insert; |
| 8 | 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 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| 8 | 8 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 9 | 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 | 11 | import com.github.pagehelper.PageHelper; |
| 12 | 12 | import com.github.pagehelper.PageInfo; |
| 13 | 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 | 3 | import java.util.List; |
| 4 | 4 | |
| ... | ... | @@ -58,9 +58,9 @@ public class MobilePositionController { |
| 58 | 58 | */ |
| 59 | 59 | @ApiOperation("查询历史轨迹") |
| 60 | 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 | 65 | @GetMapping("/history/{deviceId}") |
| 66 | 66 | public ResponseEntity<List<MobilePosition>> positions(@PathVariable String deviceId, |
| ... | ... | @@ -88,7 +88,7 @@ public class MobilePositionController { |
| 88 | 88 | */ |
| 89 | 89 | @ApiOperation("查询设备最新位置") |
| 90 | 90 | @ApiImplicitParams({ |
| 91 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | |
| 91 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), | |
| 92 | 92 | }) |
| 93 | 93 | @GetMapping("/latest/{deviceId}") |
| 94 | 94 | public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) { |
| ... | ... | @@ -106,7 +106,7 @@ public class MobilePositionController { |
| 106 | 106 | */ |
| 107 | 107 | @ApiOperation("获取移动位置信息") |
| 108 | 108 | @ApiImplicitParams({ |
| 109 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | |
| 109 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), | |
| 110 | 110 | }) |
| 111 | 111 | @GetMapping("/realtime/{deviceId}") |
| 112 | 112 | public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) { |
| ... | ... | @@ -140,9 +140,9 @@ public class MobilePositionController { |
| 140 | 140 | */ |
| 141 | 141 | @ApiOperation("订阅位置信息") |
| 142 | 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 | 147 | @GetMapping("/subscribe/{deviceId}") |
| 148 | 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 | 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 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | 9 | import org.springframework.stereotype.Controller; |
| 6 | 10 | import org.springframework.web.bind.annotation.CrossOrigin; |
| ... | ... | @@ -13,15 +17,18 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| 13 | 17 | * @author: lawrencehj |
| 14 | 18 | * @data: 2021-01-20 |
| 15 | 19 | */ |
| 16 | - | |
| 20 | +@Api(tags = "SSE推送") | |
| 17 | 21 | @CrossOrigin |
| 18 | 22 | @Controller |
| 19 | 23 | @RequestMapping("/api") |
| 20 | 24 | public class SseController { |
| 21 | - @Autowired | |
| 25 | + @Autowired | |
| 22 | 26 | AlarmEventListener alarmEventListener; |
| 23 | - | |
| 24 | - //设置响应 | |
| 27 | + | |
| 28 | + @ApiOperation("设置响应") | |
| 29 | + @ApiImplicitParams({ | |
| 30 | + @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), | |
| 31 | + }) | |
| 25 | 32 | @RequestMapping("/emit") |
| 26 | 33 | public SseEmitter emit(@RequestParam String browserId) { |
| 27 | 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 | 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 | 10 | import javax.sip.message.Response; |
| 11 | 11 | |
| ... | ... | @@ -24,7 +24,6 @@ import io.swagger.annotations.ApiOperation; |
| 24 | 24 | import org.slf4j.Logger; |
| 25 | 25 | import org.slf4j.LoggerFactory; |
| 26 | 26 | import org.springframework.beans.factory.annotation.Autowired; |
| 27 | -import org.springframework.http.HttpRequest; | |
| 28 | 27 | import org.springframework.http.ResponseEntity; |
| 29 | 28 | import org.springframework.web.bind.annotation.*; |
| 30 | 29 | import org.springframework.web.context.request.async.DeferredResult; |
| ... | ... | @@ -59,12 +58,12 @@ public class DeviceConfig { |
| 59 | 58 | @ApiOperation("看守位控制命令") |
| 60 | 59 | @GetMapping("/basicParam/{deviceId}") |
| 61 | 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 | 68 | public DeferredResult<ResponseEntity<String>> homePositionApi(@PathVariable String deviceId, |
| 70 | 69 | @RequestParam(required = false) String channelId, |
| ... | ... | @@ -109,9 +108,9 @@ public class DeviceConfig { |
| 109 | 108 | */ |
| 110 | 109 | @ApiOperation("设备配置查询请求") |
| 111 | 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 | 115 | @GetMapping("/query/{deviceId}/{configType}") |
| 117 | 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 | 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 | 10 | import javax.sip.message.Response; |
| 11 | 11 | |
| ... | ... | @@ -53,7 +53,7 @@ public class DeviceControl { |
| 53 | 53 | */ |
| 54 | 54 | @ApiOperation("远程启动控制命令") |
| 55 | 55 | @ApiImplicitParams({ |
| 56 | - @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true), | |
| 56 | + @ApiImplicitParam(name = "deviceId", value ="设备ID", required = true, dataTypeClass = String.class), | |
| 57 | 57 | }) |
| 58 | 58 | @GetMapping("/teleboot/{deviceId}") |
| 59 | 59 | public ResponseEntity<String> teleBootApi(@PathVariable String deviceId) { |
| ... | ... | @@ -82,10 +82,10 @@ public class DeviceControl { |
| 82 | 82 | */ |
| 83 | 83 | @ApiOperation("录像控制命令") |
| 84 | 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 | 87 | @ApiImplicitParam(name = "recordCmdStr", value ="命令, 可选值:Record(手动录像),StopRecord(停止手动录像)", |
| 88 | - required = true), | |
| 88 | + required = true ,dataTypeClass = String.class), | |
| 89 | 89 | }) |
| 90 | 90 | @GetMapping("/record/{deviceId}/{recordCmdStr}") |
| 91 | 91 | public DeferredResult<ResponseEntity<String>> recordApi(@PathVariable String deviceId, |
| ... | ... | @@ -122,8 +122,9 @@ public class DeviceControl { |
| 122 | 122 | */ |
| 123 | 123 | @ApiOperation("录像控制命令") |
| 124 | 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 | 129 | @GetMapping("/guard/{deviceId}/{guardCmdStr}") |
| 129 | 130 | public DeferredResult<ResponseEntity<String>> guardApi(@PathVariable String deviceId, @PathVariable String guardCmdStr) { |
| ... | ... | @@ -160,9 +161,9 @@ public class DeviceControl { |
| 160 | 161 | */ |
| 161 | 162 | @ApiOperation("报警复位") |
| 162 | 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 | 168 | @GetMapping("/reset_alarm/{deviceId}") |
| 168 | 169 | public DeferredResult<ResponseEntity<String>> resetAlarmApi(@PathVariable String deviceId, |
| ... | ... | @@ -200,8 +201,8 @@ public class DeviceControl { |
| 200 | 201 | */ |
| 201 | 202 | @ApiOperation("强制关键帧") |
| 202 | 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 | 207 | @GetMapping("/i_frame/{deviceId}") |
| 207 | 208 | public ResponseEntity<String> iFrame(@PathVariable String deviceId, |
| ... | ... | @@ -234,11 +235,11 @@ public class DeviceControl { |
| 234 | 235 | */ |
| 235 | 236 | @ApiOperation("看守位控制") |
| 236 | 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 | 244 | @GetMapping("/home_position/{deviceId}/{enabled}") |
| 244 | 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 | 3 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 4 | 4 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| ... | ... | @@ -22,7 +22,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 22 | 22 | |
| 23 | 23 | import javax.sip.message.Response; |
| 24 | 24 | |
| 25 | -@Api(tags = "国标设备查询1", value = "国标设备查询") | |
| 25 | +@Api(tags = "国标设备查询", value = "国标设备查询") | |
| 26 | 26 | @SuppressWarnings("rawtypes") |
| 27 | 27 | @CrossOrigin |
| 28 | 28 | @RestController |
| ... | ... | @@ -50,7 +50,7 @@ public class DeviceQuery { |
| 50 | 50 | */ |
| 51 | 51 | @ApiOperation("使用ID查询国标设备") |
| 52 | 52 | @ApiImplicitParams({ |
| 53 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | |
| 53 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), | |
| 54 | 54 | }) |
| 55 | 55 | @GetMapping("/devices/{deviceId}") |
| 56 | 56 | public ResponseEntity<Device> devices(@PathVariable String deviceId){ |
| ... | ... | @@ -71,8 +71,8 @@ public class DeviceQuery { |
| 71 | 71 | */ |
| 72 | 72 | @ApiOperation("分页查询国标设备") |
| 73 | 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 | 77 | @GetMapping("/devices") |
| 78 | 78 | public PageInfo<Device> devices(int page, int count){ |
| ... | ... | @@ -98,12 +98,12 @@ public class DeviceQuery { |
| 98 | 98 | @ApiOperation("分页查询通道") |
| 99 | 99 | @GetMapping("/devices/{deviceId}/channels") |
| 100 | 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 | 108 | public ResponseEntity<PageInfo> channels(@PathVariable String deviceId, |
| 109 | 109 | int page, int count, |
| ... | ... | @@ -128,7 +128,7 @@ public class DeviceQuery { |
| 128 | 128 | */ |
| 129 | 129 | @ApiOperation("同步设备通道") |
| 130 | 130 | @ApiImplicitParams({ |
| 131 | - @ApiImplicitParam(name="deviceId", value = "设备id", required = true), | |
| 131 | + @ApiImplicitParam(name="deviceId", value = "设备id", required = true ,dataTypeClass = String.class), | |
| 132 | 132 | }) |
| 133 | 133 | @PostMapping("/devices/{deviceId}/sync") |
| 134 | 134 | public DeferredResult<ResponseEntity<Device>> devicesSync(@PathVariable String deviceId){ |
| ... | ... | @@ -165,7 +165,7 @@ public class DeviceQuery { |
| 165 | 165 | */ |
| 166 | 166 | @ApiOperation("移除设备") |
| 167 | 167 | @ApiImplicitParams({ |
| 168 | - @ApiImplicitParam(name="deviceId", value = "设备id", required = true), | |
| 168 | + @ApiImplicitParam(name="deviceId", value = "设备id", required = true, dataTypeClass = String.class), | |
| 169 | 169 | }) |
| 170 | 170 | @DeleteMapping("/devices/{deviceId}/delete") |
| 171 | 171 | public ResponseEntity<String> delete(@PathVariable String deviceId){ |
| ... | ... | @@ -201,13 +201,13 @@ public class DeviceQuery { |
| 201 | 201 | */ |
| 202 | 202 | @ApiOperation("分页查询子目录通道") |
| 203 | 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 | 212 | @GetMapping("/sub_channels/{deviceId}/{channelId}/channels") |
| 213 | 213 | public ResponseEntity<PageInfo> subChannels(@PathVariable String deviceId, |
| ... | ... | @@ -239,8 +239,8 @@ public class DeviceQuery { |
| 239 | 239 | */ |
| 240 | 240 | @ApiOperation("更新通道信息") |
| 241 | 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 | 245 | @PostMapping("/channel/update/{deviceId}") |
| 246 | 246 | public ResponseEntity<PageInfo> updateChannel(@PathVariable String deviceId,DeviceChannel channel){ |
| ... | ... | @@ -256,7 +256,7 @@ public class DeviceQuery { |
| 256 | 256 | */ |
| 257 | 257 | @ApiOperation("修改数据流传输模式") |
| 258 | 258 | @ApiImplicitParams({ |
| 259 | - @ApiImplicitParam(name = "deviceId", value = "设备id", required = true), | |
| 259 | + @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class), | |
| 260 | 260 | @ApiImplicitParam(name = "streamMode", value = "数据流传输模式, 取值:" + |
| 261 | 261 | "UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)"), |
| 262 | 262 | }) |
| ... | ... | @@ -275,7 +275,7 @@ public class DeviceQuery { |
| 275 | 275 | */ |
| 276 | 276 | @ApiOperation("设备状态查询") |
| 277 | 277 | @ApiImplicitParams({ |
| 278 | - @ApiImplicitParam(name = "deviceId", value = "设备id", required = true), | |
| 278 | + @ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataTypeClass = String.class), | |
| 279 | 279 | }) |
| 280 | 280 | @GetMapping("/devices/{deviceId}/status") |
| 281 | 281 | public DeferredResult<ResponseEntity<String>> deviceStatusApi(@PathVariable String deviceId) { |
| ... | ... | @@ -316,13 +316,13 @@ public class DeviceQuery { |
| 316 | 316 | */ |
| 317 | 317 | @ApiOperation("设备报警查询") |
| 318 | 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 | 327 | @GetMapping("/alarm/{deviceId}") |
| 328 | 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 | 3 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 4 | 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 | 6 | import com.genersoft.iot.vmp.service.IGbStreamService; |
| 7 | 7 | import com.github.pagehelper.PageInfo; |
| 8 | 8 | import io.swagger.annotations.Api; |
| ... | ... | @@ -37,8 +37,8 @@ public class GbStreamController { |
| 37 | 37 | */ |
| 38 | 38 | @ApiOperation("查询国标通道") |
| 39 | 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 | 43 | @GetMapping(value = "/list") |
| 44 | 44 | @ResponseBody |
| ... | ... | @@ -56,7 +56,8 @@ public class GbStreamController { |
| 56 | 56 | */ |
| 57 | 57 | @ApiOperation("移除国标关联") |
| 58 | 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 | 62 | @DeleteMapping(value = "/del") |
| 62 | 63 | @ResponseBody |
| ... | ... | @@ -76,7 +77,7 @@ public class GbStreamController { |
| 76 | 77 | */ |
| 77 | 78 | @ApiOperation("保存国标关联") |
| 78 | 79 | @ApiImplicitParams({ |
| 79 | - @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ), | |
| 80 | + @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true , dataTypeClass = GbStreamParam.class), | |
| 80 | 81 | }) |
| 81 | 82 | @PostMapping(value = "/add") |
| 82 | 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 | 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 | 4 | import com.genersoft.iot.vmp.service.IStreamPushService; |
| 8 | -import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | |
| 9 | 5 | import com.genersoft.iot.vmp.service.IMediaService; |
| 10 | -import com.genersoft.iot.vmp.service.IStreamProxyService; | |
| 11 | 6 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 12 | 7 | import io.swagger.annotations.Api; |
| 13 | 8 | import io.swagger.annotations.ApiImplicitParam; |
| ... | ... | @@ -46,8 +41,8 @@ public class MediaController { |
| 46 | 41 | */ |
| 47 | 42 | @ApiOperation("根据应用名和流id获取播放地址") |
| 48 | 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 | 47 | @RequestMapping(value = "/getStreamInfoByAppAndStream") |
| 53 | 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 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 5 | 5 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 6 | 6 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 7 | 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 | 10 | import com.github.pagehelper.PageInfo; |
| 11 | 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 | 15 | import org.slf4j.Logger; |
| 13 | 16 | import org.slf4j.LoggerFactory; |
| 14 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -21,7 +24,7 @@ import com.genersoft.iot.vmp.conf.SipConfig; |
| 21 | 24 | /** |
| 22 | 25 | * 级联平台管理 |
| 23 | 26 | */ |
| 24 | -@Api("级联平台管理") | |
| 27 | +@Api(tags = "级联平台管理") | |
| 25 | 28 | @CrossOrigin |
| 26 | 29 | @RestController |
| 27 | 30 | @RequestMapping("/api/platform") |
| ... | ... | @@ -41,6 +44,11 @@ public class PlatformController { |
| 41 | 44 | @Autowired |
| 42 | 45 | private SipConfig sipConfig; |
| 43 | 46 | |
| 47 | + /** | |
| 48 | + * 获取国标服务的配置 | |
| 49 | + * @return | |
| 50 | + */ | |
| 51 | + @ApiOperation("获取国标服务的配置") | |
| 44 | 52 | @GetMapping("/server_config") |
| 45 | 53 | public ResponseEntity<JSONObject> serverConfig() { |
| 46 | 54 | JSONObject result = new JSONObject(); |
| ... | ... | @@ -51,7 +59,18 @@ public class PlatformController { |
| 51 | 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 | 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 | 74 | public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ |
| 56 | 75 | |
| 57 | 76 | if (logger.isDebugEnabled()) { |
| ... | ... | @@ -60,6 +79,15 @@ public class PlatformController { |
| 60 | 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 | 91 | @PostMapping("/save") |
| 64 | 92 | @ResponseBody |
| 65 | 93 | public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){ |
| ... | ... | @@ -96,13 +124,22 @@ public class PlatformController { |
| 96 | 124 | commanderForPlatform.unregister(parentPlatform, null, null); |
| 97 | 125 | } |
| 98 | 126 | |
| 99 | - | |
| 127 | + | |
| 100 | 128 | return new ResponseEntity<>("success", HttpStatus.OK); |
| 101 | 129 | } else { |
| 102 | 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 | 143 | @DeleteMapping("/delete/{serverGBId}") |
| 107 | 144 | @ResponseBody |
| 108 | 145 | public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId){ |
| ... | ... | @@ -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 | 189 | @ResponseBody |
| 144 | - public ResponseEntity<String> exitPlatform(@PathVariable String deviceGbId){ | |
| 190 | + public ResponseEntity<String> exitPlatform(@PathVariable String serverGBId){ | |
| 145 | 191 | |
| 146 | 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 | 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 | 220 | @GetMapping("/channel_list") |
| 154 | 221 | @ResponseBody |
| 155 | 222 | public PageInfo<ChannelReduce> channelList(int page, int count, |
| ... | ... | @@ -172,7 +239,15 @@ public class PlatformController { |
| 172 | 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 | 251 | @PostMapping("/update_channel_for_gb") |
| 177 | 252 | @ResponseBody |
| 178 | 253 | public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){ |
| ... | ... | @@ -185,6 +260,15 @@ public class PlatformController { |
| 185 | 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 | 272 | @DeleteMapping("/del_channel_for_gb") |
| 189 | 273 | @ResponseBody |
| 190 | 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 | 3 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 4 | 4 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 5 | 5 | import com.genersoft.iot.vmp.service.IGbStreamService; |
| 6 | 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 | 11 | import org.slf4j.Logger; |
| 8 | 12 | import org.slf4j.LoggerFactory; |
| 9 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 14 | import org.springframework.web.bind.annotation.*; |
| 11 | 15 | |
| 16 | +@Api(tags = "级联平台关联视频流") | |
| 12 | 17 | @CrossOrigin |
| 13 | 18 | @RestController |
| 14 | -@RequestMapping("/api") | |
| 19 | +@RequestMapping("/api/platform_gb_stream") | |
| 15 | 20 | public class PlatformGbStreamController { |
| 16 | 21 | |
| 17 | 22 | private final static Logger logger = LoggerFactory.getLogger(PlatformGbStreamController.class); |
| ... | ... | @@ -22,6 +27,11 @@ public class PlatformGbStreamController { |
| 22 | 27 | @Autowired |
| 23 | 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 | 35 | @RequestMapping(value = "/list") |
| 26 | 36 | @ResponseBody |
| 27 | 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 | 3 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 4 | 4 | import com.genersoft.iot.vmp.conf.MediaServerConfig; |
| ... | ... | @@ -7,9 +7,13 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 7 | 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| 8 | 8 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 9 | 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 | 11 | import com.genersoft.iot.vmp.service.IMediaService; |
| 12 | 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 | 17 | import org.slf4j.Logger; |
| 14 | 18 | import org.slf4j.LoggerFactory; |
| 15 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -31,6 +35,7 @@ import java.util.UUID; |
| 31 | 35 | |
| 32 | 36 | import javax.sip.message.Response; |
| 33 | 37 | |
| 38 | +@Api(tags = "国标设备点播") | |
| 34 | 39 | @CrossOrigin |
| 35 | 40 | @RestController |
| 36 | 41 | @RequestMapping("/api/play") |
| ... | ... | @@ -59,6 +64,11 @@ public class PlayController { |
| 59 | 64 | @Autowired |
| 60 | 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 | 72 | @GetMapping("/start/{deviceId}/{channelId}") |
| 63 | 73 | public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, |
| 64 | 74 | @PathVariable String channelId) { |
| ... | ... | @@ -79,6 +89,10 @@ public class PlayController { |
| 79 | 89 | return playResult.getResult(); |
| 80 | 90 | } |
| 81 | 91 | |
| 92 | + @ApiOperation("停止点播") | |
| 93 | + @ApiImplicitParams({ | |
| 94 | + @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), | |
| 95 | + }) | |
| 82 | 96 | @PostMapping("/stop/{streamId}") |
| 83 | 97 | public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) { |
| 84 | 98 | |
| ... | ... | @@ -139,6 +153,10 @@ public class PlayController { |
| 139 | 153 | * @param streamId 流ID |
| 140 | 154 | * @return |
| 141 | 155 | */ |
| 156 | + @ApiOperation("将不是h264的视频通过ffmpeg 转码为h264 + aac") | |
| 157 | + @ApiImplicitParams({ | |
| 158 | + @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), | |
| 159 | + }) | |
| 142 | 160 | @PostMapping("/convert/{streamId}") |
| 143 | 161 | public ResponseEntity<String> playConvert(@PathVariable String streamId) { |
| 144 | 162 | StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); |
| ... | ... | @@ -179,6 +197,10 @@ public class PlayController { |
| 179 | 197 | * @param key |
| 180 | 198 | * @return |
| 181 | 199 | */ |
| 200 | + @ApiOperation("结束转码") | |
| 201 | + @ApiImplicitParams({ | |
| 202 | + @ApiImplicitParam(name = "key", value = "视频流key", dataTypeClass = String.class), | |
| 203 | + }) | |
| 182 | 204 | @PostMapping("/convertStop/{key}") |
| 183 | 205 | public ResponseEntity<String> playConvertStop(@PathVariable String key) { |
| 184 | 206 | |
| ... | ... | @@ -201,11 +223,10 @@ public class PlayController { |
| 201 | 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 | 230 | @GetMapping("/broadcast/{deviceId}") |
| 210 | 231 | @PostMapping("/broadcast/{deviceId}") |
| 211 | 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
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 | 3 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 4 | 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 | //import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 7 | 7 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 8 | 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 | 13 | import org.slf4j.Logger; |
| 10 | 14 | import org.slf4j.LoggerFactory; |
| 11 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -26,6 +30,7 @@ import org.springframework.web.context.request.async.DeferredResult; |
| 26 | 30 | import javax.sip.message.Response; |
| 27 | 31 | import java.util.UUID; |
| 28 | 32 | |
| 33 | +@Api(tags = "视频回放") | |
| 29 | 34 | @CrossOrigin |
| 30 | 35 | @RestController |
| 31 | 36 | @RequestMapping("/api/playback") |
| ... | ... | @@ -51,9 +56,16 @@ public class PlaybackController { |
| 51 | 56 | @Autowired |
| 52 | 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 | 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 | 70 | if (logger.isDebugEnabled()) { |
| 59 | 71 | logger.debug(String.format("设备回放 API调用,deviceId:%s ,channelId:%s", deviceId, channelId)); |
| ... | ... | @@ -89,6 +101,10 @@ public class PlaybackController { |
| 89 | 101 | return result; |
| 90 | 102 | } |
| 91 | 103 | |
| 104 | + @ApiOperation("停止视频回放") | |
| 105 | + @ApiImplicitParams({ | |
| 106 | + @ApiImplicitParam(name = "ssrc", value = "视频流标识", dataTypeClass = String.class), | |
| 107 | + }) | |
| 92 | 108 | @RequestMapping("/stop/{ssrc}") |
| 93 | 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 | 7 | import org.slf4j.Logger; |
| 4 | 8 | import org.slf4j.LoggerFactory; |
| 5 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -17,22 +21,23 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 17 | 21 | import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; |
| 18 | 22 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 19 | 23 | |
| 24 | +@Api(tags = "云台控制") | |
| 20 | 25 | @CrossOrigin |
| 21 | 26 | @RestController |
| 22 | -@RequestMapping("/api") | |
| 27 | +@RequestMapping("/api/ptz") | |
| 23 | 28 | public class PtzController { |
| 24 | - | |
| 29 | + | |
| 25 | 30 | private final static Logger logger = LoggerFactory.getLogger(PtzController.class); |
| 26 | - | |
| 31 | + | |
| 27 | 32 | @Autowired |
| 28 | 33 | private SIPCommander cmder; |
| 29 | - | |
| 34 | + | |
| 30 | 35 | @Autowired |
| 31 | 36 | private IVideoManagerStorager storager; |
| 32 | 37 | |
| 33 | 38 | @Autowired |
| 34 | 39 | private DeferredResultHolder resultHolder; |
| 35 | - | |
| 40 | + | |
| 36 | 41 | /*** |
| 37 | 42 | * 云台控制 |
| 38 | 43 | * @param deviceId 设备id |
| ... | ... | @@ -43,49 +48,54 @@ public class PtzController { |
| 43 | 48 | * @param zoomSpeed 缩放速度 |
| 44 | 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 | 61 | public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed){ |
| 48 | - | |
| 62 | + | |
| 49 | 63 | if (logger.isDebugEnabled()) { |
| 50 | 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 | 66 | Device device = storager.queryVideoDevice(deviceId); |
| 53 | - | |
| 67 | + | |
| 54 | 68 | cmder.frontEndCmd(device, channelId, cmdCode, horizonSpeed, verticalSpeed, zoomSpeed); |
| 55 | 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 | 82 | public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){ |
| 71 | - | |
| 83 | + | |
| 72 | 84 | if (logger.isDebugEnabled()) { |
| 73 | 85 | logger.debug(String.format("设备云台控制 API调用,deviceId:%s ,channelId:%s ,cmdCode:%d parameter1:%d parameter2:%d",deviceId, channelId, cmdCode, parameter1, parameter2)); |
| 74 | 86 | } |
| 75 | 87 | Device device = storager.queryVideoDevice(deviceId); |
| 76 | - | |
| 88 | + | |
| 77 | 89 | cmder.frontEndCmd(device, channelId, cmdCode, parameter1, parameter2, combindCode2); |
| 78 | 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 | 99 | public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) { |
| 90 | 100 | if (logger.isDebugEnabled()) { |
| 91 | 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 | 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 | 8 | import org.slf4j.Logger; |
| 5 | 9 | import org.slf4j.LoggerFactory; |
| 6 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -18,29 +22,37 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 18 | 22 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 19 | 23 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 20 | 24 | |
| 25 | +@Api(tags = "国标录像") | |
| 21 | 26 | @CrossOrigin |
| 22 | 27 | @RestController |
| 23 | -@RequestMapping("/api") | |
| 28 | +@RequestMapping("/api/gb_record") | |
| 24 | 29 | public class RecordController { |
| 25 | - | |
| 30 | + | |
| 26 | 31 | private final static Logger logger = LoggerFactory.getLogger(RecordController.class); |
| 27 | - | |
| 32 | + | |
| 28 | 33 | @Autowired |
| 29 | 34 | private SIPCommander cmder; |
| 30 | - | |
| 35 | + | |
| 31 | 36 | @Autowired |
| 32 | 37 | private IVideoManagerStorager storager; |
| 33 | - | |
| 38 | + | |
| 34 | 39 | @Autowired |
| 35 | 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 | 50 | public DeferredResult<ResponseEntity<RecordInfo>> recordinfo(@PathVariable String deviceId,@PathVariable String channelId, String startTime, String endTime){ |
| 39 | - | |
| 51 | + | |
| 40 | 52 | if (logger.isDebugEnabled()) { |
| 41 | 53 | logger.debug(String.format("录像信息查询 API调用,deviceId:%s ,startTime:%s, startTime:%s",deviceId, startTime, endTime)); |
| 42 | 54 | } |
| 43 | - | |
| 55 | + | |
| 44 | 56 | Device device = storager.queryVideoDevice(deviceId); |
| 45 | 57 | cmder.recordInfoQuery(device, channelId, startTime, endTime); |
| 46 | 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 | 2 | |
| 3 | 3 | import com.genersoft.iot.vmp.VManageBootstrap; |
| 4 | 4 | import com.genersoft.iot.vmp.utils.SpringBeanFactory; |
| 5 | -import com.genersoft.iot.vmp.vmanager.gbStream.bean.GbStreamParam; | |
| 6 | 5 | import gov.nist.javax.sip.SipStackImpl; |
| 6 | +import io.swagger.annotations.Api; | |
| 7 | +import io.swagger.annotations.ApiOperation; | |
| 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | 9 | import org.springframework.context.ConfigurableApplicationContext; |
| 9 | 10 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -13,6 +14,7 @@ import javax.sip.ObjectInUseException; |
| 13 | 14 | import javax.sip.SipProvider; |
| 14 | 15 | import java.util.Iterator; |
| 15 | 16 | |
| 17 | +@Api(tags = "服务控制") | |
| 16 | 18 | @CrossOrigin |
| 17 | 19 | @RestController |
| 18 | 20 | @RequestMapping("/api/server") |
| ... | ... | @@ -22,6 +24,7 @@ public class ServerController { |
| 22 | 24 | private ConfigurableApplicationContext context; |
| 23 | 25 | |
| 24 | 26 | |
| 27 | + @ApiOperation("重启服务") | |
| 25 | 28 | @RequestMapping(value = "/restart") |
| 26 | 29 | @ResponseBody |
| 27 | 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 | 5 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 6 | 6 | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| 7 | 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 | 13 | import org.slf4j.Logger; |
| 9 | 14 | import org.slf4j.LoggerFactory; |
| 10 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -14,6 +19,7 @@ import org.springframework.web.bind.annotation.*; |
| 14 | 19 | /** |
| 15 | 20 | * 拉流代理接口 |
| 16 | 21 | */ |
| 22 | +@Api(tags = "拉流代理") | |
| 17 | 23 | @Controller |
| 18 | 24 | @CrossOrigin |
| 19 | 25 | @RequestMapping(value = "/api/proxy") |
| ... | ... | @@ -28,16 +34,27 @@ public class StreamProxyController { |
| 28 | 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 | 44 | @RequestMapping(value = "/list") |
| 32 | 45 | @ResponseBody |
| 33 | 46 | public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page, |
| 34 | 47 | @RequestParam(required = false)Integer count, |
| 35 | - @RequestParam(required = false)String q, | |
| 48 | + @RequestParam(required = false)String query, | |
| 36 | 49 | @RequestParam(required = false)Boolean online ){ |
| 37 | 50 | |
| 38 | 51 | return streamProxyService.getAll(page, count); |
| 39 | 52 | } |
| 40 | 53 | |
| 54 | + @ApiOperation("保存代理") | |
| 55 | + @ApiImplicitParams({ | |
| 56 | + @ApiImplicitParam(name = "param", value = "代理参数", dataTypeClass = StreamProxyItem.class), | |
| 57 | + }) | |
| 41 | 58 | @RequestMapping(value = "/save") |
| 42 | 59 | @ResponseBody |
| 43 | 60 | public Object save(@RequestBody StreamProxyItem param){ |
| ... | ... | @@ -46,6 +63,11 @@ public class StreamProxyController { |
| 46 | 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 | 71 | @RequestMapping(value = "/del") |
| 50 | 72 | @ResponseBody |
| 51 | 73 | public Object del(String app, String stream){ |
| ... | ... | @@ -54,6 +76,11 @@ public class StreamProxyController { |
| 54 | 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 | 84 | @RequestMapping(value = "/start") |
| 58 | 85 | @ResponseBody |
| 59 | 86 | public Object start(String app, String stream){ |
| ... | ... | @@ -62,6 +89,11 @@ public class StreamProxyController { |
| 62 | 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 | 97 | @RequestMapping(value = "/stop") |
| 66 | 98 | @ResponseBody |
| 67 | 99 | public Object stop(String app, String stream){ | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
| 1 | 1 | package com.genersoft.iot.vmp.vmanager.streamPush; |
| 2 | 2 | |
| 3 | -import com.alibaba.fastjson.JSONObject; | |
| 4 | 3 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 5 | -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | |
| 6 | 4 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| 7 | 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 | 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 | 11 | import org.slf4j.Logger; |
| 12 | 12 | import org.slf4j.LoggerFactory; |
| 13 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 14 | import org.springframework.stereotype.Controller; |
| 15 | 15 | import org.springframework.web.bind.annotation.*; |
| 16 | 16 | |
| 17 | +@Api(tags = "推流信息管理") | |
| 17 | 18 | @Controller |
| 18 | 19 | @CrossOrigin |
| 19 | 20 | @RequestMapping(value = "/api/push") |
| ... | ... | @@ -24,18 +25,29 @@ public class StreamPushController { |
| 24 | 25 | @Autowired |
| 25 | 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 | 35 | @RequestMapping(value = "/list") |
| 28 | 36 | @ResponseBody |
| 29 | 37 | public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, |
| 30 | 38 | @RequestParam(required = false)Integer count, |
| 31 | - @RequestParam(required = false)String q, | |
| 39 | + @RequestParam(required = false)String query, | |
| 32 | 40 | @RequestParam(required = false)Boolean online ){ |
| 33 | 41 | |
| 34 | 42 | PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page - 1, page - 1 + count); |
| 35 | 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 | 51 | @ResponseBody |
| 40 | 52 | public Object saveToGB(@RequestBody GbStream stream){ |
| 41 | 53 | if (streamPushService.saveToGB(stream)){ |
| ... | ... | @@ -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 | 66 | @ResponseBody |
| 50 | 67 | public Object removeFormGB(@RequestBody GbStream stream){ |
| 51 | 68 | if (streamPushService.removeFromGB(stream)){ | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
| 1 | 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 | 8 | import org.springframework.beans.factory.annotation.Value; |
| 4 | 9 | import org.springframework.util.StringUtils; |
| 5 | 10 | import org.springframework.web.bind.annotation.CrossOrigin; |
| 6 | 11 | import org.springframework.web.bind.annotation.RequestMapping; |
| 7 | 12 | import org.springframework.web.bind.annotation.RestController; |
| 8 | 13 | |
| 14 | +@Api(tags = "用户管理") | |
| 9 | 15 | @CrossOrigin |
| 10 | 16 | @RestController |
| 11 | -@RequestMapping("/api") | |
| 17 | +@RequestMapping("/api/user") | |
| 12 | 18 | public class UserController { |
| 13 | 19 | |
| 14 | 20 | @Value("${auth.username}") |
| ... | ... | @@ -17,7 +23,12 @@ public class UserController { |
| 17 | 23 | @Value("${auth.password}") |
| 18 | 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 | 32 | public String login(String username, String password){ |
| 22 | 33 | if (!StringUtils.isEmpty(username) && username.equals(usernameConfig) |
| 23 | 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 | 9 | // import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 10 | 10 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 11 | 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 | 13 | import org.slf4j.Logger; |
| 14 | 14 | import org.slf4j.LoggerFactory; |
| 15 | 15 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
web_src/index.html
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <title>国标28181</title> |
| 7 | 7 | </head> |
| 8 | 8 | <body> |
| 9 | - <!-- <script type="text/javascript" src="./js/EasyWasmPlayer.js"></script> --> | |
| 9 | + <script type="text/javascript" src="./js/EasyWasmPlayer.js"></script> | |
| 10 | 10 | <script type="text/javascript" src="/static/js/ZLMRTCClient.js"></script> |
| 11 | 11 | <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rk73w8dv1rkE4UdZsataG68VarhYQzrx&s=1"></script> |
| 12 | 12 | <div id="app"></div> | ... | ... |
web_src/src/components/PushVideoList.vue
| ... | ... | @@ -155,7 +155,7 @@ |
| 155 | 155 | }, |
| 156 | 156 | removeFromGB: function(row){ |
| 157 | 157 | var that = this; |
| 158 | - that.$axios.post(`/api/push/removeFormGB`, row) | |
| 158 | + that.$axios.post(`/api/push/remove_form_gb`, row) | |
| 159 | 159 | .then(function (res) { |
| 160 | 160 | console.log(res); |
| 161 | 161 | console.log(res.data == "success"); | ... | ... |
web_src/src/components/dialog/addStreamTOGB.vue
| ... | ... | @@ -90,7 +90,7 @@ export default { |
| 90 | 90 | console.log("onSubmit"); |
| 91 | 91 | var that = this; |
| 92 | 92 | that.$axios |
| 93 | - .post(`/api/push/saveToGB`, that.proxyParam) | |
| 93 | + .post(`/api/push/save_to_gb`, that.proxyParam) | |
| 94 | 94 | .then(function (res) { |
| 95 | 95 | console.log(res); |
| 96 | 96 | console.log(res.data == "success"); | ... | ... |
web_src/src/components/dialog/devicePlayer.vue
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | </div> |
| 27 | 27 | </el-tab-pane> |
| 28 | 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 | 30 | <el-date-picker size="mini" v-model="videoHistory.date" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="queryRecords()"></el-date-picker> |
| 31 | 31 | <el-table :data="videoHistory.searchHistoryResult" height="150" v-loading="recordsLoading"> |
| 32 | 32 | <el-table-column label="名称" prop="name"></el-table-column> |
| ... | ... | @@ -70,7 +70,7 @@ |
| 70 | 70 | <el-slider v-model="controSpeed" :max="255"></el-slider> |
| 71 | 71 | </div> |
| 72 | 72 | </div> |
| 73 | - | |
| 73 | + | |
| 74 | 74 | <div class="control-panel"> |
| 75 | 75 | <el-button-group> |
| 76 | 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 | 136 | </template> |
| 137 | 137 | |
| 138 | 138 | <script> |
| 139 | -import player from '../dialog/rtcPlayer.vue' | |
| 139 | +// import player from '../dialog/rtcPlayer.vue' | |
| 140 | +import player from '../dialog/easyPlayer.vue' | |
| 140 | 141 | export default { |
| 141 | 142 | name: 'devicePlayer', |
| 142 | 143 | props: {}, |
| ... | ... | @@ -250,7 +251,8 @@ export default { |
| 250 | 251 | |
| 251 | 252 | this.hasaudio = hasAudio; |
| 252 | 253 | this.isLoging = false; |
| 253 | - this.videoUrl = streamInfo.rtc; | |
| 254 | + // this.videoUrl = streamInfo.rtc; | |
| 255 | + this.videoUrl = streamInfo.ws_flv; | |
| 254 | 256 | this.streamId = streamInfo.streamId; |
| 255 | 257 | this.app = streamInfo.app; |
| 256 | 258 | this.playFromStreamInfo(false, streamInfo) |
| ... | ... | @@ -369,7 +371,7 @@ export default { |
| 369 | 371 | var endTime = this.videoHistory.date + " 23:59:59"; |
| 370 | 372 | this.$axios({ |
| 371 | 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 | 375 | }).then(function (res) { |
| 374 | 376 | // 处理时间信息 |
| 375 | 377 | that.videoHistory.searchHistoryResult = res.data.recordList; |
| ... | ... | @@ -420,7 +422,7 @@ export default { |
| 420 | 422 | method: 'post', |
| 421 | 423 | // url: '/api/ptz/' + this.deviceId + '/' + this.channelId + '?leftRight=' + leftRight + '&upDown=' + upDown + |
| 422 | 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 | 426 | }).then(function (res) {}); |
| 425 | 427 | }, |
| 426 | 428 | //////////////////////播放器事件处理////////////////////////// |
| ... | ... | @@ -432,7 +434,7 @@ export default { |
| 432 | 434 | let that = this; |
| 433 | 435 | this.$axios({ |
| 434 | 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 | 438 | }).then(function (res) {}); |
| 437 | 439 | }, |
| 438 | 440 | setSpeedOrTime: function (cmdCode, groupNum, parameter) { |
| ... | ... | @@ -442,7 +444,7 @@ export default { |
| 442 | 444 | console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16)); |
| 443 | 445 | this.$axios({ |
| 444 | 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 | 448 | }).then(function (res) {}); |
| 447 | 449 | }, |
| 448 | 450 | setCommand: function (cmdCode, groupNum, parameter) { |
| ... | ... | @@ -450,7 +452,7 @@ export default { |
| 450 | 452 | console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0'); |
| 451 | 453 | this.$axios({ |
| 452 | 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 | 456 | }).then(function (res) {}); |
| 455 | 457 | }, |
| 456 | 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 | 0 | \ No newline at end of file |