src/main/java/com/dji/sample/media/service/impl/FileServiceImpl.java
@@ -182,7 +182,13 @@
        if (jobName != null && !jobName.isEmpty()) {
            List<String> jobIds = waylineJobService.getJobIds(jobName);
                queryWrapper.in(MediaFileEntity::getJobId, jobIds);
            // 检查 jobIds 列表是否为空
            if (jobIds.isEmpty()) {
                // 如果为空,则直接返回空的分页数据
                return new PaginationData<>(Collections.emptyList(), new Pagination(pageObj));
            }
            queryWrapper.in(MediaFileEntity::getJobId, jobIds);
        }
        if (type != null && !type.isEmpty()) {
            if ("图片".equals(type)) {
@@ -191,7 +197,7 @@
                queryWrapper.likeLeft(MediaFileEntity::getFileName, ".mp4");
            }
        }
        queryWrapper.orderByDesc(MediaFileEntity::getCreateTime);
        queryWrapper.last("ORDER BY JSON_EXTRACT(metadata, '$.createdTime') DESC");
        // 执行分页查询
        Page<MediaFileEntity> resultPage = mapper.selectPage(pageObj, queryWrapper);
@@ -222,7 +228,8 @@
                .collect(Collectors.toList());
        LambdaUpdateWrapper<LotInfo> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.in(LotInfo::getId, ids)
                .set(LotInfo::getInvestigate, 1);
                .set(LotInfo::getInvestigate, 1)
                .set(LotInfo::getIsPlan,1);
        patchesMapper.update(null, updateWrapper);
    }
@@ -413,7 +420,7 @@
        return builder.build();
    }
    public static void uploadFile(String endpoint, String accessKey, String secretKey, String bucketName, String objectName, File file) {
    public static void uploadFile(String endpoint, String accessKey, String secretKey, String bucketName, String objectName, File file ) {
        try {
            // 创建MinIO客户端实例
            MinioClient minioClient = MinioClient.builder()
@@ -427,6 +434,7 @@
                            .bucket(bucketName)
                            .object(objectName)
                            .stream(fileInputStream, file.length(), -1)
                            .contentType("image/jpeg")
                            .build()
            );
            fileInputStream.close();