From 4ee8924bd9dbd36046d922d9480de310ee16b6ac Mon Sep 17 00:00:00 2001 From: zx <zuoxue@qq.com> Date: 星期五, 19 八月 2022 21:55:59 +0800 Subject: [PATCH] fix PlatformKeepaliveExpireEvent typo --- src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java | 52 +++++++++++++++++++++++----------------------------- 1 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java index 20ffc00..233e1de 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java @@ -15,10 +15,10 @@ import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult; import com.genersoft.iot.vmp.service.IMediaService; import com.genersoft.iot.vmp.service.IPlayService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -39,7 +39,7 @@ import java.util.List; import java.util.UUID; -@Api(tags = "鍥芥爣璁惧鐐规挱") +@Tag(name = "鍥芥爣璁惧鐐规挱") @CrossOrigin @RestController @RequestMapping("/api/play") @@ -74,11 +74,9 @@ @Autowired private IMediaServerService mediaServerService; - @ApiOperation("寮�濮嬬偣鎾�") - @ApiImplicitParams({ - @ApiImplicitParam(name = "deviceId", value = "璁惧ID", dataTypeClass = String.class), - @ApiImplicitParam(name = "channelId", value = "閫氶亾ID", dataTypeClass = String.class), - }) + @Operation(summary = "寮�濮嬬偣鎾�") + @Parameter(name = "deviceId", description = "璁惧鍥芥爣缂栧彿", required = true) + @Parameter(name = "channelId", description = "閫氶亾鍥芥爣缂栧彿", required = true) @GetMapping("/start/{deviceId}/{channelId}") public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId) { @@ -91,11 +89,10 @@ return playResult.getResult(); } - @ApiOperation("鍋滄鐐规挱") - @ApiImplicitParams({ - @ApiImplicitParam(name = "deviceId", value = "璁惧ID", dataTypeClass = String.class), - @ApiImplicitParam(name = "channelId", value = "閫氶亾ID", dataTypeClass = String.class), - }) + + @Operation(summary = "鍋滄鐐规挱") + @Parameter(name = "deviceId", description = "璁惧鍥芥爣缂栧彿", required = true) + @Parameter(name = "channelId", description = "閫氶亾鍥芥爣缂栧彿", required = true) @GetMapping("/stop/{deviceId}/{channelId}") public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String deviceId, @PathVariable String channelId) { @@ -148,6 +145,8 @@ // 瓒呮椂澶勭悊 result.onTimeout(()->{ logger.warn(String.format("璁惧棰勮/鍥炴斁鍋滄瓒呮椂锛宒eviceId/channelId锛�%s_%s ", deviceId, channelId)); + redisCatchStorage.stopPlay(streamInfo); + storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); RequestMessage msg = new RequestMessage(); msg.setId(uuid); msg.setKey(key); @@ -162,10 +161,8 @@ * @param streamId 娴両D * @return */ - @ApiOperation("灏嗕笉鏄痟264鐨勮棰戦�氳繃ffmpeg 杞爜涓篽264 + aac") - @ApiImplicitParams({ - @ApiImplicitParam(name = "streamId", value = "瑙嗛娴両D", dataTypeClass = String.class), - }) + @Operation(summary = "灏嗕笉鏄痟264鐨勮棰戦�氳繃ffmpeg 杞爜涓篽264 + aac") + @Parameter(name = "streamId", description = "瑙嗛娴両D", required = true) @PostMapping("/convert/{streamId}") public ResponseEntity<String> playConvert(@PathVariable String streamId) { StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); @@ -193,7 +190,7 @@ JSONObject data = jsonObject.getJSONObject("data"); if (data != null) { result.put("key", data.getString("key")); - StreamInfo streamInfoResult = mediaService.getStreamInfoByAppAndStreamWithCheck("convert", streamId, mediaInfo.getId()); + StreamInfo streamInfoResult = mediaService.getStreamInfoByAppAndStreamWithCheck("convert", streamId, mediaInfo.getId(), false); result.put("data", streamInfoResult); } }else { @@ -209,10 +206,9 @@ * @param key * @return */ - @ApiOperation("缁撴潫杞爜") - @ApiImplicitParams({ - @ApiImplicitParam(name = "key", value = "瑙嗛娴乲ey", dataTypeClass = String.class), - }) + @Operation(summary = "缁撴潫杞爜") + @Parameter(name = "key", description = "瑙嗛娴乲ey", required = true) + @Parameter(name = "mediaServerId", description = "娴佸獟浣撴湇鍔D", required = true) @PostMapping("/convertStop/{key}") public ResponseEntity<String> playConvertStop(@PathVariable String key, String mediaServerId) { JSONObject result = new JSONObject(); @@ -248,10 +244,8 @@ } - @ApiOperation("璇煶骞挎挱鍛戒护") - @ApiImplicitParams({ - @ApiImplicitParam(name = "deviceId", value = "璁惧Id", dataTypeClass = String.class), - }) + @Operation(summary = "璇煶骞挎挱鍛戒护") + @Parameter(name = "deviceId", description = "璁惧鍥芥爣缂栧彿", required = true) @GetMapping("/broadcast/{deviceId}") @PostMapping("/broadcast/{deviceId}") public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) { @@ -311,7 +305,7 @@ return result; } - @ApiOperation("鑾峰彇鎵�鏈夌殑ssrc") + @Operation(summary = "鑾峰彇鎵�鏈夌殑ssrc") @GetMapping("/ssrc") public WVPResult<JSONObject> getSSRC() { if (logger.isDebugEnabled()) { -- Gitblit v1.8.0