| | |
| | | import com.ruoyi.basic.service.StorageBlobService; |
| | | import com.ruoyi.common.constant.StorageAttachmentConstants; |
| | | import com.ruoyi.common.enums.StorageAttachmentRecordType; |
| | | import com.ruoyi.common.utils.MinioUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class StorageAttachmentServiceImpl extends ServiceImpl<StorageAttachmentMapper, StorageAttachment> implements StorageAttachmentService { |
| | | @Autowired |
| | | private StorageBlobMapper storageBlobMapper; |
| | | private final StorageBlobMapper storageBlobMapper; |
| | | |
| | | @Autowired |
| | | private StorageAttachmentMapper storageAttachmentMapper; |
| | | private final StorageAttachmentMapper storageAttachmentMapper; |
| | | |
| | | @Autowired |
| | | private StorageBlobService storageBlobService; |
| | | private final StorageBlobService storageBlobService; |
| | | |
| | | @Autowired |
| | | private MinioUtils minioUtils; |
| | | |
| | | @Override |
| | | public List<StorageAttachment> selectStorageAttachments(Long recordId, StorageAttachmentRecordType recordType, String fileType) { |
| | | // todo fileChange |
| | | // List<StorageAttachment> storageAttachments = storageAttachmentMapper.selectList(new LambdaQueryWrapper<StorageAttachment>() |
| | | // .eq(StorageAttachment::getRecordId, recordId) |
| | | // .eq(StorageAttachment::getRecordType, recordType.ordinal()) |
| | | // .eq(StorageAttachment::getName, fileType)); |
| | | // if (storageAttachments != null) { |
| | | // for (StorageAttachment storageAttachment : storageAttachments) { |
| | | // StorageBlob storageBlob = storageBlobMapper.selectById(storageAttachment.getStorageBlobId()); |
| | | // StorageBlobDTO storageBlobDTO = new StorageBlobDTO(); |
| | | // BeanUtils.copyProperties(storageBlob, storageBlobDTO); |
| | | // storageBlobDTO.setUrl(minioUtils.getPreviewUrl(storageBlob.getBucketName(), storageBlob.getBucketName(), true)); |
| | | // storageAttachment.setStorageBlobDTO(storageBlobDTO); |
| | | // } |
| | | // } |
| | | |
| | | // return storageAttachments; |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void saveStorageAttachment(List<StorageAttachment> attachments, Long recordId, StorageAttachmentRecordType recordType, StorageAttachmentConstants fileType) { |