diff --git a/Core.Blueprint.DAL.API/Program.cs b/Core.Blueprint.DAL.API/Program.cs index c746c1e..86e97f3 100644 --- a/Core.Blueprint.DAL.API/Program.cs +++ b/Core.Blueprint.DAL.API/Program.cs @@ -40,7 +40,7 @@ builder.Services.AddProblemDetails(); builder.Services.AddMemoryCache(); builder.Services.AddLogs(builder); builder.Services.AddKeyVault(builder.Configuration); -//builder.Services.AddBlobStorage(builder.Configuration); +builder.Services.AddBlobStorage(builder.Configuration); //builder.Services.AddRedis(builder.Configuration); //builder.Services.AddMongoLayer(builder.Configuration); //builder.Services.AddSQLServer(builder.Configuration); diff --git a/Core.Blueprint.DAL.API/appsettings.Local.json b/Core.Blueprint.DAL.API/appsettings.Local.json index f2c952c..50fcff3 100644 --- a/Core.Blueprint.DAL.API/appsettings.Local.json +++ b/Core.Blueprint.DAL.API/appsettings.Local.json @@ -12,5 +12,17 @@ "Address": "http://localhost:8200", "Token": "hvs.kDZnAfrvfcMNrom6RmlEhZ7I", "SecretMount": "secret" + }, + "ConnectionStrings": { + "BlobStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;" + }, + "BlobStorage": { + "ContainerName": "blueprint", + "AccountName": "devstoreaccount1", + "AccountKey": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" + }, + "ServiceSettings": { + "ApplicationName": "blueprint", + "LayerName": "dal" } -} +} \ No newline at end of file diff --git a/Core.Blueprint.DAL.Storage/Contracts/IBlobStorageService.cs b/Core.Blueprint.DAL.Storage/Contracts/IBlobStorageService.cs index dda2c78..83d3de7 100644 --- a/Core.Blueprint.DAL.Storage/Contracts/IBlobStorageService.cs +++ b/Core.Blueprint.DAL.Storage/Contracts/IBlobStorageService.cs @@ -10,7 +10,7 @@ namespace Core.Blueprint.DAL.Storage.Contracts Task> GetBlobsListAsync(string? prefix); Task> UploadBlobAsync(string blobName, Stream content); Task UploadBlobAsync(BlobAddDto newBlob); - BlobDownloadUriAdapter DownloadBlobAsync(string blobName); + ValueTask DownloadBlobAsync(string blobName); Task DeleteBlobAsync(string fileName); } } diff --git a/Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj b/Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj index 73df3c5..93fc2cf 100644 --- a/Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj +++ b/Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj @@ -11,7 +11,7 @@ - + diff --git a/Core.Blueprint.DAL.Storage/Provider/BlobStorageService.cs b/Core.Blueprint.DAL.Storage/Provider/BlobStorageService.cs index fdeb732..8f31097 100644 --- a/Core.Blueprint.DAL.Storage/Provider/BlobStorageService.cs +++ b/Core.Blueprint.DAL.Storage/Provider/BlobStorageService.cs @@ -27,9 +27,9 @@ namespace Core.Blueprint.DAL.Storage.Service return await blobStorageProvider.ListBlobsAsync(prefix); } - public BlobDownloadUriAdapter DownloadBlobAsync(string blobName) + public async ValueTask DownloadBlobAsync(string blobName) { - var result = blobStorageProvider.GenerateBlobDownloadUri(blobName); + var result = await blobStorageProvider.GenerateBlobDownloadUri(blobName); return result; }