Wire SeaweedFS credentials through to the api.core dev container

api.core now waits on seaweedfs and receives its service URL and credentials so the file storage provider can connect.
This commit is contained in:
Aaron Po
2026-08-28 00:33:11 -04:00
parent d2d78b4323
commit 1c2a96c6f2
7 changed files with 64 additions and 53 deletions

View File

@@ -6,8 +6,10 @@ using MediatR;
namespace Features.ImageUploads.Commands.UploadPhoto;
/// <summary>Handles <see cref="UploadPhotoCommand" />.</summary>
public class UploadPhotoHandler(IFileStorageProvider fileStorageProvider, IPhotoUploadRepository photoUploadRepository)
: IRequestHandler<UploadPhotoCommand, Guid>
public class UploadPhotoHandler(
IFileStorageProvider fileStorageProvider,
IPhotoUploadRepository photoUploadRepository
) : IRequestHandler<UploadPhotoCommand, Guid>
{
public async Task<Guid> Handle(UploadPhotoCommand request, CancellationToken cancellationToken)
{
@@ -16,7 +18,6 @@ public class UploadPhotoHandler(IFileStorageProvider fileStorageProvider, IPhoto
await using Stream stream = request.File.OpenReadStream();
await fileStorageProvider.UploadAsync(
key,
stream,
@@ -24,16 +25,9 @@ public class UploadPhotoHandler(IFileStorageProvider fileStorageProvider, IPhoto
cancellationToken
);
Photo photo = new() { Hyperlink = key, UploadedById = request.UploadedById };
Photo photo = new()
{
Hyperlink = key,
UploadedById = request.UploadedById,
};
await photoUploadRepository.CreateAsync(photo,cancellationToken);
await photoUploadRepository.CreateAsync(photo, cancellationToken);
return photoId;
}