From ecf4fbb68445cf412d5e946f67f92c9928df8273 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 22 八月 2022 16:53:16 +0800 Subject: [PATCH] Merge branch 'wvp-28181-2.0' --- src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java | 72 +++++++++++++---------------------- 1 files changed, 27 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index c978ae6..d8a87d7 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -20,10 +20,10 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto; import com.genersoft.iot.vmp.vmanager.bean.WVPResult; import com.github.pagehelper.PageInfo; -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.apache.poi.sl.usermodel.Sheet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,6 +31,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.DeferredResult; @@ -44,7 +45,7 @@ import java.util.Map; import java.util.UUID; -@Api(tags = "鎺ㄦ祦淇℃伅绠$悊") +@Tag(name = "鎺ㄦ祦淇℃伅绠$悊") @Controller @CrossOrigin @RequestMapping(value = "/api/push") @@ -67,38 +68,33 @@ @Autowired private UserSetting userSetting; - @ApiOperation("鎺ㄦ祦鍒楄〃鏌ヨ") - @ApiImplicitParams({ - @ApiImplicitParam(name="page", value = "褰撳墠椤�", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name="count", value = "姣忛〉鏌ヨ鏁伴噺", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name="query", value = "鏌ヨ鍐呭", dataTypeClass = String.class), - @ApiImplicitParam(name="pushing", value = "鏄惁姝e湪鎺ㄦ祦", dataTypeClass = Boolean.class), - @ApiImplicitParam(name="mediaServerId", value = "娴佸獟浣揑D", dataTypeClass = String.class), - }) @GetMapping(value = "/list") @ResponseBody + @Operation(summary = "鎺ㄦ祦鍒楄〃鏌ヨ") + @Parameter(name = "page", description = "褰撳墠椤�") + @Parameter(name = "count", description = "姣忛〉鏌ヨ鏁伴噺") + @Parameter(name = "query", description = "鏌ヨ鍐呭") + @Parameter(name = "pushing", description = "鏄惁姝e湪鎺ㄦ祦") + @Parameter(name = "mediaServerId", description = "娴佸獟浣揑D") public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, @RequestParam(required = false)Integer count, @RequestParam(required = false)String query, @RequestParam(required = false)Boolean pushing, @RequestParam(required = false)String mediaServerId ){ - if (StringUtils.isEmpty(query)) { + if (ObjectUtils.isEmpty(query)) { query = null; } - if (StringUtils.isEmpty(mediaServerId)) { + if (ObjectUtils.isEmpty(mediaServerId)) { mediaServerId = null; } PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page, count, query, pushing, mediaServerId); return pushList; } - @ApiOperation("灏嗘帹娴佹坊鍔犲埌鍥芥爣") - @ApiImplicitParams({ - @ApiImplicitParam(name = "stream", value = "鐩存挱娴佸叧鑱斿浗鏍囧钩鍙�", dataTypeClass = GbStream.class), - }) @PostMapping(value = "/save_to_gb") @ResponseBody + @Operation(summary = "灏嗘帹娴佹坊鍔犲埌鍥芥爣") public Object saveToGB(@RequestBody GbStream stream){ if (streamPushService.saveToGB(stream)){ return "success"; @@ -108,12 +104,9 @@ } - @ApiOperation("灏嗘帹娴佺Щ鍑哄埌鍥芥爣") - @ApiImplicitParams({ - @ApiImplicitParam(name = "stream", value = "鐩存挱娴佸叧鑱斿浗鏍囧钩鍙�", dataTypeClass = GbStream.class), - }) @DeleteMapping(value = "/remove_form_gb") @ResponseBody + @Operation(summary = "灏嗘帹娴佺Щ鍑哄埌鍥芥爣") public Object removeFormGB(@RequestBody GbStream stream){ if (streamPushService.removeFromGB(stream)){ return "success"; @@ -123,13 +116,11 @@ } - @ApiOperation("涓涓�涓帹娴�") - @ApiImplicitParams({ - @ApiImplicitParam(name = "app", value = "搴旂敤鍚�", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "streamId", value = "娴両D", required = true, dataTypeClass = String.class), - }) @PostMapping(value = "/stop") @ResponseBody + @Operation(summary = "涓涓�涓帹娴�") + @Parameter(name = "app", description = "搴旂敤鍚�", required = true) + @Parameter(name = "stream", description = "娴乮d", required = true) public Object stop(String app, String streamId){ if (streamPushService.stop(app, streamId)){ return "success"; @@ -138,13 +129,9 @@ } } - @ApiOperation("涓澶氫釜鎺ㄦ祦") - @ApiImplicitParams({ - @ApiImplicitParam(name = "app", value = "搴旂敤鍚�", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "streamId", value = "娴両D", required = true, dataTypeClass = String.class), - }) @DeleteMapping(value = "/batchStop") @ResponseBody + @Operation(summary = "涓澶氫釜鎺ㄦ祦") public Object batchStop(@RequestBody BatchGBStreamParam batchGBStreamParam){ if (batchGBStreamParam.getGbStreams().size() == 0) { return "fail"; @@ -256,14 +243,12 @@ * @param stream 娴乮d * @return */ - @ApiOperation("鑾峰彇鎺ㄦ祦鎾斁鍦板潃") - @ApiImplicitParams({ - @ApiImplicitParam(name = "app", value = "搴旂敤鍚�", dataTypeClass = String.class), - @ApiImplicitParam(name = "stream", value = "娴乮d", dataTypeClass = String.class), - @ApiImplicitParam(name = "mediaServerId", value = "濯掍綋鏈嶅姟鍣╥d", dataTypeClass = String.class, required = false), - }) @GetMapping(value = "/getPlayUrl") @ResponseBody + @Operation(summary = "鑾峰彇鎺ㄦ祦鎾斁鍦板潃") + @Parameter(name = "app", description = "搴旂敤鍚�", required = true) + @Parameter(name = "stream", description = "娴乮d", required = true) + @Parameter(name = "mediaServerId", description = "濯掍綋鏈嶅姟鍣╥d") public WVPResult<StreamInfo> getPlayUrl(@RequestParam String app,@RequestParam String stream, @RequestParam(required = false) String mediaServerId){ boolean authority = false; @@ -297,18 +282,15 @@ * @param stream 鎺ㄦ祦淇℃伅 * @return */ - @ApiOperation("鑾峰彇鎺ㄦ祦鎾斁鍦板潃") - @ApiImplicitParams({ - @ApiImplicitParam(name = "stream", value = "鎺ㄦ祦淇℃伅", dataTypeClass = StreamPushItem.class), - }) @PostMapping(value = "/add") @ResponseBody + @Operation(summary = "鍋滄瑙嗛鍥炴斁") public WVPResult<StreamInfo> add(@RequestBody StreamPushItem stream){ - if (StringUtils.isEmpty(stream.getGbId())) { + if (ObjectUtils.isEmpty(stream.getGbId())) { return new WVPResult<>(400, "鍥芥爣ID涓嶅彲涓虹┖", null); } - if (StringUtils.isEmpty(stream.getApp()) && StringUtils.isEmpty(stream.getStream())) { + if (ObjectUtils.isEmpty(stream.getApp()) && ObjectUtils.isEmpty(stream.getStream())) { return new WVPResult<>(400, "app鎴杝tream涓嶅彲涓虹┖", null); } stream.setStatus(false); -- Gitblit v1.8.0