| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.entity.StorageAttachment; |
| | | import com.ruoyi.basic.entity.StorageBlob; |
| | | import com.ruoyi.basic.entity.dto.SimpleStorageDto; |
| | | import com.ruoyi.basic.entity.dto.StorageBlobDTO; |
| | | import com.ruoyi.basic.mapper.StorageAttachmentMapper; |
| | | import com.ruoyi.basic.mapper.StorageBlobMapper; |
| | |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public List<SimpleStorageDto> findStorageByIds(List<Long> ids, String bucketName) { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return List.of(); |
| | | } |
| | | return storageBlobMapper.selectByIds(ids).parallelStream().map(it -> { |
| | | SimpleStorageDto dto = new SimpleStorageDto(it.getId(), it.getContentType(), it.getOriginalFilename(), it.getCreateTime()); |
| | | dto.setDownloadUrl(minioUtils.getDownloadUrls(it.getBucketFilename(), bucketName, it.getOriginalFilename(), true)); |
| | | dto.setUrl(minioUtils.getPreviewUrl(it.getBucketFilename(), bucketName, true)); |
| | | return dto; |
| | | }).toList(); |
| | | } |
| | | } |