Commit b4e7ed0bf777541ea2196775d08be3d79db6f87f
1 parent
019827fd
修复兼容接口云台控制
Showing
1 changed file
with
7 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java
| ... | ... | @@ -41,10 +41,15 @@ public class ApiControlController { |
| 41 | 41 | @RequestParam(required = false)Integer speed){ |
| 42 | 42 | |
| 43 | 43 | if (logger.isDebugEnabled()) { |
| 44 | - logger.debug(String.format("模拟接口> 设备云台控制 API调用,deviceId:%s ,channelId:%s ,command:%d ,speed:%d ", | |
| 45 | - serial, code, command, speed)); | |
| 44 | + logger.debug("模拟接口> 设备云台控制 API调用,deviceId:{} ,channelId:{} ,command:{} ,speed:{} ", | |
| 45 | + serial, code, command, speed); | |
| 46 | 46 | } |
| 47 | 47 | Device device = storager.queryVideoDevice(serial); |
| 48 | + if (device == null) { | |
| 49 | + JSONObject result = new JSONObject(); | |
| 50 | + result.put("error","device[ " + serial + " ]未找到"); | |
| 51 | + return result; | |
| 52 | + } | |
| 48 | 53 | int cmdCode = 0; |
| 49 | 54 | switch (command){ |
| 50 | 55 | case "left": | ... | ... |