Skip to content

Commit

Permalink
Merge pull request #1 from Jay-study-nildana/Jan1st2025Fixes
Browse files Browse the repository at this point in the history
release 1.0.0
  • Loading branch information
Jay-study-nildana authored Jan 1, 2025
2 parents 2a7bc74 + 1e3b980 commit aff4f42
Show file tree
Hide file tree
Showing 155 changed files with 465 additions and 302 deletions.
31 changes: 0 additions & 31 deletions AzureBlobWebAPIDemo.sln

This file was deleted.

15 changes: 0 additions & 15 deletions AzureBlobWebAPIDemo/AzureBlobWebAPIDemo.csproj

This file was deleted.

6 changes: 0 additions & 6 deletions AzureBlobWebAPIDemo/AzureBlobWebAPIDemo.http

This file was deleted.

33 changes: 0 additions & 33 deletions AzureBlobWebAPIDemo/Program.cs

This file was deleted.

19 changes: 0 additions & 19 deletions AzureBlobWebAPIDemo/Services/BlobStorageStuff.cs

This file was deleted.

17 changes: 0 additions & 17 deletions AzureBlobWebAPIDemo/Services/ComputerVisionStuff.cs

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions AzureBlobWebAPIDemo/Services/IServices/ITranslatorStuff.cs

This file was deleted.

17 changes: 0 additions & 17 deletions AzureBlobWebAPIDemo/Services/TranslatorStuff.cs

This file was deleted.

9 changes: 0 additions & 9 deletions AzureBlobWebAPIDemo/appsettings.json

This file was deleted.

14 changes: 0 additions & 14 deletions AzureBlogWebAppDemo/AzureBlogWebAppDemo.csproj

This file was deleted.

3 changes: 0 additions & 3 deletions AzureBlogWebAppDemo/Views/_ViewImports.cshtml

This file was deleted.

31 changes: 31 additions & 0 deletions PhoBlober.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhoBloberWebApp", "PhoBloberWebApp\PhoBloberWebApp.csproj", "{FEB2AC51-AAE3-43E3-BD46-16889C5A0EBF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhoBloberWebAPI", "PhoBloberWebAPI\PhoBloberWebAPI.csproj", "{36E9B93E-CBE9-41AD-B615-5172DBE574B0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FEB2AC51-AAE3-43E3-BD46-16889C5A0EBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FEB2AC51-AAE3-43E3-BD46-16889C5A0EBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FEB2AC51-AAE3-43E3-BD46-16889C5A0EBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FEB2AC51-AAE3-43E3-BD46-16889C5A0EBF}.Release|Any CPU.Build.0 = Release|Any CPU
{36E9B93E-CBE9-41AD-B615-5172DBE574B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36E9B93E-CBE9-41AD-B615-5172DBE574B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36E9B93E-CBE9-41AD-B615-5172DBE574B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36E9B93E-CBE9-41AD-B615-5172DBE574B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {683BD506-211A-475A-B341-524CB324EE03}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Azure.Storage.Blobs;
using AzureBlobWebAPIDemo.DTO;
using PhoBloberWebAPI.DTO;

namespace AzureBlobWebAPIDemo.BlobHelpers
namespace PhoBloberWebAPI.BlobHelpers
{
public class BlobHelperContainer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using Azure;
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Models;
using AzureBlobWebAPIDemo.BlobHelpers;
using AzureBlobWebAPIDemo.DTO;
using AzureBlobWebAPIDemo.Services.IServices;
using PhoBloberWebAPI.BlobHelpers;
using PhoBloberWebAPI.DTO;
using PhoBloberWebAPI.Services.IServices;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using static Azure.Core.HttpHeader;
using PhoBloberWebAPI.Services;

namespace AzureBlobWebAPIDemo.Controllers
namespace PhoBloberWebAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
Expand All @@ -18,29 +19,33 @@ public class BlobController : ControllerBase
private const string Prefix = "";
protected ResponseDto _response;
private readonly IBlobStorageStuff _blobStorageStuff;
private readonly StorageSettingsService _storageSettingsService;

public BlobController(
IBlobStorageStuff blobStorageStuff
IBlobStorageStuff blobStorageStuff,
StorageSettingsService storageSettingsService
)
{
this._response = new ResponseDto();
this._blobStorageStuff = blobStorageStuff;
this._storageSettingsService = storageSettingsService;
}

[HttpPost("CreateNewContainer")]
public async Task<ResponseDto> CreateNewContainer(string containerName)
{
try
{
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys();
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys(_storageSettingsService);

string? storageConnectionString = storageaccesskeys;

// Create a client that can authenticate with a connection string
BlobServiceClient blobServiceClient = new BlobServiceClient(storageConnectionString);

//Create a unique name for the container
containerName += Guid.NewGuid().ToString();
//TODO : turn this back on when you implement automatic container creation for both web api and web app
//containerName += Guid.NewGuid().ToString();

// Create the container and return a container client object
BlobContainerClient containerClient = await blobServiceClient.CreateBlobContainerAsync(containerName);
Expand Down Expand Up @@ -80,7 +85,7 @@ public async Task<ResponseDto> Get()
{
try
{
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys();
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys(_storageSettingsService);
string? storageConnectionString = storageaccesskeys;

// Create a client that can authenticate with a connection string
Expand Down Expand Up @@ -112,7 +117,7 @@ public async Task<ResponseDto> SetContainerPublic(string containerName)
{
try
{
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys();
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys(_storageSettingsService);

string? storageConnectionString = storageaccesskeys;

Expand Down Expand Up @@ -158,7 +163,7 @@ public async Task<ResponseDto> UploadPhoto(PhotoUploadDTO photoUpload)
{
try
{
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys();
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys(_storageSettingsService);

string? storageConnectionString = storageaccesskeys;

Expand Down Expand Up @@ -238,7 +243,7 @@ public async Task<ResponseDto> GetGetAllBlobs(string containerName)
{
try
{
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys();
var storageaccesskeys = _blobStorageStuff.GiveMeAccessKeys(_storageSettingsService);
string? storageConnectionString = storageaccesskeys;

// Create a client that can authenticate with a connection string
Expand Down
Loading

0 comments on commit aff4f42

Please sign in to comment.