QOL Changes
This commit is contained in:
@@ -7,6 +7,8 @@ namespace Musify.Application.Configuration
|
|||||||
public const string SectionName = "Storage";
|
public const string SectionName = "Storage";
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
[MinLength(3)]
|
||||||
|
[MaxLength(63)]
|
||||||
public required string BucketName { get; set; }
|
public required string BucketName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ namespace Musify.Application.PlayLists.Commands.CreatePlayList
|
|||||||
return Result.NotFound($"User with Id {request.UserId} does not exist.");
|
return Result.NotFound($"User with Id {request.UserId} does not exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var imageId = Guid.NewGuid();
|
|
||||||
|
|
||||||
var playList = new PlayList
|
var playList = new PlayList
|
||||||
{
|
{
|
||||||
UserId = request.UserId,
|
UserId = request.UserId,
|
||||||
@@ -40,14 +38,15 @@ namespace Musify.Application.PlayLists.Commands.CreatePlayList
|
|||||||
|
|
||||||
if (request.Picture is not null)
|
if (request.Picture is not null)
|
||||||
{
|
{
|
||||||
playList.OriginalPictureKeyName = $"{imageId}{request.Picture.FileType}";
|
var imageId = Guid.NewGuid();
|
||||||
var imageKeyName = $"{playListConfiguration.Routes.OriginalPictures}/{imageId}{request.Picture.FileType}";
|
var pictureName = $"{imageId}{request.Picture.FileType}";
|
||||||
|
var originalImageStorageKey = Path.Join(playListConfiguration.Routes.OriginalPictures, pictureName);
|
||||||
|
|
||||||
var uploadResult = await storageHandler.UploadFileAsync(
|
var uploadResult = await storageHandler.UploadFileAsync(
|
||||||
request.Picture.FileStream,
|
request.Picture.FileStream,
|
||||||
request.Picture.ContentType,
|
request.Picture.ContentType,
|
||||||
storageConfiguration.BucketName,
|
storageConfiguration.BucketName,
|
||||||
imageKeyName,
|
originalImageStorageKey,
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
|
|
||||||
if (!uploadResult.IsSuccess)
|
if (!uploadResult.IsSuccess)
|
||||||
@@ -57,25 +56,34 @@ namespace Musify.Application.PlayLists.Commands.CreatePlayList
|
|||||||
return Result.Error($"Failed to upload picture for PlayList with Id {playList.Id} to storage.");
|
return Result.Error($"Failed to upload picture for PlayList with Id {playList.Id} to storage.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
playList.OriginalPictureKeyName = pictureName;
|
||||||
logger.LogInformation("Playlist image uploaded successfully for PlayList with Id={PlayListId}.", playList.Id);
|
logger.LogInformation("Playlist image uploaded successfully for PlayList with Id={PlayListId}.", playList.Id);
|
||||||
|
|
||||||
await publishEndpoint.Publish(new ResizePictureEvent(
|
try
|
||||||
storageConfiguration.BucketName,
|
{
|
||||||
imageKeyName,
|
await publishEndpoint.Publish(new ResizePictureEvent(
|
||||||
[
|
storageConfiguration.BucketName,
|
||||||
|
originalImageStorageKey,
|
||||||
|
[
|
||||||
new ResizePictureItems(
|
new ResizePictureItems(
|
||||||
playListConfiguration.PicturesSizes.SmallPictureWidth,
|
playListConfiguration.PicturesSizes.SmallPictureWidth,
|
||||||
playListConfiguration.PicturesSizes.SmallPictureHeight,
|
playListConfiguration.PicturesSizes.SmallPictureHeight,
|
||||||
playListConfiguration.Routes.SmallPictures),
|
playListConfiguration.Routes.SmallPictures),
|
||||||
new ResizePictureItems(
|
new ResizePictureItems(
|
||||||
playListConfiguration.PicturesSizes.MediumPictureWidth,
|
playListConfiguration.PicturesSizes.MediumPictureWidth,
|
||||||
playListConfiguration.PicturesSizes.MediumPictureHeight,
|
playListConfiguration.PicturesSizes.MediumPictureHeight,
|
||||||
playListConfiguration.Routes.MediumPictures),
|
playListConfiguration.Routes.MediumPictures),
|
||||||
new ResizePictureItems(
|
new ResizePictureItems(
|
||||||
playListConfiguration.PicturesSizes.LargePictureWidth,
|
playListConfiguration.PicturesSizes.LargePictureWidth,
|
||||||
playListConfiguration.PicturesSizes.LargePictureHeight,
|
playListConfiguration.PicturesSizes.LargePictureHeight,
|
||||||
playListConfiguration.Routes.LargePictures)
|
playListConfiguration.Routes.LargePictures)
|
||||||
] ), cancellationToken);
|
] ), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish resize picture event for PlayList with id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish resize picture event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Logging;
|
|||||||
using Musify.Application.Configuration;
|
using Musify.Application.Configuration;
|
||||||
using Musify.Application.Contracts.Infrastructure;
|
using Musify.Application.Contracts.Infrastructure;
|
||||||
using Musify.Application.Events;
|
using Musify.Application.Events;
|
||||||
|
using Musify.Application.PlayLists;
|
||||||
|
|
||||||
namespace Musify.Application.PlayLists.Commands.DeletePlayList
|
namespace Musify.Application.PlayLists.Commands.DeletePlayList
|
||||||
{
|
{
|
||||||
@@ -28,26 +29,66 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList
|
|||||||
return Result.Unauthorized();
|
return Result.Unauthorized();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(playList.OriginalPictureKeyName))
|
if (!string.IsNullOrWhiteSpace(playList.OriginalPictureKeyName))
|
||||||
{
|
{
|
||||||
await publishEndpoint.Publish(new RemoveFileEvent(
|
var originalImageStorageKey = Path.Join(playListConfiguration.Routes.OriginalPictures, playList.OriginalPictureKeyName);
|
||||||
storageConfiguration.BucketName,
|
|
||||||
playList.OriginalPictureKeyName), cancellationToken);
|
try
|
||||||
|
{
|
||||||
|
await publishEndpoint.Publish(new RemoveFileEvent(
|
||||||
|
storageConfiguration.BucketName,
|
||||||
|
originalImageStorageKey), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish remove file event for original picture of PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish remove file event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
|
||||||
if (playList.SmallPictureKeyName != playListConfiguration.Routes.PresetSmallPicture)
|
if (playList.SmallPictureKeyName != playListConfiguration.Routes.PresetSmallPicture)
|
||||||
await publishEndpoint.Publish(new RemoveFileEvent(
|
{
|
||||||
storageConfiguration.BucketName,
|
try
|
||||||
playList.SmallPictureKeyName), cancellationToken);
|
{
|
||||||
|
await publishEndpoint.Publish(new RemoveFileEvent(
|
||||||
|
storageConfiguration.BucketName,
|
||||||
|
playList.SmallPictureKeyName), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish remove file event for small picture of PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish remove file event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (playList.MediumPictureKeyName != playListConfiguration.Routes.PresetMediumPicture)
|
if (playList.MediumPictureKeyName != playListConfiguration.Routes.PresetMediumPicture)
|
||||||
await publishEndpoint.Publish(new RemoveFileEvent(
|
{
|
||||||
storageConfiguration.BucketName,
|
try
|
||||||
playList.MediumPictureKeyName), cancellationToken);
|
{
|
||||||
|
await publishEndpoint.Publish(new RemoveFileEvent(
|
||||||
|
storageConfiguration.BucketName,
|
||||||
|
playList.MediumPictureKeyName), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish remove file event for medium picture of PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish remove file event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (playList.LargePictureKeyName != playListConfiguration.Routes.PresetLargePicture)
|
if (playList.LargePictureKeyName != playListConfiguration.Routes.PresetLargePicture)
|
||||||
await publishEndpoint.Publish(new RemoveFileEvent(
|
{
|
||||||
storageConfiguration.BucketName,
|
try
|
||||||
playList.LargePictureKeyName), cancellationToken);
|
{
|
||||||
|
await publishEndpoint.Publish(new RemoveFileEvent(
|
||||||
|
storageConfiguration.BucketName,
|
||||||
|
playList.LargePictureKeyName), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish remove file event for large picture of PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish remove file event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
database.PlayLists.Remove(playList);
|
database.PlayLists.Remove(playList);
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(request.NewName))
|
if (!string.IsNullOrWhiteSpace(request.NewName))
|
||||||
|
{
|
||||||
playList.Name = request.NewName;
|
playList.Name = request.NewName;
|
||||||
|
playList.NormalizedName = request.NewName.Trim().ToUpperInvariant();
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(request.NewDescription))
|
if (!string.IsNullOrWhiteSpace(request.NewDescription))
|
||||||
playList.Description = request.NewDescription;
|
playList.Description = request.NewDescription;
|
||||||
@@ -46,36 +49,78 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
|||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(playList.OriginalPictureKeyName))
|
if (!string.IsNullOrWhiteSpace(playList.OriginalPictureKeyName))
|
||||||
{
|
{
|
||||||
await publishEndpoint.Publish(new RemoveFileEvent(
|
var originalImageStorageKey = Path.Join(playListConfiguration.Routes.OriginalPictures, playList.OriginalPictureKeyName);
|
||||||
storageConfiguration.BucketName,
|
|
||||||
playList.OriginalPictureKeyName), cancellationToken);
|
try
|
||||||
|
{
|
||||||
|
await publishEndpoint.Publish(new RemoveFileEvent(
|
||||||
|
storageConfiguration.BucketName,
|
||||||
|
originalImageStorageKey), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish remove file event for original picture of PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish remove file event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
|
||||||
logger.LogInformation("Published event to remove old picture with key name {KeyName} from bucket {BucketName}",
|
logger.LogInformation("Published event to remove old picture with key name {KeyName} from bucket {BucketName}",
|
||||||
playList.OriginalPictureKeyName, storageConfiguration.BucketName);
|
originalImageStorageKey, storageConfiguration.BucketName);
|
||||||
|
|
||||||
if (playList.SmallPictureKeyName != playListConfiguration.Routes.PresetSmallPicture)
|
if (playList.SmallPictureKeyName != playListConfiguration.Routes.PresetSmallPicture)
|
||||||
await publishEndpoint.Publish(new RemoveFileEvent(
|
{
|
||||||
storageConfiguration.BucketName,
|
try
|
||||||
playList.SmallPictureKeyName), cancellationToken);
|
{
|
||||||
|
await publishEndpoint.Publish(new RemoveFileEvent(
|
||||||
|
storageConfiguration.BucketName,
|
||||||
|
playList.SmallPictureKeyName), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish remove file event for small picture of PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish remove file event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (playList.MediumPictureKeyName != playListConfiguration.Routes.PresetMediumPicture)
|
if (playList.MediumPictureKeyName != playListConfiguration.Routes.PresetMediumPicture)
|
||||||
await publishEndpoint.Publish(new RemoveFileEvent(
|
{
|
||||||
storageConfiguration.BucketName,
|
try
|
||||||
playList.MediumPictureKeyName), cancellationToken);
|
{
|
||||||
|
await publishEndpoint.Publish(new RemoveFileEvent(
|
||||||
|
storageConfiguration.BucketName,
|
||||||
|
playList.MediumPictureKeyName), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish remove file event for medium picture of PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish remove file event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (playList.LargePictureKeyName != playListConfiguration.Routes.PresetLargePicture)
|
if (playList.LargePictureKeyName != playListConfiguration.Routes.PresetLargePicture)
|
||||||
await publishEndpoint.Publish(new RemoveFileEvent(
|
{
|
||||||
storageConfiguration.BucketName,
|
try
|
||||||
playList.LargePictureKeyName), cancellationToken);
|
{
|
||||||
|
await publishEndpoint.Publish(new RemoveFileEvent(
|
||||||
|
storageConfiguration.BucketName,
|
||||||
|
playList.LargePictureKeyName), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish remove file event for large picture of PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish remove file event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var newImageId = Guid.NewGuid();
|
var newImageId = Guid.NewGuid();
|
||||||
var imageKeyName = $"{playListConfiguration.Routes.OriginalPictures}/{newImageId}{request.NewPicture.FileType}";
|
var pictureName = $"{newImageId}{request.NewPicture.FileType}";
|
||||||
|
var newImageStorageKey = Path.Join(playListConfiguration.Routes.OriginalPictures, pictureName);
|
||||||
|
|
||||||
var uploadResult = await storageHandler.UploadFileAsync(
|
var uploadResult = await storageHandler.UploadFileAsync(
|
||||||
request.NewPicture.FileStream,
|
request.NewPicture.FileStream,
|
||||||
request.NewPicture.ContentType,
|
request.NewPicture.ContentType,
|
||||||
storageConfiguration.BucketName,
|
storageConfiguration.BucketName,
|
||||||
imageKeyName,
|
newImageStorageKey,
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
|
|
||||||
if (!uploadResult.IsSuccess)
|
if (!uploadResult.IsSuccess)
|
||||||
@@ -85,30 +130,39 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
|||||||
return Result.Error($"Failed to upload picture for PlayList with Id {playList.Id} to storage.");
|
return Result.Error($"Failed to upload picture for PlayList with Id {playList.Id} to storage.");
|
||||||
}
|
}
|
||||||
|
|
||||||
playList.OriginalPictureKeyName = imageKeyName;
|
playList.OriginalPictureKeyName = pictureName;
|
||||||
await publishEndpoint.Publish(new ResizePictureEvent(
|
|
||||||
storageConfiguration.BucketName,
|
try
|
||||||
imageKeyName,
|
{
|
||||||
[
|
await publishEndpoint.Publish(new ResizePictureEvent(
|
||||||
new ResizePictureItems(
|
storageConfiguration.BucketName,
|
||||||
playListConfiguration.PicturesSizes.SmallPictureWidth,
|
newImageStorageKey,
|
||||||
playListConfiguration.PicturesSizes.SmallPictureHeight,
|
[
|
||||||
playListConfiguration.Routes.SmallPictures),
|
new ResizePictureItems(
|
||||||
new ResizePictureItems(
|
playListConfiguration.PicturesSizes.SmallPictureWidth,
|
||||||
playListConfiguration.PicturesSizes.MediumPictureWidth,
|
playListConfiguration.PicturesSizes.SmallPictureHeight,
|
||||||
playListConfiguration.PicturesSizes.MediumPictureHeight,
|
playListConfiguration.Routes.SmallPictures),
|
||||||
playListConfiguration.Routes.MediumPictures),
|
new ResizePictureItems(
|
||||||
new ResizePictureItems(
|
playListConfiguration.PicturesSizes.MediumPictureWidth,
|
||||||
playListConfiguration.PicturesSizes.LargePictureWidth,
|
playListConfiguration.PicturesSizes.MediumPictureHeight,
|
||||||
playListConfiguration.PicturesSizes.LargePictureHeight,
|
playListConfiguration.Routes.MediumPictures),
|
||||||
playListConfiguration.Routes.LargePictures)
|
new ResizePictureItems(
|
||||||
]
|
playListConfiguration.PicturesSizes.LargePictureWidth,
|
||||||
), cancellationToken);
|
playListConfiguration.PicturesSizes.LargePictureHeight,
|
||||||
|
playListConfiguration.Routes.LargePictures)
|
||||||
|
]
|
||||||
|
), cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
logger.LogError(exception, "Failed to publish resize picture event for PlayList id={PlayListId}.", playList.Id);
|
||||||
|
return Result.Error($"Failed to publish resize picture event for PlayList with id {playList.Id}.");
|
||||||
|
}
|
||||||
|
|
||||||
database.PlayLists.Update(playList);
|
database.PlayLists.Update(playList);
|
||||||
await database.SaveChangesAsync(cancellationToken);
|
await database.SaveChangesAsync(cancellationToken);
|
||||||
|
|
||||||
logger.LogInformation("Updated PlayList with id={PlayListId} and picture key {PictureKeyName}.", playList.Id, imageKeyName);
|
logger.LogInformation("Updated PlayList with id={PlayListId} and picture key {PictureKeyName}.", playList.Id, newImageStorageKey);
|
||||||
return Result.Success(PlayListResponse.FromEntity(playList));
|
return Result.Success(PlayListResponse.FromEntity(playList));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ using Musify.Application.PlayLists.Contracts;
|
|||||||
namespace Musify.Application.PlayLists.Queries.GetPlayListById
|
namespace Musify.Application.PlayLists.Queries.GetPlayListById
|
||||||
{
|
{
|
||||||
public record GetPlayListByIdQuery(Guid Id)
|
public record GetPlayListByIdQuery(Guid Id)
|
||||||
: IRequest<GetPlayListByIdQuery, Result<PlayListResponse>>;
|
: IRequest<GetPlayListByIdQuery, Task<Result<PlayListResponse>>>;
|
||||||
}
|
}
|
||||||
@@ -5,5 +5,5 @@ using Musify.Application.PlayLists.Contracts;
|
|||||||
namespace Musify.Application.PlayLists.Queries.GetPlayLists
|
namespace Musify.Application.PlayLists.Queries.GetPlayLists
|
||||||
{
|
{
|
||||||
public record GetPlayListsQuery(int PageNumber = 1, int PageSize = 10)
|
public record GetPlayListsQuery(int PageNumber = 1, int PageSize = 10)
|
||||||
: IRequest<GetPlayListsQuery, Result<PaginatedPlayListResponse>>;
|
: IRequest<GetPlayListsQuery, Task<Result<PaginatedPlayListResponse>>>;
|
||||||
}
|
}
|
||||||
@@ -9,5 +9,5 @@ namespace Musify.Application.PlayLists.Queries.GetPlayListsByUserId
|
|||||||
string Name = "",
|
string Name = "",
|
||||||
int PageNumber = 1,
|
int PageNumber = 1,
|
||||||
int PageSize = 10)
|
int PageSize = 10)
|
||||||
: IRequest<GetPlayListsByUserIdQuery, Result<PaginatedPlayListResponse>>;
|
: IRequest<GetPlayListsByUserIdQuery, Task<Result<PaginatedPlayListResponse>>>;
|
||||||
}
|
}
|
||||||
+1
-2
@@ -3,7 +3,6 @@ using DispatchR.Abstractions.Send;
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Musify.Application.Contracts.Infrastructure;
|
using Musify.Application.Contracts.Infrastructure;
|
||||||
using Musify.Application.PlayLists.Contracts;
|
using Musify.Application.PlayLists.Contracts;
|
||||||
using Musify.Domain.Entities;
|
|
||||||
using X.PagedList.EF;
|
using X.PagedList.EF;
|
||||||
|
|
||||||
namespace Musify.Application.PlayLists.Queries.GetPlayListsByUserId
|
namespace Musify.Application.PlayLists.Queries.GetPlayListsByUserId
|
||||||
@@ -15,7 +14,7 @@ namespace Musify.Application.PlayLists.Queries.GetPlayListsByUserId
|
|||||||
{
|
{
|
||||||
var pageNumber = request.PageNumber < 1 ? 1 : request.PageNumber;
|
var pageNumber = request.PageNumber < 1 ? 1 : request.PageNumber;
|
||||||
var pageSize = request.PageSize < 1 ? 10 : request.PageSize;
|
var pageSize = request.PageSize < 1 ? 10 : request.PageSize;
|
||||||
var normalizedName = request.Name.Trim().ToUpperInvariant();
|
var normalizedName = request.Name?.Trim().ToUpperInvariant() ?? string.Empty;
|
||||||
|
|
||||||
var playListsQuery = database.PlayLists
|
var playListsQuery = database.PlayLists
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ using Musify.Application.Users.Contracts;
|
|||||||
namespace Musify.Application.Users.Commands.CreateUser
|
namespace Musify.Application.Users.Commands.CreateUser
|
||||||
{
|
{
|
||||||
public record CreateUserCommand(Guid Id)
|
public record CreateUserCommand(Guid Id)
|
||||||
: IRequest<CreateUserCommand, Result<UserResponse>>;
|
: IRequest<CreateUserCommand, Task<Result<UserResponse>>>;
|
||||||
}
|
}
|
||||||
@@ -4,5 +4,5 @@ using DispatchR.Abstractions.Send;
|
|||||||
namespace Musify.Application.Users.Commands.DeleteUser
|
namespace Musify.Application.Users.Commands.DeleteUser
|
||||||
{
|
{
|
||||||
public record DeleteUserCommand(Guid Id)
|
public record DeleteUserCommand(Guid Id)
|
||||||
: IRequest<DeleteUserCommand, Result>;
|
: IRequest<DeleteUserCommand, Task<Result>>;
|
||||||
}
|
}
|
||||||
@@ -7,18 +7,19 @@ namespace Musify.Infrastructure.Configuration
|
|||||||
public const string SectionName = "Storage";
|
public const string SectionName = "Storage";
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
[Url]
|
||||||
public required string ServiceUrl { get; set; }
|
public required string ServiceUrl { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
[MinLength(3)]
|
||||||
public required string AccessKey { get; set; }
|
public required string AccessKey { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
[MinLength(8)]
|
||||||
public required string SecretAccessKey { get; set; }
|
public required string SecretAccessKey { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
public bool ForcePathStyle { get; set; }
|
public bool ForcePathStyle { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
public bool UseHttp { get; set; }
|
public bool UseHttp { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ namespace Musify.Infrastructure.Storage
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
serviceDescriptors.AddScoped<IStorageHandler, StorageHandler>();
|
serviceDescriptors.AddScoped<IStorageHandler, StorageHandler>();
|
||||||
|
|
||||||
return serviceDescriptors;
|
return serviceDescriptors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user