[FA-24] Reading lists
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.DTOs;
|
||||
|
||||
public record AddToReadingListInput(int ReadingListId, uint NovelId);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.DTOs;
|
||||
|
||||
public record CreateReadingListInput(string Name, string? Description);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.DTOs;
|
||||
|
||||
public class DeleteReadingListPayload
|
||||
{
|
||||
public bool Success { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using NodaTime;
|
||||
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.DTOs;
|
||||
|
||||
public class ReadingListDto
|
||||
{
|
||||
public int Id { get; init; }
|
||||
public required string Name { get; init; }
|
||||
public string? Description { get; init; }
|
||||
public IEnumerable<ReadingListItemDto> Items { get; init; } = [];
|
||||
public int ItemCount { get; init; }
|
||||
public Instant CreatedTime { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using NodaTime;
|
||||
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.DTOs;
|
||||
|
||||
public class ReadingListItemDto
|
||||
{
|
||||
public uint NovelId { get; init; }
|
||||
public int Order { get; init; }
|
||||
public Instant AddedTime { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.DTOs;
|
||||
|
||||
public class ReadingListPayload
|
||||
{
|
||||
public ReadingListDto? ReadingList { get; init; }
|
||||
public bool Success { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.DTOs;
|
||||
|
||||
public record ReorderReadingListItemInput(int ReadingListId, uint NovelId, int NewOrder);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.DTOs;
|
||||
|
||||
public record UpdateReadingListInput(int Id, string Name, string? Description);
|
||||
@@ -0,0 +1,14 @@
|
||||
using FictionArchive.Service.Shared.Models;
|
||||
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.Database;
|
||||
|
||||
public class ReadingList : BaseEntity<int>
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public virtual User User { get; set; } = null!;
|
||||
|
||||
public required string Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
|
||||
public virtual ICollection<ReadingListItem> Items { get; set; } = new List<ReadingListItem>();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using FictionArchive.Service.Shared.Models;
|
||||
|
||||
namespace FictionArchive.Service.UserNovelDataService.Models.Database;
|
||||
|
||||
public class ReadingListItem : BaseEntity<int>
|
||||
{
|
||||
public int ReadingListId { get; set; }
|
||||
public virtual ReadingList ReadingList { get; set; } = null!;
|
||||
|
||||
public uint NovelId { get; set; }
|
||||
public int Order { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user