| | |
| | | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| | | import com.genersoft.iot.vmp.service.IStreamPushService; |
| | | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name="online", value = "是否在线", dataTypeClass = Boolean.class), |
| | | }) |
| | | @RequestMapping(value = "/list") |
| | | @GetMapping(value = "/list") |
| | | @ResponseBody |
| | | public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page, |
| | | @RequestParam(required = false)Integer count, |
| | | @RequestParam(required = false)String query, |
| | | @RequestParam(required = false)Boolean online ){ |
| | | |
| | | PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page - 1, page - 1 + count); |
| | | PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page, count); |
| | | return pushList; |
| | | } |
| | | |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), |
| | | }) |
| | | @RequestMapping(value = "/save_to_gb") |
| | | @PostMapping(value = "/save_to_gb") |
| | | @ResponseBody |
| | | public Object saveToGB(@RequestBody GbStream stream){ |
| | | if (streamPushService.saveToGB(stream)){ |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "stream", value = "直播流关联国标平台", dataTypeClass = GbStream.class), |
| | | }) |
| | | @RequestMapping(value = "/remove_form_gb") |
| | | @DeleteMapping(value = "/remove_form_gb") |
| | | @ResponseBody |
| | | public Object removeFormGB(@RequestBody GbStream stream){ |
| | | if (streamPushService.removeFromGB(stream)){ |
| | |
| | | return "fail"; |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation("中止一个推流") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "app", value = "应用名", required = true, dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "streamId", value = "流ID", required = true, dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping(value = "/stop") |
| | | @ResponseBody |
| | | public Object removeFormGB(@RequestParam(required = true)String app, @RequestParam(required = true)String streamId){ |
| | | if (streamPushService.stop(app, streamId)){ |
| | | return "success"; |
| | | }else { |
| | | return "fail"; |
| | | } |
| | | } |
| | | |
| | | } |