xujunwei hace 1 año
padre
commit
00185482a7

+ 14 - 0
src/main/java/com/genersoft/iot/vmp/extend/controller/ExtendDeviceController.java

@@ -5,10 +5,15 @@ import com.genersoft.iot.vmp.extend.entity.ExtendDevice;
 import com.genersoft.iot.vmp.extend.entity.ExtendDeviceChannel;
 import com.genersoft.iot.vmp.extend.entity.ExtendDeviceChannel;
 import com.genersoft.iot.vmp.extend.service.ExtendDeviceChannelService;
 import com.genersoft.iot.vmp.extend.service.ExtendDeviceChannelService;
 import com.genersoft.iot.vmp.extend.service.ExtendDeviceService;
 import com.genersoft.iot.vmp.extend.service.ExtendDeviceService;
+import com.genersoft.iot.vmp.vmanager.bean.StreamContent;
+import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
+import com.genersoft.iot.vmp.vmanager.gb28181.play.PlayController;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.async.DeferredResult;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 import java.util.List;
 
 
 @RestController
 @RestController
@@ -21,6 +26,9 @@ public class ExtendDeviceController {
     @Resource
     @Resource
     private ExtendDeviceChannelService deviceChannelService;
     private ExtendDeviceChannelService deviceChannelService;
 
 
+    @Resource
+    private PlayController playController;
+
     @PostMapping("/page")
     @PostMapping("/page")
     public PageInfo<ExtendDevice> page(@RequestBody ExtendDevicePageDto dto) {
     public PageInfo<ExtendDevice> page(@RequestBody ExtendDevicePageDto dto) {
         if (dto.getPageNum() == 0) {
         if (dto.getPageNum() == 0) {
@@ -37,4 +45,10 @@ public class ExtendDeviceController {
         return deviceChannelService.deviceChannel(deviceId);
         return deviceChannelService.deviceChannel(deviceId);
     }
     }
 
 
+    @RequestMapping("/start")
+    public DeferredResult<WVPResult<StreamContent>> start(HttpServletRequest request, @RequestParam String deviceId,
+                                                          @RequestParam String channelId) {
+        return playController.play(request,deviceId,channelId);
+    }
+
 }
 }