File was renamed from src/main/java/com/genersoft/iot/vmp/vmanager/ptz/PtzController.java |
| | |
| | | package com.genersoft.iot.vmp.vmanager.ptz; |
| | | 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 org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; |
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| | | |
| | | @Api(tags = "云台控制") |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("/api") |
| | | @RequestMapping("/api/ptz") |
| | | public class PtzController { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(PtzController.class); |
| | |
| | | * @param zoomSpeed 缩放速度 |
| | | * @return String 控制结果 |
| | | */ |
| | | @PostMapping("/ptz/{deviceId}/{channelId}") |
| | | @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 = "horizonSpeed", value = "水平速度", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "verticalSpeed", value = "垂直速度", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "zoomSpeed", value = "缩放速度", dataTypeClass = Integer.class), |
| | | }) |
| | | @PostMapping("/control/{deviceId}/{channelId}") |
| | | public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed){ |
| | | |
| | | if (logger.isDebugEnabled()) { |
| | |
| | | return new ResponseEntity<String>("success",HttpStatus.OK); |
| | | } |
| | | |
| | | /** |
| | | * 通用前端控制命令API接口 |
| | | * |
| | | * @param deviceId |
| | | * @param channelId |
| | | * @param cmdCode |
| | | * @param parameter1 |
| | | * @param parameter2 |
| | | * @param combindCode2 |
| | | * @return |
| | | */ |
| | | @PostMapping("/frontEndCommand/{deviceId}/{channelId}") |
| | | @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), |
| | | }) |
| | | @PostMapping("/front_end_command/{deviceId}/{channelId}") |
| | | public ResponseEntity<String> frontEndCommand(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int parameter1, int parameter2, int combindCode2){ |
| | | |
| | | if (logger.isDebugEnabled()) { |
| | |
| | | return new ResponseEntity<String>("success",HttpStatus.OK); |
| | | } |
| | | |
| | | /** |
| | | * 预置位查询命令API接口 |
| | | * |
| | | * @param deviceId |
| | | * @param channelId |
| | | * @return |
| | | */ |
| | | @GetMapping("/presetQuery/{deviceId}/{channelId}") |
| | | @ApiOperation("预置位查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), |
| | | }) |
| | | @GetMapping("/preset/query/{deviceId}/{channelId}") |
| | | public DeferredResult<ResponseEntity<String>> presetQueryApi(@PathVariable String deviceId, @PathVariable String channelId) { |
| | | if (logger.isDebugEnabled()) { |
| | | logger.debug("设备预置位查询API调用"); |