| | |
| | | package com.genersoft.iot.vmp.vmanager.cloudRecord; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.genersoft.iot.vmp.conf.DynamicTask; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| | | import com.genersoft.iot.vmp.conf.security.JwtUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.ICloudRecordService; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.media.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.service.bean.CloudRecordItem; |
| | | import com.genersoft.iot.vmp.service.bean.DownloadFileInfo; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/date/list") |
| | | @Operation(summary = "查询存在云端录像的日期") |
| | | @Operation(summary = "查询存在云端录像的日期", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "app", description = "应用名", required = true) |
| | | @Parameter(name = "stream", description = "流ID", required = true) |
| | | @Parameter(name = "year", description = "年,置空则查询当年", required = false) |
| | |
| | | } |
| | | mediaServerItems.add(mediaServerItem); |
| | | } else { |
| | | mediaServerItems = mediaServerService.getAll(); |
| | | mediaServerItems = mediaServerService.getAllOnlineList(); |
| | | } |
| | | if (mediaServerItems.isEmpty()) { |
| | | return new ArrayList<>(); |
| | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/list") |
| | | @Operation(summary = "分页查询云端录像") |
| | | @Operation(summary = "分页查询云端录像", security = @SecurityRequirement(name = JwtUtils.HEADER)) |
| | | @Parameter(name = "query", description = "检索内容", required = false) |
| | | @Parameter(name = "app", description = "应用名", required = false) |
| | | @Parameter(name = "stream", description = "流ID", required = false) |
| | |
| | | } |
| | | mediaServerItems.add(mediaServerItem); |
| | | } else { |
| | | mediaServerItems = mediaServerService.getAll(); |
| | | mediaServerItems = mediaServerService.getAllOnlineList(); |
| | | } |
| | | if (mediaServerItems.isEmpty()) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "当前无流媒体"); |
| | |
| | | return cloudRecordService.changeCollect(false, app, stream, mediaServerId, startTime, endTime, callId); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/play/path") |
| | | @Operation(summary = "获取播放地址") |
| | | @Parameter(name = "recordId", description = "录像记录的ID", required = true) |
| | | public DownloadFileInfo getPlayUrlPath( |
| | | @RequestParam(required = true) Integer recordId |
| | | ){ |
| | | return cloudRecordService.getPlayUrlPath(recordId); |
| | | } |
| | | } |