mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 11:58:19 +02:00
Use DTOs to return API requests instead of Database Schema types.
Make use of IHttpStatusCodeResults
This commit is contained in:
38
API/Controllers/DTOs/MangaConnectorId.cs
Normal file
38
API/Controllers/DTOs/MangaConnectorId.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using API.Schema.MangaContext;
|
||||
|
||||
namespace API.Controllers.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="MangaConnectorId{T}"/> DTO
|
||||
/// </summary>
|
||||
public sealed record MangaConnectorId(string Key, string MangaConnectorName, string ForeignKey, string? WebsiteUrl, bool UseForDownload) : Identifiable(Key)
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of the Connector
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Description("Name of the Connector")]
|
||||
public string MangaConnectorName { get; init; } = MangaConnectorName;
|
||||
|
||||
/// <summary>
|
||||
/// Key of the referenced DTO
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Description("Key of the referenced DTO")]
|
||||
public string ForeignKey { get; init; } = ForeignKey;
|
||||
|
||||
/// <summary>
|
||||
/// Website Link for reference, if any
|
||||
/// </summary>
|
||||
[Description("Website Link for reference, if any")]
|
||||
public string? WebsiteUrl { get; init; } = WebsiteUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this Link is used for downloads
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Description("Whether this Link is used for downloads")]
|
||||
public bool UseForDownload { get; init; } = UseForDownload;
|
||||
}
|
Reference in New Issue
Block a user