mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 19:11:10 +00:00
Adds the capability of adding a Book via API
This commit is contained in:
1 parent
6459b6f2c2
commit
0eb7b453f6
61 files changed
+1276
-255
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.WrittenContentLibrary.BooksLibrary.Books.Commands;
|
||||
using Lumina.Presentation.Api.Common.Contracts.Books;
|
||||
using Mapster;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Api.Common.Mapping;
|
||||
|
||||
/// <summary>
|
||||
/// Mapping configuration for books.
|
||||
/// </summary>
|
||||
public class BookMappingConfig : IRegister
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Registers the mapping configuration.
|
||||
/// </summary>
|
||||
/// <param name="config">The type adapter configuration.</param>
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
config.NewConfig<AddBookRequest, AddBookCommand>()
|
||||
.Map(dest => dest.ASIN, src => src.ASIN)
|
||||
.Map(dest => dest.ISBNs, src => src.ISBNs)
|
||||
.Map(dest => dest.LCCN, src => src.LCCN)
|
||||
.Map(dest => dest.OCLCNumber, src => src.OCLCNumber)
|
||||
.MapToConstructor(true);
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user