| | |
| | | import com.genersoft.iot.vmp.service.ICloudRecordService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.CloudRecordItem; |
| | | import com.genersoft.iot.vmp.service.bean.DownloadFileInfo; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.storager.dao.CloudRecordServiceMapper; |
| | | import com.genersoft.iot.vmp.utils.CloudRecordUtils; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.github.pagehelper.PageHelper; |
| | |
| | | remoteHost = "http://" + mediaServerItem.getStreamIp() + ":" + mediaServerItem.getRecordAssistPort(); |
| | | } |
| | | } |
| | | if (mediaServerItem.getRecordAssistPort() == 0) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "为配置Assist服务"); |
| | | } |
| | | Long startTimeStamp = null; |
| | | Long endTimeStamp = null; |
| | | if (startTime != null) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public JSONArray queryTask(String taskId, String mediaServerId, Boolean isEnd) { |
| | | public JSONArray queryTask(String app, String stream, String callId, String taskId, String mediaServerId, Boolean isEnd) { |
| | | MediaServerItem mediaServerItem = null; |
| | | if (mediaServerId == null) { |
| | | mediaServerItem = mediaServerService.getDefaultMediaServer(); |
| | |
| | | if (mediaServerItem == null) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的流媒体"); |
| | | } |
| | | JSONObject result = assistRESTfulUtils.queryTaskList(mediaServerItem, taskId, isEnd); |
| | | JSONObject result = assistRESTfulUtils.queryTaskList(mediaServerItem, app, stream, callId, taskId, isEnd); |
| | | if (result.getInteger("code") != 0) { |
| | | throw new ControllerException(result.getInteger("code"), result.getString("msg")); |
| | | } |
| | |
| | | public int changeCollectById(Integer recordId, boolean result) { |
| | | return cloudRecordServiceMapper.changeCollectById(result, recordId); |
| | | } |
| | | |
| | | @Override |
| | | public DownloadFileInfo getPlayUrlPath(Integer recordId) { |
| | | CloudRecordItem recordItem = cloudRecordServiceMapper.queryOne(recordId); |
| | | if (recordItem == null) { |
| | | throw new ControllerException(ErrorCode.ERROR400.getCode(), "资源不存在"); |
| | | } |
| | | String filePath = recordItem.getFilePath(); |
| | | MediaServerItem mediaServerItem = mediaServerService.getOne(recordItem.getMediaServerId()); |
| | | return CloudRecordUtils.getDownloadFilePath(mediaServerItem, filePath); |
| | | } |
| | | } |