|  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.bean.Device; | 
|---|
|  |  |  | 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 org.slf4j.Logger; | 
|---|
|  |  |  | import org.slf4j.LoggerFactory; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | 
|---|
|  |  |  | private SIPCommander cmder; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IVideoManagerStorager storager; | 
|---|
|  |  |  | private IVideoManagerStorage storager; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 设备控制 - 云台控制 | 
|---|
|  |  |  | 
|---|
|  |  |  | @RequestParam(required = false)Integer speed){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (logger.isDebugEnabled()) { | 
|---|
|  |  |  | logger.debug(String.format("模拟接口> 设备云台控制 API调用,deviceId:%s ,channelId:%s ,command:%d ,speed:%d ", | 
|---|
|  |  |  | serial, code, command, speed)); | 
|---|
|  |  |  | logger.debug("模拟接口> 设备云台控制 API调用,deviceId:{} ,channelId:{} ,command:{} ,speed:{} ", | 
|---|
|  |  |  | serial, code, command, speed); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (channel == null) {channel = 0;} | 
|---|
|  |  |  | if (speed == null) {speed = 0;} | 
|---|
|  |  |  | Device device = storager.queryVideoDevice(serial); | 
|---|
|  |  |  | if (device == null) { | 
|---|
|  |  |  | JSONObject result = new JSONObject(); | 
|---|
|  |  |  | result.put("error","device[ " + serial + " ]未找到"); | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int cmdCode = 0; | 
|---|
|  |  |  | switch (command){ | 
|---|
|  |  |  | case "left": | 
|---|