优化代码结构,提供NVR录像检索接口

This commit is contained in:
songww
2020-05-08 21:57:07 +08:00
parent ab45f1a13f
commit bf7ab3fe2b
18 changed files with 871 additions and 237 deletions

View File

@@ -10,7 +10,9 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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;
@RestController
@RequestMapping("/api")
@@ -21,10 +23,14 @@ public class PlayController {
@Autowired
private SIPCommander cmder;
@Autowired
private IVideoManagerStorager storager;
@GetMapping("/play/{deviceId}_{channelId}")
public ResponseEntity<String> play(@PathVariable String deviceId,@PathVariable String channelId){
String ssrc = cmder.playStreamCmd(deviceId, channelId);
Device device = storager.queryVideoDevice(deviceId);
String ssrc = cmder.playStreamCmd(device, channelId);
if (logger.isDebugEnabled()) {
logger.debug(String.format("设备预览 API调用deviceId%s channelId%s",deviceId, channelId));