| | |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect bool default false, |
| | | reserve bool default false, |
| | | file_size bigint, |
| | | time_len bigint, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect bool default false, |
| | | reserve bool default false, |
| | | file_size int8, |
| | | time_len int8, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect bool default false, |
| | | reserve bool default false, |
| | | file_size bigint, |
| | | time_len bigint, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | |
| | | folder character varying(255), |
| | | file_path character varying(255), |
| | | collect bool default false, |
| | | reserve bool default false, |
| | | file_size int8, |
| | | time_len int8, |
| | | constraint uk_stream_push_app_stream_path unique (app, stream, file_path) |
| | |
| | | /** |
| | | * æ¶èè§é¢ï¼æ¶èçè§é¢è¿æä¸ä¼å é¤ |
| | | */ |
| | | void changeCollect(String type, boolean result, String app, String stream, String mediaServerId, String startTime, String endTime, String callId, String collectType); |
| | | int changeCollect(boolean result, String app, String stream, String mediaServerId, String startTime, String endTime, String callId); |
| | | |
| | | /** |
| | | * æ·»å æå®å½åæ¶è |
| | | */ |
| | | void changeCollectById(Integer recordId, String collectType, boolean result); |
| | | int changeCollectById(Integer recordId, boolean result); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void changeCollect(String type, boolean result, String app, String stream, String mediaServerId, String startTime, String endTime, String callId, String collectType) { |
| | | public int changeCollect(boolean result, String app, String stream, String mediaServerId, String startTime, String endTime, String callId) { |
| | | // å¼å§æ¶é´åç»ææ¶é´å¨æ°æ®åºä¸é½æ¯ä»¥ç§ä¸ºåä½ç |
| | | Long startTimeStamp = null; |
| | | Long endTimeStamp = null; |
| | |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "æªæ¾å°å¾
æ¶èçè§é¢"); |
| | | } |
| | | int limitCount = 50; |
| | | int resultCount = 0; |
| | | 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)); |
| | | } |
| | | resultCount += cloudRecordServiceMapper.updateCollectList(result, all.subList(i, toIndex)); |
| | | |
| | | } |
| | | }else { |
| | | if ("collect".equals(collectType)) { |
| | | cloudRecordServiceMapper.updateCollectList(result, all); |
| | | }else if ("reserve".equals(collectType)) { |
| | | cloudRecordServiceMapper.updateReserveList(result, all); |
| | | } |
| | | resultCount = cloudRecordServiceMapper.updateCollectList(result, all); |
| | | } |
| | | return resultCount; |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | public int changeCollectById(Integer recordId, boolean result) { |
| | | return cloudRecordServiceMapper.changeCollectById(result, recordId); |
| | | } |
| | | } |
| | |
| | | "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); |
| | | int updateCollectList(@Param("collect") boolean collect, List<CloudRecordItem> cloudRecordItemList); |
| | | |
| | | @Delete(" <script>" + |
| | | "delete from wvp_cloud_record where media_server_id=#{mediaServerId} file_path in " + |
| | |
| | | @Select(" <script>" + |
| | | "select file_path" + |
| | | " from wvp_cloud_record " + |
| | | " where collect = false and reserve = false " + |
| | | " where collect = 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>" + |
| | |
| | | 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); |
| | | int 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); |
| | | } |
| | |
| | | @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 addCollect( |
| | | @Parameter(name = "recordId", description = "å½åè®°å½çIDï¼ç¨äºç²¾åæ¶èä¸ä¸ªè§é¢æä»¶", required = false) |
| | | public int addCollect( |
| | | @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, true); |
| | | return cloudRecordService.changeCollectById(recordId, true); |
| | | }else { |
| | | cloudRecordService.changeCollect(collectType, true, app, stream, mediaServerId, startTime, endTime, callId, collectType); |
| | | return cloudRecordService.changeCollect(true, app, stream, mediaServerId, startTime, endTime, callId); |
| | | } |
| | | } |
| | | |
| | |
| | | @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( |
| | | @Parameter(name = "recordId", description = "å½åè®°å½çIDï¼ç¨äºç²¾åç²¾åç§»é¤ä¸ä¸ªè§é¢æä»¶çæ¶è", required = false) |
| | | public int 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); |
| | | return cloudRecordService.changeCollectById(recordId, false); |
| | | }else { |
| | | cloudRecordService.changeCollect(collectType, false, app, stream, mediaServerId, startTime, endTime, callId, collectType); |
| | | return cloudRecordService.changeCollect(false, app, stream, mediaServerId, startTime, endTime, callId); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |