mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-11-01 02:57:04 -04:00
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: Robbie Davis <robbie@therobbiedavis.com> Co-authored-by: Fabian Pammer <fpammer@mantro.net> Co-authored-by: Vinícius Licz <vinilicz@gmail.com>
17 lines
638 B
C#
17 lines
638 B
C#
namespace API.DTOs.Reader;
|
|
|
|
public sealed record BookResourceResultDto
|
|
{
|
|
public bool IsSuccess { get; init; }
|
|
public string ErrorMessage { get; init; }
|
|
public byte[] Content { get; init; }
|
|
public string ContentType { get; init; }
|
|
public string FileName { get; init; }
|
|
|
|
public static BookResourceResultDto Success(byte[] content, string contentType, string fileName) =>
|
|
new() { IsSuccess = true, Content = content, ContentType = contentType, FileName = fileName };
|
|
|
|
public static BookResourceResultDto Error(string errorMessage) =>
|
|
new() { IsSuccess = false, ErrorMessage = errorMessage };
|
|
}
|