42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using Azure;
|
|
using Azure.Storage.Blobs.Models;
|
|
using Core.Blueprint.DAL.Storage.Contracts;
|
|
using Core.Blueprint.Storage;
|
|
using Core.Blueprint.Storage.Adapters;
|
|
using Core.Blueprint.Storage.Contracts;
|
|
|
|
namespace Core.Blueprint.DAL.Storage.Service
|
|
{
|
|
public class BlobStorageService(IBlobStorageProvider blobStorageProvider) : IBlobStorageService
|
|
{
|
|
|
|
public async Task<Response<BlobContentInfo>> UploadBlobAsync(string blobName, Stream content)
|
|
{
|
|
var result = await blobStorageProvider.UploadBlobAsync(blobName, content);
|
|
return result;
|
|
}
|
|
|
|
public async Task<BlobFileAdapter> UploadBlobAsync(BlobAddDto newBlob)
|
|
{
|
|
var result = await blobStorageProvider.UploadBlobAsync(newBlob);
|
|
return result;
|
|
}
|
|
|
|
public async Task<IEnumerable<BlobFileAdapter>> GetBlobsListAsync(string? prefix)
|
|
{
|
|
return await blobStorageProvider.ListBlobsAsync(prefix);
|
|
}
|
|
|
|
public async ValueTask<BlobDownloadUriAdapter> DownloadBlobAsync(string blobName)
|
|
{
|
|
var result = await blobStorageProvider.GenerateBlobDownloadUri(blobName);
|
|
return result;
|
|
}
|
|
|
|
public async Task<BlobFileAdapter?> DeleteBlobAsync(string blobName)
|
|
{
|
|
return await blobStorageProvider.DeleteBlobsAsync(blobName);
|
|
}
|
|
}
|
|
}
|