DDD
This commit is contained in:
+2
-2
@@ -113,7 +113,7 @@ public class S3FileStorageService : IFileStorageService
|
||||
var tempFilePath = Path.GetTempFileName();
|
||||
string contentType = "application/octet-stream";
|
||||
string fileName = fileId;
|
||||
string ivBase64 = null;
|
||||
string ivBase64 = string.Empty;
|
||||
|
||||
var statArgs = new StatObjectArgs().WithBucket(_bucketName).WithObject(fileId);
|
||||
var stat = await _minioClient.StatObjectAsync(statArgs).ConfigureAwait(false);
|
||||
@@ -139,7 +139,7 @@ public class S3FileStorageService : IFileStorageService
|
||||
var msResult = new MemoryStream();
|
||||
using (var fsRead = new FileStream(tempFilePath, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
var iv = Convert.FromBase64String(ivBase64);
|
||||
var iv = string.IsNullOrEmpty(ivBase64) ? new byte[16] : Convert.FromBase64String(ivBase64);
|
||||
using var cryptoStream = _encryptionService.CreateDecryptionStream(fsRead, iv);
|
||||
await cryptoStream.CopyToAsync(msResult);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using MediatR;
|
||||
|
||||
namespace Knot.Shared.Kernel;
|
||||
|
||||
public interface IQuery<TResponse> : IRequest<Result<TResponse>>
|
||||
{
|
||||
}
|
||||
|
||||
public interface IQueryHandler<TQuery, TResponse>
|
||||
: IRequestHandler<TQuery, Result<TResponse>>
|
||||
where TQuery : IQuery<TResponse>
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Knot.Shared.Kernel;
|
||||
|
||||
public record MessageResponse(string Message);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Knot.Shared.Kernel;
|
||||
|
||||
public record SuccessResponse(bool Success);
|
||||
Reference in New Issue
Block a user