♻️ Extract the Storage service to DysonNetwork.Drive microservice

This commit is contained in:
2025-07-06 17:29:26 +08:00
parent 6a3d04af3d
commit 14b79f16f4
71 changed files with 2629 additions and 346 deletions

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using DysonNetwork.Drive.Models;
namespace DysonNetwork.Drive.Interfaces;
public interface IFileReferenceService
{
Task<CloudFileReference> CreateReferenceAsync(
Guid fileId,
string resourceId,
string resourceType,
string referenceType,
string? referenceId = null,
string? referenceName = null,
string? referenceMimeType = null,
long? referenceSize = null,
string? referenceUrl = null,
string? referenceThumbnailUrl = null,
string? referencePreviewUrl = null,
string? referenceMetadata = null,
IDictionary<string, object>? metadata = null,
CancellationToken cancellationToken = default);
Task<CloudFileReference> GetReferenceAsync(Guid referenceId, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFileReference>> GetReferencesForFileAsync(Guid fileId, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFileReference>> GetReferencesForResourceAsync(string resourceId, string resourceType, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFileReference>> GetReferencesOfTypeAsync(string referenceType, CancellationToken cancellationToken = default);
Task<bool> DeleteReferenceAsync(Guid referenceId, CancellationToken cancellationToken = default);
Task<int> DeleteReferencesForFileAsync(Guid fileId, CancellationToken cancellationToken = default);
Task<int> DeleteReferencesForResourceAsync(string resourceId, string resourceType, CancellationToken cancellationToken = default);
Task<CloudFileReference> UpdateReferenceMetadataAsync(Guid referenceId, IDictionary<string, object> metadata, CancellationToken cancellationToken = default);
Task<bool> ReferenceExistsAsync(Guid referenceId, CancellationToken cancellationToken = default);
Task<bool> HasReferenceAsync(Guid fileId, string resourceId, string resourceType, string? referenceType = null, CancellationToken cancellationToken = default);
Task<CloudFileReference> UpdateReferenceResourceAsync(Guid referenceId, string newResourceId, string newResourceType, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFile>> GetFilesForResourceAsync(string resourceId, string resourceType, string? referenceType = null, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFile>> GetFilesForReferenceTypeAsync(string referenceType, CancellationToken cancellationToken = default);
}