using Foxel.Services.Attributes; namespace Foxel.Services.Storage; /// /// 统一的存储服务接口 /// public interface IStorageService { /// /// 根据存储类型获取对应的存储提供者 /// /// 存储类型 /// 存储提供者实例 IStorageProvider GetProvider(StorageType storageType); /// /// 使用指定存储类型保存文件 /// /// 存储类型 /// 文件流 /// 文件名 /// 内容类型 /// 存储路径 Task SaveAsync(StorageType storageType, Stream fileStream, string fileName, string contentType); /// /// 使用指定存储类型删除文件 /// /// 存储类型 /// 存储路径 Task DeleteAsync(StorageType storageType, string storagePath); /// /// 使用指定存储类型获取文件URL /// /// 存储类型 /// 存储路径 /// 文件URL string GetUrl(StorageType storageType, string storagePath); /// /// 使用指定存储类型下载文件 /// /// 存储类型 /// 存储路径 /// 本地文件路径 Task DownloadFileAsync(StorageType storageType, string storagePath); }