Commit 470be2dc3620351b46108e0ee116dccd8a2d73c3
1 parent
72e91f69
修复开始点播功能接口调用返回参数与定义的不符 #635
Showing
4 changed files
with
41 additions
and
6 deletions
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
| 1 | package com.genersoft.iot.vmp.common; | 1 | package com.genersoft.iot.vmp.common; |
| 2 | 2 | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 3 | 4 | ||
| 5 | +@Schema(description = "流信息") | ||
| 4 | public class StreamInfo { | 6 | public class StreamInfo { |
| 5 | 7 | ||
| 8 | + @Schema(description = "应用名") | ||
| 6 | private String app; | 9 | private String app; |
| 10 | + @Schema(description = "流ID") | ||
| 7 | private String stream; | 11 | private String stream; |
| 12 | + @Schema(description = "设备编号") | ||
| 8 | private String deviceID; | 13 | private String deviceID; |
| 14 | + @Schema(description = "通道编号") | ||
| 9 | private String channelId; | 15 | private String channelId; |
| 16 | + @Schema(description = "HTTP-FLV流地址") | ||
| 10 | private String flv; | 17 | private String flv; |
| 11 | 18 | ||
| 19 | + @Schema(description = "IP") | ||
| 12 | private String ip; | 20 | private String ip; |
| 13 | - | 21 | + @Schema(description = "HTTPS-FLV流地址") |
| 14 | private String https_flv; | 22 | private String https_flv; |
| 23 | + @Schema(description = "Websocket-FLV流地址") | ||
| 15 | private String ws_flv; | 24 | private String ws_flv; |
| 25 | + @Schema(description = "Websockets-FLV流地址") | ||
| 16 | private String wss_flv; | 26 | private String wss_flv; |
| 27 | + @Schema(description = "HTTP-FMP4流地址") | ||
| 17 | private String fmp4; | 28 | private String fmp4; |
| 29 | + @Schema(description = "HTTPS-FMP4流地址") | ||
| 18 | private String https_fmp4; | 30 | private String https_fmp4; |
| 31 | + @Schema(description = "Websocket-FMP4流地址") | ||
| 19 | private String ws_fmp4; | 32 | private String ws_fmp4; |
| 33 | + @Schema(description = "Websockets-FMP4流地址") | ||
| 20 | private String wss_fmp4; | 34 | private String wss_fmp4; |
| 35 | + @Schema(description = "HLS流地址") | ||
| 21 | private String hls; | 36 | private String hls; |
| 37 | + @Schema(description = "HTTPS-HLS流地址") | ||
| 22 | private String https_hls; | 38 | private String https_hls; |
| 39 | + @Schema(description = "Websocket-HLS流地址") | ||
| 23 | private String ws_hls; | 40 | private String ws_hls; |
| 41 | + @Schema(description = "Websockets-HLS流地址") | ||
| 24 | private String wss_hls; | 42 | private String wss_hls; |
| 43 | + @Schema(description = "HTTP-TS流地址") | ||
| 25 | private String ts; | 44 | private String ts; |
| 45 | + @Schema(description = "HTTPS-TS流地址") | ||
| 26 | private String https_ts; | 46 | private String https_ts; |
| 47 | + @Schema(description = "Websocket-TS流地址") | ||
| 27 | private String ws_ts; | 48 | private String ws_ts; |
| 49 | + @Schema(description = "Websockets-TS流地址") | ||
| 28 | private String wss_ts; | 50 | private String wss_ts; |
| 51 | + @Schema(description = "RTMP流地址") | ||
| 29 | private String rtmp; | 52 | private String rtmp; |
| 53 | + @Schema(description = "RTMPS流地址") | ||
| 30 | private String rtmps; | 54 | private String rtmps; |
| 55 | + @Schema(description = "RTSP流地址") | ||
| 31 | private String rtsp; | 56 | private String rtsp; |
| 57 | + @Schema(description = "RTSPS流地址") | ||
| 32 | private String rtsps; | 58 | private String rtsps; |
| 59 | + @Schema(description = "RTC流地址") | ||
| 33 | private String rtc; | 60 | private String rtc; |
| 34 | 61 | ||
| 62 | + @Schema(description = "RTCS流地址") | ||
| 35 | private String rtcs; | 63 | private String rtcs; |
| 64 | + @Schema(description = "流媒体ID") | ||
| 36 | private String mediaServerId; | 65 | private String mediaServerId; |
| 66 | + @Schema(description = "流编码信息") | ||
| 37 | private Object tracks; | 67 | private Object tracks; |
| 68 | + @Schema(description = "开始时间") | ||
| 38 | private String startTime; | 69 | private String startTime; |
| 70 | + @Schema(description = "结束时间") | ||
| 39 | private String endTime; | 71 | private String endTime; |
| 72 | + @Schema(description = "进度(录像下载使用)") | ||
| 40 | private double progress; | 73 | private double progress; |
| 41 | 74 | ||
| 75 | + @Schema(description = "是否暂停(录像回放使用)") | ||
| 42 | private boolean pause; | 76 | private boolean pause; |
| 43 | 77 | ||
| 44 | public static class TransactionInfo{ | 78 | public static class TransactionInfo{ |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| @@ -129,7 +129,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -129,7 +129,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 129 | String uuid = UUID.randomUUID().toString(); | 129 | String uuid = UUID.randomUUID().toString(); |
| 130 | msg.setId(uuid); | 130 | msg.setId(uuid); |
| 131 | playResult.setUuid(uuid); | 131 | playResult.setUuid(uuid); |
| 132 | - DeferredResult<WVPResult<String>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue()); | 132 | + DeferredResult<WVPResult<StreamInfo>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue()); |
| 133 | playResult.setResult(result); | 133 | playResult.setResult(result); |
| 134 | // 录像查询以channelId作为deviceId查询 | 134 | // 录像查询以channelId作为deviceId查询 |
| 135 | resultHolder.put(key, uuid, result); | 135 | resultHolder.put(key, uuid, result); |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
| @@ -82,7 +82,7 @@ public class PlayController { | @@ -82,7 +82,7 @@ public class PlayController { | ||
| 82 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 82 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 83 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 83 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 84 | @GetMapping("/start/{deviceId}/{channelId}") | 84 | @GetMapping("/start/{deviceId}/{channelId}") |
| 85 | - public DeferredResult<WVPResult<String>> play(@PathVariable String deviceId, | 85 | + public DeferredResult<WVPResult<StreamInfo>> play(@PathVariable String deviceId, |
| 86 | @PathVariable String channelId) { | 86 | @PathVariable String channelId) { |
| 87 | 87 | ||
| 88 | // 获取可用的zlm | 88 | // 获取可用的zlm |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/bean/PlayResult.java
| 1 | package com.genersoft.iot.vmp.vmanager.gb28181.play.bean; | 1 | package com.genersoft.iot.vmp.vmanager.gb28181.play.bean; |
| 2 | 2 | ||
| 3 | +import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 4 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 4 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 5 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 5 | import org.springframework.http.ResponseEntity; | 6 | import org.springframework.http.ResponseEntity; |
| @@ -7,16 +8,16 @@ import org.springframework.web.context.request.async.DeferredResult; | @@ -7,16 +8,16 @@ import org.springframework.web.context.request.async.DeferredResult; | ||
| 7 | 8 | ||
| 8 | public class PlayResult { | 9 | public class PlayResult { |
| 9 | 10 | ||
| 10 | - private DeferredResult<WVPResult<String>> result; | 11 | + private DeferredResult<WVPResult<StreamInfo>> result; |
| 11 | private String uuid; | 12 | private String uuid; |
| 12 | 13 | ||
| 13 | private Device device; | 14 | private Device device; |
| 14 | 15 | ||
| 15 | - public DeferredResult<WVPResult<String>> getResult() { | 16 | + public DeferredResult<WVPResult<StreamInfo>> getResult() { |
| 16 | return result; | 17 | return result; |
| 17 | } | 18 | } |
| 18 | 19 | ||
| 19 | - public void setResult(DeferredResult<WVPResult<String>> result) { | 20 | + public void setResult(DeferredResult<WVPResult<StreamInfo>> result) { |
| 20 | this.result = result; | 21 | this.result = result; |
| 21 | } | 22 | } |
| 22 | 23 |