Compare commits
3 Commits
10f2083590
...
2384117c79
| Author | SHA1 | Date | |
|---|---|---|---|
| 2384117c79 | |||
| daa9699bdd | |||
| 169c6409dc |
@@ -11,6 +11,7 @@ namespace Core.Blueprint.DAL.API.Controllers
|
||||
[Produces("application/json")]
|
||||
[ApiController]
|
||||
[AllowAnonymous]
|
||||
//test gitea
|
||||
public class BlobStorageController(IBlobStorageService storageService) : ControllerBase
|
||||
{
|
||||
[HttpPost("UploadBlobFromFileBrowser")]
|
||||
|
||||
@@ -13,21 +13,21 @@ using System.Text.Json.Serialization;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Configuration.AddAzureAppConfiguration(options =>
|
||||
{
|
||||
var endpoint = builder.Configuration.GetSection("Endpoints:AppConfigurationURI").Value;
|
||||
//builder.Configuration.AddAzureAppConfiguration(options =>
|
||||
//{
|
||||
// var endpoint = builder.Configuration.GetSection("Endpoints:AppConfigurationURI").Value;
|
||||
|
||||
if (string.IsNullOrEmpty(endpoint))
|
||||
throw new ArgumentException("The app configuration is missing");
|
||||
// if (string.IsNullOrEmpty(endpoint))
|
||||
// throw new ArgumentException("The app configuration is missing");
|
||||
|
||||
options.Connect(new Uri(endpoint), new DefaultAzureCredential())
|
||||
.Select(KeyFilter.Any, "blueprint_dal");
|
||||
// options.Connect(new Uri(endpoint), new DefaultAzureCredential())
|
||||
// .Select(KeyFilter.Any, "blueprint_dal");
|
||||
|
||||
options.ConfigureKeyVault(keyVaultOptions =>
|
||||
{
|
||||
keyVaultOptions.SetCredential(new DefaultAzureCredential());
|
||||
});
|
||||
});
|
||||
// options.ConfigureKeyVault(keyVaultOptions =>
|
||||
// {
|
||||
// keyVaultOptions.SetCredential(new DefaultAzureCredential());
|
||||
// });
|
||||
//});
|
||||
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
@@ -41,9 +41,9 @@ builder.Services.AddMemoryCache();
|
||||
builder.Services.AddLogs(builder);
|
||||
builder.Services.AddKeyVault(builder.Configuration);
|
||||
builder.Services.AddBlobStorage(builder.Configuration);
|
||||
builder.Services.AddRedis(builder.Configuration);
|
||||
builder.Services.AddMongoLayer(builder.Configuration);
|
||||
builder.Services.AddSQLServer(builder.Configuration);
|
||||
//builder.Services.AddRedis(builder.Configuration);
|
||||
//builder.Services.AddMongoLayer(builder.Configuration);
|
||||
//builder.Services.AddSQLServer(builder.Configuration);
|
||||
builder.Services.AddDALLayerServices(builder.Configuration);
|
||||
|
||||
builder.Host.ConfigureServices((context, services) =>
|
||||
|
||||
@@ -7,5 +7,22 @@
|
||||
},
|
||||
"CacheSettings": {
|
||||
"DefaultCacheDurationInMinutes": 3
|
||||
},
|
||||
"Vault": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blueprint.KeyVault" Version="0.0.1" />
|
||||
<PackageReference Include="Blueprint.KeyVault" Version="0.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blueprint.Mongo" Version="0.0.2" />
|
||||
<PackageReference Include="Blueprint.Mongo" Version="0.0.3" />
|
||||
<PackageReference Include="Blueprint.Redis" Version="0.0.1" />
|
||||
<PackageReference Include="Mapster" Version="7.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Core.Blueprint.DAL.Storage.Contracts
|
||||
Task<IEnumerable<BlobFileAdapter>> GetBlobsListAsync(string? prefix);
|
||||
Task<Response<BlobContentInfo>> UploadBlobAsync(string blobName, Stream content);
|
||||
Task<BlobFileAdapter> UploadBlobAsync(BlobAddDto newBlob);
|
||||
BlobDownloadUriAdapter DownloadBlobAsync(string blobName);
|
||||
ValueTask<BlobDownloadUriAdapter> DownloadBlobAsync(string blobName);
|
||||
Task<BlobFileAdapter?> DeleteBlobAsync(string fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blueprint.Storage" Version="0.0.1" />
|
||||
<PackageReference Include="Blueprint.Storage" Version="0.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -27,9 +27,9 @@ namespace Core.Blueprint.DAL.Storage.Service
|
||||
return await blobStorageProvider.ListBlobsAsync(prefix);
|
||||
}
|
||||
|
||||
public BlobDownloadUriAdapter DownloadBlobAsync(string blobName)
|
||||
public async ValueTask<BlobDownloadUriAdapter> DownloadBlobAsync(string blobName)
|
||||
{
|
||||
var result = blobStorageProvider.GenerateBlobDownloadUri(blobName);
|
||||
var result = await blobStorageProvider.GenerateBlobDownloadUri(blobName);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user