|  |  |  | 
|---|
|  |  |  | package com.genersoft.iot.vmp.vmanager.gb28181.media; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.genersoft.iot.vmp.common.StreamInfo; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IMediaServerService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IStreamPushService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IMediaService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParam; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParams; | 
|---|
|  |  |  | 
|---|
|  |  |  | private final static Logger logger = LoggerFactory.getLogger(MediaController.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IVideoManagerStorager storager; | 
|---|
|  |  |  | private IVideoManagerStorage storager; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IStreamPushService streamPushService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IMediaService mediaService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IMediaServerService mediaServerService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class), | 
|---|
|  |  |  | @ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class), | 
|---|
|  |  |  | @ApiImplicitParam(name = "mediaServerId", value = "媒体服务器id", dataTypeClass = String.class, required = false), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequestMapping(value = "/getStreamInfoByAppAndStream") | 
|---|
|  |  |  | @GetMapping(value = "/stream_info_by_app_and_stream") | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public StreamInfo getStreamInfoByAppAndStream(String app, String stream){ | 
|---|
|  |  |  | return mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream); | 
|---|
|  |  |  | public WVPResult<StreamInfo> getStreamInfoByAppAndStream(@RequestParam String app, @RequestParam String stream, @RequestParam(required = false) String mediaServerId){ | 
|---|
|  |  |  | StreamInfo streamInfoByAppAndStreamWithCheck = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId); | 
|---|
|  |  |  | WVPResult<StreamInfo> result = new WVPResult<>(); | 
|---|
|  |  |  | if (streamInfoByAppAndStreamWithCheck != null){ | 
|---|
|  |  |  | result.setCode(0); | 
|---|
|  |  |  | result.setMsg("scccess"); | 
|---|
|  |  |  | result.setData(streamInfoByAppAndStreamWithCheck); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | result.setCode(-1); | 
|---|
|  |  |  | result.setMsg("fail"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|