调度定时把文件上传到minio , 播放基于minio

This commit is contained in:
2026-03-29 15:29:09 +08:00
parent 8801b70891
commit 058150a751
7 changed files with 246 additions and 31 deletions

View File

@@ -1,7 +1,13 @@
package com.rj.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rj.entity.AudioManagementSegments;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* <p>
@@ -12,5 +18,20 @@ import com.rj.entity.AudioManagementSegments;
*/
public interface AudioManagementSegmentsMapper extends BaseMapper<AudioManagementSegments> {
}
/**
* 本地路径已填、MinIO URL 未填的分段。使用注解 SQL避免 Lambda 条件生成 audio_file_url / audio_file_path 的多余占位符,
* 并在此方法上关闭租户行插件(否则会出现 tenant_id = null 等错误条件)。
*/
@InterceptorIgnore(tenantLine = "true")
@Select("SELECT * FROM audio_management_segments WHERE (audio_file_url IS NULL OR audio_file_url = '') "
+ "AND audio_file_path IS NOT NULL AND audio_file_path <> '' "
+ "ORDER BY create_time ASC LIMIT #{limit}")
List<AudioManagementSegments> listSegmentsNeedingMinioUpload(@Param("limit") int limit);
/**
* 仅按主键更新 MinIO URL不拼接 tenant_id供调度任务等无租户上下文场景使用
*/
@InterceptorIgnore(tenantLine = "true")
@Update("UPDATE audio_management_segments SET audio_file_url = #{audioFileUrl} WHERE id = #{id}")
int updateAudioFileUrlByIdIgnoreTenant(@Param("id") String id, @Param("audioFileUrl") String audioFileUrl);
}