Adds in the Web app the required deserialization DTOs for interaction with the books API endpoint

This commit is contained in:
BinaryAlley committed 2024-09-03 19:54:41 +03:00
1 parent 511802948f
commit 0b8b67182c
19 files changed
+521 -6

No files matched your search

@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Models.Common;
using Lumina.Presentation.Web.Common.Enums;
#endregion
namespace Lumina.Presentation.Web.Common.Models.Books;
/// <summary>
/// Represents a book rating.
/// </summary>
public class BookRatingDto : RatingDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the optional source of the rating (e.g., "Goodreads", "Amazon").
/// </summary>
public BookRatingSource? Source { get; set; }
#endregion
}
@@ -0,0 +1,14 @@
namespace Lumina.Presentation.Web.Common.Models.Books;
/// <summary>
/// Represents a request to get book series information.
/// </summary>
public class BookSeriesDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the title of the book series.
/// </summary>
public string? Title { get; set; }
#endregion
}
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums;
#endregion
namespace Lumina.Presentation.Web.Common.Models.Books;
/// <summary>
/// Represents a request to get ISBN information.
/// </summary>
public class IsbnDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the value of the ISBN.
/// </summary>
public string? Value { get; set; }
/// <summary>
/// Gets the format of the ISBN.
/// </summary>
public IsbnFormat? Format { get; set; }
#endregion
}
@@ -0,0 +1,63 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Models.Common;
#endregion
namespace Lumina.Presentation.Web.Common.Models.Books;
/// <summary>
/// Represents written content metadata.
/// </summary>
public class WrittenContentMetadataDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the title of the media item.
/// </summary>
public string? Title { get; set; }
/// <summary>
/// Gets the original title of the media item.
/// </summary>
public string? OriginalTitle { get; set; }
/// <summary>
/// Gets the optional description of the media item.
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Gets the release information of the media item.
/// </summary>
public ReleaseInfoDto? ReleaseInfo { get; set; }
/// <summary>
/// Gets the list of genres associated with the media item.
/// </summary>
public List<GenreDto>? Genres { get; set; }
/// <summary>
/// Gets the list of tags associated with the media item.
/// </summary>
public List<TagDto>? Tags { get; set; }
/// <summary>
/// Gets the optional language of the media item.
/// </summary>
public LanguageInfoDto? Language { get; set; }
/// <summary>
/// Gets the optional original language of the media item.
/// </summary>
public LanguageInfoDto? OriginalLanguage { get; set; }
/// <summary>
/// Gets the publisher of the written content.
/// </summary>
public string? Publisher { get; set; }
/// <summary>
/// Gets the number of pages in the written content.
/// </summary>
public int? PageCount { get; set; }
#endregion
}
@@ -0,0 +1,14 @@
namespace Lumina.Presentation.Web.Common.Models.Common;
/// <summary>
/// Represents a request to get genre information.
/// </summary>
public class GenreDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the name of the genre element of the media item.
/// </summary>
public string? Name { get; set; }
#endregion
}
@@ -0,0 +1,24 @@
namespace Lumina.Presentation.Web.Common.Models.Common;
/// <summary>
/// Represents a request to get language information.
/// </summary>
public class LanguageInfoDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the ISO 639-1 two-letter language code.
/// </summary>
public string? LanguageCode { get; set; }
/// <summary>
/// Gets the full name of the language in English.
/// </summary>
public string? LanguageName { get; set; }
/// <summary>
/// Gets an optional native name of the language.
/// </summary>
public string? NativeName { get; set; }
#endregion
}
@@ -0,0 +1,24 @@
namespace Lumina.Presentation.Web.Common.Models.Common;
/// <summary>
/// Represents a rating.
/// </summary>
public abstract class RatingDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the numeric value of the rating.
/// </summary>
public decimal? Value { get; set; }
/// <summary>
/// Gets the maximum possible rating value.
/// </summary>
public decimal? MaxValue { get; set; }
/// <summary>
/// Gets the optional number of votes or reviews this rating is based on.
/// </summary>
public int? VoteCount { get; set; }
#endregion
}
@@ -0,0 +1,40 @@
namespace Lumina.Presentation.Web.Common.Models.Common;
/// <summary>
/// Represents a request to get release information.
/// </summary>
public class ReleaseInfoDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the optional original release date of the media item.
/// </summary>
public DateOnly? OriginalReleaseDate { get; set; }
/// <summary>
/// Gets the optional original release year of the media item.
/// This is useful when only the year of original release is known.
/// </summary>
public int? OriginalReleaseYear { get; set; }
/// <summary>
/// Gets the optional re-release or reissue date of the media item.
/// </summary>
public DateOnly? ReReleaseDate { get; set; }
/// <summary>
/// Gets the optional re-release or reissue year of the media item.
/// </summary>
public int? ReReleaseYear { get; set; }
/// <summary>
/// Gets the optional country or region of release.
/// </summary>
public string? ReleaseCountry { get; set; }
/// <summary>
/// Gets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0")
/// </summary>
public string? ReleaseVersion { get; set; }
#endregion
}
@@ -0,0 +1,14 @@
namespace Lumina.Presentation.Web.Common.Models.Common;
/// <summary>
/// Represents a request to get tag information.
/// </summary>
public class TagDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the name of the tag element of the media item.
/// </summary>
public string? Name { get; set; }
#endregion
}
@@ -0,0 +1,19 @@
namespace Lumina.Presentation.Web.Common.Models.Contributors;
/// <summary>
/// Represents a media contributor.
/// </summary>
public class MediaContributorDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the name of the contributor.
/// </summary>
public MediaContributorNameDto? Name { get; set; }
/// <summary>
/// Gets the role of the contributor.
/// </summary>
public MediaContributorRoleDto? Role { get; set; }
#endregion
}
@@ -0,0 +1,19 @@
namespace Lumina.Presentation.Web.Common.Models.Contributors;
/// <summary>
/// Represents a media contributor name.
/// </summary>
public class MediaContributorNameDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the name by which the contributor is popularly known.
/// </summary>
public string? DisplayName { get; set; }
/// <summary>
/// Gets the legal name of the contributor.
/// </summary>
public string? LegalName { get; set; }
#endregion
}
@@ -0,0 +1,19 @@
namespace Lumina.Presentation.Web.Common.Models.Contributors;
/// <summary>
/// Represents a media contributor role.
/// </summary>
public class MediaContributorRoleDto
{
#region ==================================================================== PROPERTIES =================================================================================
/// <summary>
/// Gets the value representing this object.
/// </summary>
public string? Name { get; set; }
/// <summary>
/// Gets the category of this object.
/// </summary>
public string? Category { get; set; }
#endregion
}