Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit e14e3f8

Browse files
committed
sketching out storage impl
1 parent 939f9ee commit e14e3f8

7 files changed

Lines changed: 46 additions & 5 deletions

File tree

src/ServiceLayer.Mesh/Functions/FileExtractFunction.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using ServiceLayer.Mesh.Data;
88
using ServiceLayer.Mesh.Messaging;
99
using ServiceLayer.Mesh.Models;
10+
using ServiceLayer.Mesh.Storage;
1011

1112
namespace ServiceLayer.Mesh.Functions;
1213

@@ -15,7 +16,7 @@ public class FileExtractFunction(
1516
IMeshInboxService meshInboxService,
1617
ServiceLayerDbContext serviceLayerDbContext,
1718
IFileTransformQueueClient fileTransformQueueClient,
18-
BlobContainerClient blobContainerClient)
19+
IMeshFilesBlobStore mesFileBlobStore)
1920
{
2021
[Function("FileExtractFunction")]
2122
public async Task Run([QueueTrigger("file-extract")] FileExtractQueueMessage message) // TODO: Queue name
@@ -61,7 +62,7 @@ public async Task Run([QueueTrigger("file-extract")] FileExtractQueueMessage mes
6162
throw new InvalidOperationException($"Mesh extraction failed: {meshResponse.Error}");
6263
}
6364

64-
await UploadFileToBlobStorage(new BlobFile(meshResponse.Response.FileAttachment.Content, mailboxId));
65+
await mesFileBlobStore.UploadAsync(file, meshResponse.Response.FileAttachment.Content);
6566
}
6667

6768
public async Task<bool> UploadFileToBlobStorage(BlobFile blobFile, bool overwrite = false)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace ServiceLayer.Mesh.Functions;
2+
3+
public class FileRetryFunction
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace ServiceLayer.Mesh.Functions;
2+
3+
public class FileTransformFunction
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace ServiceLayer.Mesh.Functions;
2+
3+
public class MeshHandshakeFunction
4+
{
5+
6+
}

src/ServiceLayer.Mesh/ServiceLayer.Mesh.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,4 @@
3939
<Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
4040
<ProjectReference Include="..\dotnet-mesh-client\application\DotNetMeshClient\NHS.Mesh.Client\NHS.Mesh.Client.csproj" />
4141
</ItemGroup>
42-
<ItemGroup>
43-
<Folder Include="Storage\" />
44-
</ItemGroup>
4542
</Project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using ServiceLayer.Mesh.Models;
2+
3+
namespace ServiceLayer.Mesh.Storage;
4+
5+
public interface IMeshFilesBlobStore
6+
{
7+
public Task<Stream> DownloadAsync(MeshFile file);
8+
public Task UploadAsync(MeshFile file, byte[] data);
9+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using ServiceLayer.Mesh.Models;
2+
3+
namespace ServiceLayer.Mesh.Storage;
4+
5+
public class MeshFilesBlobStore : IMeshFilesBlobStore
6+
{
7+
public Task<Stream> DownloadAsync(MeshFile file)
8+
{
9+
throw new NotImplementedException();
10+
}
11+
12+
public Task UploadAsync(MeshFile file, byte[] data)
13+
{
14+
throw new NotImplementedException();
15+
}
16+
}

0 commit comments

Comments
 (0)