From 117387be8f9590b651da544c2e4a52ecb351aca4 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 19 八月 2022 17:22:08 +0800 Subject: [PATCH] 更新在线文档的等新方式 --- src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java | 61 ++++++++++++++---------------- 1 files changed, 28 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java index 255329b..489396b 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java @@ -1,9 +1,9 @@ package com.genersoft.iot.vmp.vmanager.gb28181.ptz; -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; @@ -13,17 +13,15 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.DeferredResult; -import javax.sip.message.Response; - import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; +import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import java.util.UUID; -@Api(tags = "浜戝彴鎺у埗") +@Tag(name = "浜戝彴鎺у埗") @CrossOrigin @RestController @RequestMapping("/api/ptz") @@ -35,7 +33,7 @@ private SIPCommander cmder; @Autowired - private IVideoManagerStorager storager; + private IVideoManagerStorage storager; @Autowired private DeferredResultHolder resultHolder; @@ -50,15 +48,14 @@ * @param zoomSpeed 缂╂斁閫熷害 * @return String 鎺у埗缁撴灉 */ - @ApiOperation("浜戝彴鎺у埗") - @ApiImplicitParams({ - @ApiImplicitParam(name = "deviceId", value = "璁惧ID", dataTypeClass = String.class), - @ApiImplicitParam(name = "channelId", value = "閫氶亾ID", dataTypeClass = String.class), - @ApiImplicitParam(name = "command", value = "鎺у埗鎸囦护,鍏佽鍊�: left, right, up, down, upleft, upright, downleft, downright, zoomin, zoomout, stop", dataTypeClass = Integer.class), - @ApiImplicitParam(name = "horizonSpeed", value = "姘村钩閫熷害", dataTypeClass = Integer.class), - @ApiImplicitParam(name = "verticalSpeed", value = "鍨傜洿閫熷害", dataTypeClass = Integer.class), - @ApiImplicitParam(name = "zoomSpeed", value = "缂╂斁閫熷害", dataTypeClass = Integer.class), - }) + + @Operation(summary = "浜戝彴鎺у埗") + @Parameter(name = "deviceId", description = "璁惧鍥芥爣缂栧彿", required = true) + @Parameter(name = "channelId", description = "閫氶亾鍥芥爣缂栧彿", required = true) + @Parameter(name = "command", description = "鎺у埗鎸囦护,鍏佽鍊�: left, right, up, down, upleft, upright, downleft, downright, zoomin, zoomout, stop", required = true) + @Parameter(name = "horizonSpeed", description = "姘村钩閫熷害", required = true) + @Parameter(name = "verticalSpeed", description = "鍨傜洿閫熷害", required = true) + @Parameter(name = "zoomSpeed", description = "缂╂斁閫熷害", required = true) @PostMapping("/control/{deviceId}/{channelId}") public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId, String command, int horizonSpeed, int verticalSpeed, int zoomSpeed){ @@ -108,15 +105,14 @@ return new ResponseEntity<String>("success",HttpStatus.OK); } - @ApiOperation("閫氱敤鍓嶇鎺у埗鍛戒护") - @ApiImplicitParams({ - @ApiImplicitParam(name = "deviceId", value = "璁惧ID", dataTypeClass = String.class), - @ApiImplicitParam(name = "channelId", value = "閫氶亾ID", dataTypeClass = String.class), - @ApiImplicitParam(name = "cmdCode", value = "鎸囦护鐮�", dataTypeClass = Integer.class), - @ApiImplicitParam(name = "parameter1", value = "鏁版嵁涓�", dataTypeClass = Integer.class), - @ApiImplicitParam(name = "parameter2", value = "鏁版嵁浜�", dataTypeClass = Integer.class), - @ApiImplicitParam(name = "combindCode2", value = "缁勫悎鐮佷簩", dataTypeClass = Integer.class), - }) + + @Operation(summary = "閫氱敤鍓嶇鎺у埗鍛戒护") + @Parameter(name = "deviceId", description = "璁惧鍥芥爣缂栧彿", required = true) + @Parameter(name = "channelId", description = "閫氶亾鍥芥爣缂栧彿", required = true) + @Parameter(name = "cmdCode", description = "鎸囦护鐮�", required = true) + @Parameter(name = "parameter1", description = "鏁版嵁涓�", required = true) + @Parameter(name = "parameter2", description = "鏁版嵁浜�", required = true) + @Parameter(name = "combindCode2", description = "缁勫悎鐮佷簩", required = true) @PostMapping("/front_end_command/{deviceId}/{channelId}") public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){ @@ -129,11 +125,10 @@ return new ResponseEntity<String>("success",HttpStatus.OK); } - @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("/preset/query/{deviceId}/{channelId}") public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) { if (logger.isDebugEnabled()) { @@ -152,10 +147,10 @@ msg.setData("鑾峰彇璁惧棰勭疆浣嶈秴鏃�"); resultHolder.invokeResult(msg); }); - resultHolder.put(key, uuid, result); if (resultHolder.exist(key, null)) { return result; } + resultHolder.put(key, uuid, result); cmder.presetQuery(device, channelId, event -> { RequestMessage msg = new RequestMessage(); msg.setId(uuid); -- Gitblit v1.8.0