mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
Adds pagination and filtering to the API
This commit is contained in:
1 parent
ad984910a2
commit
ce4ebf36bc
59 files changed
+4423
-242
No files matched your search
@@ -0,0 +1,37 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a paginated response containing a subset of data and pagination metadata for the current page.
|
||||
/// </summary>
|
||||
/// <typeparam name="TData">The type of the data items contained in the paginated response.</typeparam>
|
||||
public sealed record PaginatedResponse<TData>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the collection of data items associated with this instance.
|
||||
/// </summary>
|
||||
public required IReadOnlyList<TData> Data { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current page number in a paginated collection.
|
||||
/// </summary>
|
||||
public required int CurrentPage { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of items to include per page in paginated results.
|
||||
/// </summary>
|
||||
public required int PerPage { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the total number of elements available in the paginated result set.
|
||||
/// </summary>
|
||||
public required int Count { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the total number of pages based on elements available in the result set and per page.
|
||||
/// </summary>
|
||||
public required int NumberOfPages { get; init; }
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a lightweight book response, containing only the properties needed by the client for card-style navigation.
|
||||
/// </summary>
|
||||
/// <param name="Id">The Id of the book.</param>
|
||||
/// <param name="Title">The title of the book.</param>
|
||||
/// <param name="ReleaseYear">The release year of the book (re-release year, if available, or original release year), if known.</param>
|
||||
/// <param name="CoverPath">The path of the image representing the cover of the book, if available.</param>
|
||||
[DebuggerDisplay("Title: {Title}")]
|
||||
public record BookLiteResponse(
|
||||
Guid Id,
|
||||
string Title,
|
||||
int? ReleaseYear,
|
||||
string? CoverPath
|
||||
);
|
||||
Reference in new issue
Block a user