mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 07:11:10 +00:00
Implements library management update library
This commit is contained in:
1 parent
d0d53fd471
commit
291d1fa329
68 files changed
+1003
-110
No files matched your search
+2
-1
@@ -2,6 +2,7 @@
|
||||
using Lumina.Application.Core.MediaLibrary.Management.Commands.AddLibrary;
|
||||
using Lumina.Application.Core.MediaLibrary.WrittenContentLibrary.BooksLibrary.Books.Commands.AddBook;
|
||||
using Lumina.Contracts.Requests.MediaLibrary.Management;
|
||||
using Lumina.Domain.Common.Enums.MediaLibrary;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
@@ -16,7 +17,7 @@ public static class AddMediaLibraryRequestMapping
|
||||
/// Converts <paramref name="request"/> to <see cref="AddLibraryCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <param name="userId">The Id of the user owning the media library. Required.</param>
|
||||
/// <param name="userId">The Id of the user owning the media library.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static AddLibraryCommand ToCommand(this AddLibraryRequest request, Guid userId)
|
||||
{
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.MediaLibrary.Management.Queries;
|
||||
using Lumina.Contracts.Requests.MediaLibrary.Management;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.MediaLibrary.Management;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="GetLibraryRequest"/>.
|
||||
/// </summary>
|
||||
public static class GetLibraryRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="GetLibraryQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <param name="userId">The Id of the user requesting the media library.</param>
|
||||
/// <returns>The converted query.</returns>
|
||||
public static GetLibraryQuery ToQuery(this GetLibraryRequest request, Guid userId)
|
||||
{
|
||||
return new GetLibraryQuery(
|
||||
request.Id,
|
||||
userId
|
||||
);
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.MediaLibrary.Management.Commands.UpdateLibrary;
|
||||
using Lumina.Contracts.Requests.MediaLibrary.Management;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.MediaLibrary.Management;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="UpdateLibraryRequest"/>.
|
||||
/// </summary>
|
||||
public static class UpdateLibraryRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="UpdateLibraryCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <param name="userId">The Id of the user making the request to update the media library.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static UpdateLibraryCommand ToCommand(this UpdateLibraryRequest request, Guid userId)
|
||||
{
|
||||
return new UpdateLibraryCommand(
|
||||
request.Id,
|
||||
request.UserId,
|
||||
userId,
|
||||
request.Title,
|
||||
request.LibraryType,
|
||||
request.ContentLocations
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user