| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.device.camera.domain.ArdCameras; |
| | | import com.ruoyi.media.domain.StreamInfo; |
| | | import com.ruoyi.media.service.IMediaService; |
| | |
| | | @PreAuthorize("@ss.hasPermi('media:stream:add')") |
| | | @ApiOperationSupport(includeParameters = {"streamInfo.name", "streamInfo.rtspSource", "streamInfo.mode"}) |
| | | public AjaxResult addPath(@RequestBody StreamInfo streamInfo) { |
| | | String rtsp = mediaService.addPath(streamInfo.getName(), streamInfo.getRtspSource(), streamInfo.getMode()); |
| | | if(StringUtils.isEmpty(streamInfo.getName())) |
| | | { |
| | | return AjaxResult.error("通道名称不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(streamInfo.getRtspSource())) |
| | | { |
| | | return AjaxResult.error("rtsp地址不能为空"); |
| | | } |
| | | String rtsp = mediaService.addPath(streamInfo.getName(), streamInfo.getRtspSource(), streamInfo.getMode(),streamInfo.getIsCode()); |
| | | return AjaxResult.success(rtsp); |
| | | } |
| | | /** |
| | |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody StreamInfo streamInfo) { |
| | | mediaService.removePath(new String[]{streamInfo.getName()}); |
| | | String rtsp = mediaService.addPath(streamInfo.getName(), streamInfo.getRtspSource(), streamInfo.getMode()); |
| | | String rtsp = mediaService.addPath(streamInfo.getName(), streamInfo.getRtspSource(), streamInfo.getMode(),streamInfo.getIsCode()); |
| | | return AjaxResult.success(rtsp); |
| | | } |
| | | |