| | |
| | | add auto_push_channel bool default false |
| | | |
| | | alter table wvp_stream_proxy |
| | | add stream_key varying(255) |
| | | add stream_key character varying(255) |
| | | |
| | | create table wvp_cloud_record ( |
| | | id serial primary key, |
| | |
| | | file_name character varying(255), |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect_type character varying(255), |
| | | collect bool default false, |
| | | reserve bool default false, |
| | | file_size integer, |
| | | time_len integer, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | | ); |
| | | |
| | | alter table wvp_media_server |
| | | add record_path character varying(255); |
| | | |
| | | alter table wvp_media_server |
| | | add record_date integer default 7; |
| | | |
| | | |
| | |
| | | create_time character varying(50), |
| | | update_time character varying(50), |
| | | hook_alive_interval integer, |
| | | record_path character varying(255), |
| | | record_date integer default 7, |
| | | constraint uk_media_server_unique_ip_http_port unique (ip, http_port) |
| | | ); |
| | | |
| | |
| | | constraint uk_stream_push_app_stream unique (app, stream) |
| | | ); |
| | | create table wvp_cloud_record ( |
| | | id serial primary key, |
| | | app character varying(255), |
| | | stream character varying(255), |
| | | call_id character varying(255), |
| | | start_time integer, |
| | | end_time integer, |
| | | media_server_id character varying(50), |
| | | file_name character varying(255), |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect_type character varying(255), |
| | | file_size integer, |
| | | time_len integer, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | | id serial primary key, |
| | | app character varying(255), |
| | | stream character varying(255), |
| | | call_id character varying(255), |
| | | start_time integer, |
| | | end_time integer, |
| | | media_server_id character varying(50), |
| | | file_name character varying(255), |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect bool default false, |
| | | reserve bool default false, |
| | | file_size integer, |
| | | time_len integer, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | | ); |
| | | |
| | | create table wvp_user ( |
New file |
| | |
| | | package com.genersoft.iot.vmp.conf; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.IMediaServerService; |
| | | import com.genersoft.iot.vmp.storager.dao.CloudRecordServiceMapper; |
| | | import com.genersoft.iot.vmp.vmanager.cloudRecord.CloudRecordController; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å½åæä»¶å®æ¶å é¤ |
| | | */ |
| | | @Component |
| | | public class CloudRecordTimer { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(CloudRecordTimer.class); |
| | | |
| | | @Autowired |
| | | private IMediaServerService mediaServerService; |
| | | |
| | | @Autowired |
| | | private CloudRecordServiceMapper cloudRecordServiceMapper; |
| | | |
| | | @Autowired |
| | | private AssistRESTfulUtils assistRESTfulUtils; |
| | | |
| | | /** |
| | | * 宿¶æ¥è¯¢å¾
å é¤çå½åæä»¶ |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * ?") //æ¯å¤©ç0ç¹æ§è¡ |
| | | public void execute(){ |
| | | // è·åé
ç½®äºassistçæµåªä½èç¹ |
| | | List<MediaServerItem> mediaServerItemList = mediaServerService.getAllWithAssistPort(); |
| | | if (mediaServerItemList.isEmpty()) { |
| | | return; |
| | | } |
| | | long result = 0; |
| | | for (MediaServerItem mediaServerItem : mediaServerItemList) { |
| | | |
| | | Calendar lastCalendar = Calendar.getInstance(); |
| | | if (mediaServerItem.getRecordDate() > 0) { |
| | | lastCalendar.setTime(new Date()); |
| | | // è·åä¿åçæåæªè³æ¥æï¼å 为æ¯ä¸ªèç¹é½æä¸ä¸ªæ¥æï¼ä¹å°±æ¯æ¯ææ¯ä¸ªèç¹è®¾ç½®ä¸åçä¿åæ¥æï¼ |
| | | lastCalendar.add(Calendar.DAY_OF_MONTH, -mediaServerItem.getRecordDate()); |
| | | Long lastDate = lastCalendar.getTimeInMillis(); |
| | | // è·åå°æªè³æ¥æä¹åçå½åæä»¶åè¡¨ï¼æä»¶å表满足æªè¢«æ¶èåä¿æçãè¿ä¸¤ä¸ªå段ç®åå
±è½ä¸è´ï¼ |
| | | // 为æèªå·±ä¸å¡ç³»ç»ç¸å
³ç代ç ï¼å¤§å®¶ä½¿ç¨çæ¶åç´æ¥ä½¿ç¨æ¶èï¼collectï¼è¿ä¸ä¸ªç±»åå³å¯ |
| | | List<String> filePathList = cloudRecordServiceMapper.queryRecordFilePathListForDelete(lastDate, mediaServerItem.getId()); |
| | | if (filePathList.isEmpty()) { |
| | | continue; |
| | | } |
| | | // å
è°ç¨assistå é¤ç£çæä»¶ï¼å 餿åååå 餿°æ®åºè®°å½ |
| | | JSONObject jsonObject = assistRESTfulUtils.deleteFiles(mediaServerItem, filePathList); |
| | | if (jsonObject != null && jsonObject.getInteger("code") == 0 && jsonObject.getInteger("data") > 0) { |
| | | result += jsonObject.getInteger("data"); |
| | | cloudRecordServiceMapper.deleteByFileList(filePathList, mediaServerItem.getId()); |
| | | } |
| | | } |
| | | } |
| | | logger.info("[å½åæä»¶å®æ¶æ¸
ç] å
±æ¸
ç{}ä¸ªè¿æå½åæä»¶", result); |
| | | } |
| | | } |
| | |
| | | private OkHttpClient client; |
| | | |
| | | |
| | | |
| | | |
| | | public interface RequestCallback{ |
| | | void run(JSONObject response); |
| | | } |
| | |
| | | return sendGet(mediaServerItem, "api/record/file/download/task/list", param, null); |
| | | } |
| | | |
| | | public JSONObject addCollect(MediaServerItem mediaServerItem, JSONObject jsonObject) { |
| | | return sendPost(mediaServerItem, "api/record/file/collection/add", jsonObject, null, 30); |
| | | } |
| | | |
| | | public JSONObject deleteFiles(MediaServerItem mediaServerItem, List<String> filePathList) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("filePathList", filePathList); |
| | | return sendPost(mediaServerItem, "api/record/file/delete", jsonObject, null, 15*60); |
| | | } |
| | | } |
| | |
| | | @Schema(description = "æ¯å¦æ¯é»è®¤ZLM") |
| | | private boolean defaultServer; |
| | | |
| | | @Schema(description = "å½å使ç¨å°ç端å£") |
| | | private int currentPort; |
| | | @Schema(description = "å½ååå¨è·¯å¾") |
| | | private String recordPath; |
| | | |
| | | @Schema(description = "å½åå卿¶é¿") |
| | | private int recordDate; |
| | | |
| | | |
| | | |
| | | |
| | | public MediaServerItem() { |
| | |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public int getCurrentPort() { |
| | | return currentPort; |
| | | } |
| | | |
| | | public void setCurrentPort(int currentPort) { |
| | | this.currentPort = currentPort; |
| | | } |
| | | |
| | | public boolean isStatus() { |
| | | return status; |
| | | } |
| | |
| | | public void setSendRtpPortRange(String sendRtpPortRange) { |
| | | this.sendRtpPortRange = sendRtpPortRange; |
| | | } |
| | | |
| | | public String getRecordPath() { |
| | | return recordPath; |
| | | } |
| | | |
| | | public void setRecordPath(String recordPath) { |
| | | this.recordPath = recordPath; |
| | | } |
| | | |
| | | public int getRecordDate() { |
| | | return recordDate; |
| | | } |
| | | |
| | | public void setRecordDate(int recordDate) { |
| | | this.recordDate = recordDate; |
| | | } |
| | | } |
| | |
| | | package com.genersoft.iot.vmp.service; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnRecordMp4HookParam; |
| | | import com.genersoft.iot.vmp.service.bean.CloudRecordItem; |
| | |
| | | * æ¥è¯¢åå¹¶ä»»å¡å表 |
| | | */ |
| | | JSONArray queryTask(String taskId, String mediaServerId, Boolean isEnd); |
| | | |
| | | /** |
| | | * æ¶èè§é¢ï¼æ¶èçè§é¢è¿æä¸ä¼å é¤ |
| | | */ |
| | | void changeCollect(String type, boolean result, String app, String stream, String mediaServerId, String startTime, String endTime, String callId, String collectType); |
| | | |
| | | /** |
| | | * æ·»å æå®å½åæ¶è |
| | | */ |
| | | void changeCollectById(Integer recordId, String collectType, boolean result); |
| | | |
| | | } |
| | |
| | | */ |
| | | MediaServerLoad getLoad(MediaServerItem mediaServerItem); |
| | | |
| | | List<MediaServerItem> getAllWithAssistPort(); |
| | | |
| | | } |
| | |
| | | private String folder; |
| | | |
| | | /** |
| | | * æ¶èç±»åï¼æ¶èçæä»¶ä¸ç§»é¤ |
| | | * æ¶èï¼æ¶èçæä»¶ä¸ç§»é¤ |
| | | */ |
| | | private String collectType; |
| | | private Boolean collect; |
| | | |
| | | /** |
| | | * ä¿çï¼æ¶èçæä»¶ä¸ç§»é¤ |
| | | */ |
| | | private Boolean reserve; |
| | | |
| | | /** |
| | | * æä»¶å¤§å° |
| | |
| | | this.timeLen = timeLen; |
| | | } |
| | | |
| | | public String getCollectType() { |
| | | return collectType; |
| | | public Boolean getCollect() { |
| | | return collect; |
| | | } |
| | | |
| | | public void setCollectType(String collectType) { |
| | | this.collectType = collectType; |
| | | public void setCollect(Boolean collect) { |
| | | this.collect = collect; |
| | | } |
| | | |
| | | public Boolean getReserve() { |
| | | return reserve; |
| | | } |
| | | |
| | | public void setReserve(Boolean reserve) { |
| | | this.reserve = reserve; |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| | | import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; |
| | | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| | | import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.unit.DataUnit; |
| | | |
| | | import java.time.*; |
| | | import java.time.temporal.TemporalAccessor; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | |
| | | } |
| | | return result.getJSONArray("data"); |
| | | } |
| | | |
| | | @Override |
| | | public void changeCollect(String type, boolean result, String app, String stream, String mediaServerId, String startTime, String endTime, String callId, String collectType) { |
| | | // å¼å§æ¶é´åç»ææ¶é´å¨æ°æ®åºä¸é½æ¯ä»¥ç§ä¸ºåä½ç |
| | | Long startTimeStamp = null; |
| | | Long endTimeStamp = null; |
| | | if (startTime != null ) { |
| | | if (!DateUtil.verification(startTime, DateUtil.formatter)) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "å¼å§æ¶é´æ ¼å¼éè¯¯ï¼æ£ç¡®æ ¼å¼ä¸ºï¼ " + DateUtil.formatter); |
| | | } |
| | | startTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(startTime); |
| | | |
| | | } |
| | | if (endTime != null ) { |
| | | if (!DateUtil.verification(endTime, DateUtil.formatter)) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "ç»ææ¶é´æ ¼å¼éè¯¯ï¼æ£ç¡®æ ¼å¼ä¸ºï¼ " + DateUtil.formatter); |
| | | } |
| | | endTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime); |
| | | |
| | | } |
| | | |
| | | List<MediaServerItem> mediaServerItems; |
| | | if (!ObjectUtils.isEmpty(mediaServerId)) { |
| | | mediaServerItems = new ArrayList<>(); |
| | | MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId); |
| | | if (mediaServerItem == null) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "æªæ¾å°æµåªä½: " + mediaServerId); |
| | | } |
| | | mediaServerItems.add(mediaServerItem); |
| | | } else { |
| | | mediaServerItems = null; |
| | | } |
| | | |
| | | List<CloudRecordItem> all = cloudRecordServiceMapper.getList(null, app, stream, startTimeStamp, endTimeStamp, |
| | | callId, mediaServerItems); |
| | | if (all.isEmpty()) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "æªæ¾å°å¾
æ¶èçè§é¢"); |
| | | } |
| | | int limitCount = 50; |
| | | if (all.size() > limitCount) { |
| | | for (int i = 0; i < all.size(); i += limitCount) { |
| | | int toIndex = i + limitCount; |
| | | if (i + limitCount > all.size()) { |
| | | toIndex = all.size(); |
| | | } |
| | | if ("collect".equals(collectType)) { |
| | | cloudRecordServiceMapper.updateCollectList(result, all.subList(i, toIndex)); |
| | | }else if ("reserve".equals(collectType)) { |
| | | cloudRecordServiceMapper.updateReserveList(result, all.subList(i, toIndex)); |
| | | } |
| | | |
| | | } |
| | | }else { |
| | | if ("collect".equals(collectType)) { |
| | | cloudRecordServiceMapper.updateCollectList(result, all); |
| | | }else if ("reserve".equals(collectType)) { |
| | | cloudRecordServiceMapper.updateReserveList(result, all); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void changeCollectById(Integer recordId, String collectType, boolean result) { |
| | | if ("collect".equals(collectType)) { |
| | | cloudRecordServiceMapper.changeCollectById(result, recordId); |
| | | }else if ("reserve".equals(collectType)) { |
| | | cloudRecordServiceMapper.changeReserveById(result, recordId); |
| | | } |
| | | } |
| | | } |
| | |
| | | result.setGbSend(redisCatchStorage.getGbSendCount(mediaServerItem.getId())); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<MediaServerItem> getAllWithAssistPort() { |
| | | return mediaServerMapper.queryAllWithAssistPort(); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import com.genersoft.iot.vmp.service.bean.CloudRecordItem; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @Param("startTimeStamp")Long startTimeStamp, @Param("endTimeStamp")Long endTimeStamp, |
| | | @Param("callId")String callId, List<MediaServerItem> mediaServerItemList); |
| | | |
| | | @Update(" <script>" + |
| | | "update wvp_cloud_record set collect = #{collect} where file_path in " + |
| | | " <foreach collection='cloudRecordItemList' item='item' open='(' separator=',' close=')' > #{item.filePath}</foreach>" + |
| | | " </script>") |
| | | void updateCollectList(@Param("collect") boolean collect, List<CloudRecordItem> cloudRecordItemList); |
| | | |
| | | @Delete(" <script>" + |
| | | "delete from wvp_cloud_record where media_server_id=#{mediaServerId} file_path in " + |
| | | " <foreach collection='filePathList' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + |
| | | " </script>") |
| | | void deleteByFileList(List<String> filePathList, @Param("mediaServerId") String mediaServerId); |
| | | |
| | | |
| | | @Select(" <script>" + |
| | | "select file_path" + |
| | | " from wvp_cloud_record " + |
| | | " where collect = false and reserve = false " + |
| | | " <if test= 'endTimeStamp != null '> and start_time <= #{endTimeStamp}</if>" + |
| | | " <if test= 'callId != null '> and call_id = #{callId}</if>" + |
| | | " <if test= 'mediaServerId != null ' > and media_server_id = #{mediaServerId} </if>" + |
| | | " </script>") |
| | | List<String> queryRecordFilePathListForDelete(@Param("endTimeStamp")Long endTimeStamp, String mediaServerId); |
| | | |
| | | @Update(" <script>" + |
| | | "update wvp_cloud_record set reserve = #{reserve} where file_path in " + |
| | | " <foreach collection='cloudRecordItems' item='item' open='(' separator=',' close=')' > #{item.filePath}</foreach>" + |
| | | " </script>") |
| | | void updateReserveList(@Param("reserve") boolean reserve,List<CloudRecordItem> cloudRecordItems); |
| | | |
| | | @Update(" <script>" + |
| | | "update wvp_cloud_record set collect = #{collect} where id = #{recordId} " + |
| | | " </script>") |
| | | void changeCollectById(@Param("collect") boolean collect, @Param("recordId") Integer recordId); |
| | | |
| | | @Update(" <script>" + |
| | | "update wvp_cloud_record set reserve = #{reserve} where id = #{recordId} " + |
| | | " </script>") |
| | | void changeReserveById(@Param("reserve") boolean reserve, Integer recordId); |
| | | } |
| | |
| | | |
| | | @Select("SELECT * FROM wvp_media_server WHERE default_server=true") |
| | | MediaServerItem queryDefault(); |
| | | |
| | | @Select("SELECT * FROM wvp_media_server WHERE record_assist_port > 0") |
| | | List<MediaServerItem> queryAllWithAssistPort(); |
| | | |
| | | } |
| | |
| | | package com.genersoft.iot.vmp.vmanager.cloudRecord; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | 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.media.zlm.ZlmHttpHookSubscribe; |
| | | 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.service.bean.CloudRecordItem; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.genersoft.iot.vmp.vmanager.bean.RecordFile; |
| | | import com.github.pagehelper.PageInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | |
| | | @RequestMapping("/api/cloud/record") |
| | | public class CloudRecordController { |
| | | |
| | | @Autowired |
| | | private ZLMServerFactory zlmServerFactory; |
| | | |
| | | @Autowired |
| | | private SendRtpPortManager sendRtpPortManager; |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(CloudRecordController.class); |
| | | |
| | |
| | | @Autowired |
| | | private IMediaServerService mediaServerService; |
| | | |
| | | @Autowired |
| | | private UserSetting userSetting; |
| | | |
| | | @Autowired |
| | | private DynamicTask dynamicTask; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<Object, Object> redisTemplate; |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/date/list") |
| | |
| | | @Parameter(name = "month", description = "æï¼ç½®ç©ºåæ¥è¯¢å½æ", required = false) |
| | | @Parameter(name = "mediaServerId", description = "æµåªä½IDï¼ç½®ç©ºåæ¥è¯¢å
¨é¨", required = false) |
| | | public List<String> openRtpServer( |
| | | @RequestParam String app, |
| | | @RequestParam String stream, |
| | | @RequestParam(required = true) String app, |
| | | @RequestParam(required = true) String stream, |
| | | @RequestParam(required = false) int year, |
| | | @RequestParam(required = false) int month, |
| | | @RequestParam(required = false) String mediaServerId |
| | |
| | | @Parameter(name = "query", description = "æ£ç´¢å
容", required = false) |
| | | @Parameter(name = "app", description = "åºç¨å", required = false) |
| | | @Parameter(name = "stream", description = "æµID", required = false) |
| | | @Parameter(name = "page", description = "å½å页", required = false) |
| | | @Parameter(name = "count", description = "æ¯é¡µæ¥è¯¢æ°é", required = false) |
| | | @Parameter(name = "page", description = "å½å页", required = true) |
| | | @Parameter(name = "count", description = "æ¯é¡µæ¥è¯¢æ°é", required = true) |
| | | @Parameter(name = "startTime", description = "å¼å§æ¶é´(yyyy-MM-dd HH:mm:ss)", required = false) |
| | | @Parameter(name = "endTime", description = "ç»ææ¶é´(yyyy-MM-dd HH:mm:ss)", required = false) |
| | | @Parameter(name = "mediaServerId", description = "æµåªä½IDï¼ç½®ç©ºåæ¥è¯¢å
¨é¨æµåªä½", required = false) |
| | |
| | | @ResponseBody |
| | | @GetMapping("/task/add") |
| | | @Operation(summary = "æ·»å åå¹¶ä»»å¡") |
| | | @Parameter(name = "app", description = "åºç¨å", required = true) |
| | | @Parameter(name = "stream", description = "æµID", required = true) |
| | | @Parameter(name = "app", description = "åºç¨å", required = false) |
| | | @Parameter(name = "stream", description = "æµID", required = false) |
| | | @Parameter(name = "mediaServerId", description = "æµåªä½ID", required = false) |
| | | @Parameter(name = "startTime", description = "é´æID", required = false) |
| | | @Parameter(name = "endTime", description = "é´æID", required = false) |
| | | @Parameter(name = "callId", description = "é´æID", required = false) |
| | | @Parameter(name = "remoteHost", description = "è¿åå°åæ¶çè¿ç¨å°å", required = false) |
| | | public String addTask( |
| | | @RequestParam(required = true) String app, |
| | | @RequestParam(required = true) String stream, |
| | | @RequestParam(required = false) String app, |
| | | @RequestParam(required = false) String stream, |
| | | @RequestParam(required = false) String mediaServerId, |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime, |
| | |
| | | @ResponseBody |
| | | @GetMapping("/collect/add") |
| | | @Operation(summary = "æ·»å æ¶è") |
| | | @Parameter(name = "app", description = "åºç¨å", required = true) |
| | | @Parameter(name = "stream", description = "æµID", required = true) |
| | | @Parameter(name = "app", description = "åºç¨å", required = false) |
| | | @Parameter(name = "stream", description = "æµID", required = false) |
| | | @Parameter(name = "mediaServerId", description = "æµåªä½ID", required = false) |
| | | @Parameter(name = "startTime", description = "é´æID", required = false) |
| | | @Parameter(name = "endTime", description = "é´æID", required = false) |
| | | @Parameter(name = "callId", description = "é´æID", required = false) |
| | | @Parameter(name = "collectType", description = "æ¶èç±»å", required = false) |
| | | public JSONArray addCollect( |
| | | @RequestParam(required = false) String taskId, |
| | | @Parameter(name = "collectType", description = "æ¶èç±»å, collect/reserve", required = false) |
| | | public void addCollect( |
| | | @RequestParam(required = false) String app, |
| | | @RequestParam(required = false) String stream, |
| | | @RequestParam(required = false) String mediaServerId, |
| | | @RequestParam(required = false) Boolean isEnd |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime, |
| | | @RequestParam(required = false) String callId, |
| | | @RequestParam(required = false) String collectType, |
| | | @RequestParam(required = false) Integer recordId |
| | | ){ |
| | | return cloudRecordService.queryTask(taskId, mediaServerId, isEnd); |
| | | if (!"collect".equals(collectType) && !"reserve".equals(collectType)) { |
| | | collectType = "collect"; |
| | | } |
| | | if (recordId != null) { |
| | | cloudRecordService.changeCollectById(recordId, collectType, true); |
| | | }else { |
| | | cloudRecordService.changeCollect(collectType, true, app, stream, mediaServerId, startTime, endTime, callId, collectType); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/collect/delete") |
| | | @Operation(summary = "ç§»é¤æ¶è") |
| | | @Parameter(name = "app", description = "åºç¨å", required = false) |
| | | @Parameter(name = "stream", description = "æµID", required = false) |
| | | @Parameter(name = "mediaServerId", description = "æµåªä½ID", required = false) |
| | | @Parameter(name = "startTime", description = "é´æID", required = false) |
| | | @Parameter(name = "endTime", description = "é´æID", required = false) |
| | | @Parameter(name = "callId", description = "é´æID", required = false) |
| | | @Parameter(name = "collectType", description = "æ¶èç±»å, collect/reserve", required = false) |
| | | public void deleteCollect( |
| | | @RequestParam(required = false) String app, |
| | | @RequestParam(required = false) String stream, |
| | | @RequestParam(required = false) String mediaServerId, |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime, |
| | | @RequestParam(required = false) String callId, |
| | | @RequestParam(required = false) String collectType, |
| | | @RequestParam(required = false) Integer recordId |
| | | ){ |
| | | if (!"collect".equals(collectType) && !"reserve".equals(collectType)) { |
| | | collectType = "collect"; |
| | | } |
| | | if (recordId != null) { |
| | | cloudRecordService.changeCollectById(recordId, collectType, false); |
| | | }else { |
| | | cloudRecordService.changeCollect(collectType, false, app, stream, mediaServerId, startTime, endTime, callId, collectType); |
| | | } |
| | | } |
| | | |
| | | |