mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add JsonPropertyName attributes to DTO properties for serialization
This commit is contained in:
@@ -23,9 +23,14 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class BaseDto<TKey>
|
||||
{
|
||||
public TKey Id;
|
||||
[JsonPropertyName("id")]
|
||||
[Required]
|
||||
public TKey Id { get; set; }
|
||||
}
|
||||
@@ -23,47 +23,85 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class BasePhotoDto : BaseDto<Guid>
|
||||
{
|
||||
[JsonPropertyName("aperture")]
|
||||
public double? Aperture { get; set; }
|
||||
[JsonPropertyName("author")]
|
||||
public string Author { get; set; }
|
||||
[JsonPropertyName("camera_manufacturer")]
|
||||
public string CameraManufacturer { get; set; }
|
||||
[JsonPropertyName("camera_model")]
|
||||
public string CameraModel { get; set; }
|
||||
[JsonPropertyName("colorspace")]
|
||||
public ColorSpace? ColorSpace { get; set; }
|
||||
[JsonPropertyName("comments")]
|
||||
public string Comments { get; set; }
|
||||
[JsonPropertyName("contrast")]
|
||||
public Contrast? Contrast { get; set; }
|
||||
[JsonPropertyName("creation_date")]
|
||||
public DateTime? CreationDate { get; set; }
|
||||
[JsonPropertyName("digital_zoom")]
|
||||
public double? DigitalZoomRatio { get; set; }
|
||||
[JsonPropertyName("exif_version")]
|
||||
public string ExifVersion { get; set; }
|
||||
[JsonPropertyName("exposure")]
|
||||
public double? ExposureTime { get; set; }
|
||||
[JsonPropertyName("exposure_method")]
|
||||
public ExposureMode? ExposureMethod { get; set; }
|
||||
[JsonPropertyName("exposure_program")]
|
||||
public ExposureProgram? ExposureProgram { get; set; }
|
||||
[JsonPropertyName("flash")]
|
||||
public Flash? Flash { get; set; }
|
||||
[JsonPropertyName("focal")]
|
||||
public double? Focal { get; set; }
|
||||
[JsonPropertyName("focal_length")]
|
||||
public double? FocalLength { get; set; }
|
||||
[JsonPropertyName("focal_equivalent")]
|
||||
public double? FocalLengthEquivalent { get; set; }
|
||||
[JsonPropertyName("horizontal_resolution")]
|
||||
public double? HorizontalResolution { get; set; }
|
||||
[JsonPropertyName("iso")]
|
||||
public ushort? IsoRating { get; set; }
|
||||
[JsonPropertyName("lens")]
|
||||
public string Lens { get; set; }
|
||||
[JsonPropertyName("light_source")]
|
||||
public LightSource? LightSource { get; set; }
|
||||
[JsonPropertyName("metering_mode")]
|
||||
public MeteringMode? MeteringMode { get; set; }
|
||||
[JsonPropertyName("resolution_unit")]
|
||||
public ResolutionUnit? ResolutionUnit { get; set; }
|
||||
[JsonPropertyName("orientation")]
|
||||
public Orientation? Orientation { get; set; }
|
||||
[JsonPropertyName("saturation")]
|
||||
public Saturation? Saturation { get; set; }
|
||||
[JsonPropertyName("scene_capture_type")]
|
||||
public SceneCaptureType? SceneCaptureType { get; set; }
|
||||
[JsonPropertyName("sensing_method")]
|
||||
public SensingMethod? SensingMethod { get; set; }
|
||||
[JsonPropertyName("sharpness")]
|
||||
public Sharpness? Sharpness { get; set; }
|
||||
[JsonPropertyName("software")]
|
||||
public string SoftwareUsed { get; set; }
|
||||
[JsonPropertyName("subject_distance_range")]
|
||||
public SubjectDistanceRange? SubjectDistanceRange { get; set; }
|
||||
[JsonPropertyName("upload_date")]
|
||||
public DateTime UploadDate { get; set; }
|
||||
[JsonPropertyName("vertical_resolution")]
|
||||
public double? VerticalResolution { get; set; }
|
||||
[JsonPropertyName("white_balance")]
|
||||
public WhiteBalance? WhiteBalance { get; set; }
|
||||
[JsonPropertyName("user_id")]
|
||||
public string UserId { get; set; }
|
||||
[JsonPropertyName("license_name")]
|
||||
public string LicenseName { get; set; }
|
||||
[JsonPropertyName("license_id")]
|
||||
public int LicenseId { get; set; }
|
||||
[JsonPropertyName("original_extension")]
|
||||
public string OriginalExtension { get; set; }
|
||||
}
|
||||
@@ -23,24 +23,39 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class BaseScanDto : BaseDto<Guid>
|
||||
{
|
||||
[JsonPropertyName("author")]
|
||||
public string Author { get; set; }
|
||||
[JsonPropertyName("colorspace")]
|
||||
public ColorSpace? ColorSpace { get; set; }
|
||||
[JsonPropertyName("comments")]
|
||||
public string Comments { get; set; }
|
||||
[JsonPropertyName("creation_date")]
|
||||
public DateTime? CreationDate { get; set; }
|
||||
[JsonPropertyName("exif_version")]
|
||||
public string ExifVersion { get; set; }
|
||||
[JsonPropertyName("horizontal_resolution")]
|
||||
public double? HorizontalResolution { get; set; }
|
||||
[JsonPropertyName("resolution_unit")]
|
||||
public ResolutionUnit? ResolutionUnit { get; set; }
|
||||
[JsonPropertyName("scanner_manufacturer")]
|
||||
public string ScannerManufacturer { get; set; }
|
||||
[JsonPropertyName("scanner_model")]
|
||||
public string ScannerModel { get; set; }
|
||||
[JsonPropertyName("software")]
|
||||
public string SoftwareUsed { get; set; }
|
||||
[JsonPropertyName("upload_date")]
|
||||
public DateTime UploadDate { get; set; }
|
||||
[JsonPropertyName("vertical_resolution")]
|
||||
public double? VerticalResolution { get; set; }
|
||||
[JsonPropertyName("original_extension")]
|
||||
public string OriginalExtension { get; set; }
|
||||
[JsonPropertyName("user_id")]
|
||||
public string UserId { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class BookByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("book_id")]
|
||||
public long BookId { get; set; }
|
||||
[JsonPropertyName("book")]
|
||||
public string Book { get; set; }
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("machine")]
|
||||
public string Machine { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class BookByMachineFamilyDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("book_id")]
|
||||
public long BookId { get; set; }
|
||||
[JsonPropertyName("book")]
|
||||
public string Book { get; set; }
|
||||
[JsonPropertyName("machine_family_id")]
|
||||
public int MachineFamilyId { get; set; }
|
||||
[JsonPropertyName("machine_family")]
|
||||
public string MachineFamily { get; set; }
|
||||
}
|
||||
@@ -1,10 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class BookDto : DocumentBaseDto
|
||||
{
|
||||
[JsonPropertyName("isbn")]
|
||||
public string Isbn { get; set; }
|
||||
[JsonPropertyName("pages")]
|
||||
public short? Pages { get; set; }
|
||||
[JsonPropertyName("edition")]
|
||||
public int? Edition { get; set; }
|
||||
[JsonPropertyName("previous_id")]
|
||||
public long? PreviousId { get; set; }
|
||||
[JsonPropertyName("source_id")]
|
||||
public long? SourceId { get; set; }
|
||||
}
|
||||
@@ -23,10 +23,14 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class BookScanDto : DocumentScanBaseDto
|
||||
{
|
||||
[JsonPropertyName("book_id")]
|
||||
public long BookId { get; set; }
|
||||
[JsonPropertyName("book")]
|
||||
public string Book { get; set; }
|
||||
}
|
||||
@@ -23,13 +23,20 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CompanyByBookDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
[JsonPropertyName("book_id")]
|
||||
public long BookId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
}
|
||||
@@ -23,13 +23,20 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CompanyByDocumentDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
[JsonPropertyName("document_id")]
|
||||
public long DocumentId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
}
|
||||
@@ -23,13 +23,20 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CompanyByMagazineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
[JsonPropertyName("magazine_id")]
|
||||
public long MagazineId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
}
|
||||
@@ -23,13 +23,20 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CompanyBySoftwareFamilyDto : BaseDto<ulong>
|
||||
{
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
[JsonPropertyName("software_family_id")]
|
||||
public ulong SoftwareFamilyId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
}
|
||||
@@ -23,13 +23,20 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CompanyBySoftwareVariantDto : BaseDto<ulong>
|
||||
{
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
[JsonPropertyName("software_variant_id")]
|
||||
public ulong SoftwareVariantId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
}
|
||||
@@ -23,13 +23,20 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CompanyBySoftwareVersionDto : BaseDto<ulong>
|
||||
{
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
[JsonPropertyName("software_version_id")]
|
||||
public ulong SoftwareVersionId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
}
|
||||
@@ -23,11 +23,16 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CompanyDescriptionDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("markdown")]
|
||||
public string Markdown { get; set; }
|
||||
[JsonPropertyName("html")]
|
||||
public string Html { get; set; }
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
}
|
||||
@@ -23,34 +23,58 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CompanyDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("founded")]
|
||||
public DateTime? Founded { get; set; }
|
||||
[JsonPropertyName("website")]
|
||||
public string Website { get; set; }
|
||||
[JsonPropertyName("twitter")]
|
||||
public string Twitter { get; set; }
|
||||
[JsonPropertyName("facebook")]
|
||||
public string Facebook { get; set; }
|
||||
[JsonPropertyName("sold")]
|
||||
public DateTime? Sold { get; set; }
|
||||
[JsonPropertyName("sold_to_id")]
|
||||
public int? SoldToId { get; set; }
|
||||
[JsonPropertyName("address")]
|
||||
public string Address { get; set; }
|
||||
[JsonPropertyName("city")]
|
||||
public string City { get; set; }
|
||||
[JsonPropertyName("province")]
|
||||
public string Province { get; set; }
|
||||
[JsonPropertyName("postal_code")]
|
||||
public string PostalCode { get; set; }
|
||||
[JsonPropertyName("country_id")]
|
||||
public short? CountryId { get; set; }
|
||||
[JsonPropertyName("status")]
|
||||
public CompanyStatus Status { get; set; }
|
||||
[JsonPropertyName("last_logo")]
|
||||
public Guid? LastLogo { get; set; }
|
||||
[JsonPropertyName("sold_to")]
|
||||
public string SoldTo { get; set; }
|
||||
[JsonPropertyName("country")]
|
||||
public string Country { get; set; }
|
||||
[JsonPropertyName("founded_day_is_unknown")]
|
||||
public bool FoundedDayIsUnknown { get; set; }
|
||||
[JsonPropertyName("founded_month_is_unknown")]
|
||||
public bool FoundedMonthIsUnknown { get; set; }
|
||||
[JsonPropertyName("sold_day_is_unknown")]
|
||||
public bool SoldDayIsUnknown { get; set; }
|
||||
[JsonPropertyName("sold_month_is_unknown")]
|
||||
public bool SoldMonthIsUnknown { get; set; }
|
||||
[JsonPropertyName("legal_name")]
|
||||
public string LegalName { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SoldView => Status != CompanyStatus.Active && Status != CompanyStatus.Unknown
|
||||
? Sold?.ToShortDateString() ?? "Unknown"
|
||||
: Sold?.ToShortDateString() ?? (SoldTo is null ? "" : "Unknown");
|
||||
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CurrencyInflationDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("code")]
|
||||
public string CurrencyCode { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string CurrencyName { get; set; }
|
||||
[JsonPropertyName("year")]
|
||||
public uint Year { get; set; }
|
||||
[JsonPropertyName("inflation")]
|
||||
public float Inflation { get; set; }
|
||||
}
|
||||
@@ -23,15 +23,24 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class CurrencyPeggingDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("source_code")]
|
||||
public string SourceCode { get; set; }
|
||||
[JsonPropertyName("destination_code")]
|
||||
public string DestinationCode { get; set; }
|
||||
[JsonPropertyName("source_name")]
|
||||
public string SourceName { get; set; }
|
||||
[JsonPropertyName("destination_name")]
|
||||
public string DestinationName { get; set; }
|
||||
[JsonPropertyName("ratio")]
|
||||
public float Ratio { get; set; }
|
||||
[JsonPropertyName("start")]
|
||||
public DateTime Start { get; set; }
|
||||
[JsonPropertyName("end")]
|
||||
public DateTime? End { get; set; }
|
||||
}
|
||||
@@ -1,11 +1,19 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public abstract class DocumentBaseDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonPropertyName("native_title")]
|
||||
public string NativeTitle { get; set; }
|
||||
[JsonPropertyName("published")]
|
||||
public DateTime? Published { get; set; }
|
||||
[JsonPropertyName("country_id")]
|
||||
public short? CountryId { get; set; }
|
||||
[JsonPropertyName("country")]
|
||||
public string Country { get; set; }
|
||||
[JsonPropertyName("synopsis")]
|
||||
public string Synopsis { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class DocumentByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("document_id")]
|
||||
public long DocumentId { get; set; }
|
||||
[JsonPropertyName("document")]
|
||||
public string Document { get; set; }
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("machine")]
|
||||
public string Machine { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class DocumentByMachineFamilyDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("document_id")]
|
||||
public long DocumentId { get; set; }
|
||||
[JsonPropertyName("document")]
|
||||
public string Document { get; set; }
|
||||
[JsonPropertyName("machine_family_id")]
|
||||
public int MachineFamilyId { get; set; }
|
||||
[JsonPropertyName("machine_family")]
|
||||
public string MachineFamily { get; set; }
|
||||
}
|
||||
@@ -24,13 +24,17 @@
|
||||
*******************************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class DocumentCompanyDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[DisplayName("Linked company")]
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("company_id")]
|
||||
public int? CompanyId { get; set; }
|
||||
}
|
||||
@@ -23,16 +23,25 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class DocumentPersonDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("person")]
|
||||
public string Person { get; set; }
|
||||
[JsonPropertyName("person_id")]
|
||||
public int? PersonId { get; set; }
|
||||
[JsonPropertyName("alias")]
|
||||
public string Alias { get; set; }
|
||||
[JsonPropertyName("surname")]
|
||||
public string Surname { get; set; }
|
||||
[JsonPropertyName("display_name")]
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}";
|
||||
}
|
||||
@@ -23,10 +23,14 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class DocumentRoleDto : BaseDto<string>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("enabled")]
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,15 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class DocumentScanBaseDto : BaseScanDto
|
||||
{
|
||||
[JsonPropertyName("type")]
|
||||
public DocumentScanType Type { get; set; }
|
||||
[JsonPropertyName("page")]
|
||||
public uint? Page { get; set; }
|
||||
}
|
||||
@@ -23,10 +23,14 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class DocumentScanDto : DocumentScanBaseDto
|
||||
{
|
||||
[JsonPropertyName("document_id")]
|
||||
public long DocumentId { get; set; }
|
||||
[JsonPropertyName("document")]
|
||||
public string Document { get; set; }
|
||||
}
|
||||
@@ -23,16 +23,26 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class DumpDto : BaseDto<ulong>
|
||||
{
|
||||
[JsonPropertyName("dumper")]
|
||||
public string Dumper { get; set; }
|
||||
[JsonPropertyName("user_id")]
|
||||
public string UserId { get; set; }
|
||||
[JsonPropertyName("dumping_group")]
|
||||
public string DumpingGroup { get; set; }
|
||||
[JsonPropertyName("dump_date")]
|
||||
public DateTime? DumpDate { get; set; }
|
||||
[JsonPropertyName("username")]
|
||||
public string UserName { get; set; }
|
||||
[JsonPropertyName("media_id")]
|
||||
public ulong MediaId { get; set; }
|
||||
[JsonPropertyName("media_title")]
|
||||
public string MediaTitle { get; set; }
|
||||
[JsonPropertyName("media_dump_id")]
|
||||
public ulong MediaDumpId { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class GpuByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("gpu_id")]
|
||||
public int GpuId { get; set; }
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string CompanyName { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@@ -23,20 +23,32 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class GpuDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("company_id")]
|
||||
public int? CompanyId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("model_code")]
|
||||
public string ModelCode { get; set; }
|
||||
[JsonPropertyName("introduced")]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[JsonPropertyName("package")]
|
||||
public string Package { get; set; }
|
||||
[JsonPropertyName("process")]
|
||||
public string Process { get; set; }
|
||||
[JsonPropertyName("process_nm")]
|
||||
public float? ProcessNm { get; set; }
|
||||
[JsonPropertyName("die_size")]
|
||||
public float? DieSize { get; set; }
|
||||
[JsonPropertyName("transistors")]
|
||||
public long? Transistors { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown";
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class InstructionSetExtensionByProcessorDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("extensions")]
|
||||
public string Extension { get; set; }
|
||||
[JsonPropertyName("processor")]
|
||||
public string Processor { get; set; }
|
||||
[JsonPropertyName("processor_id")]
|
||||
public int ProcessorId { get; set; }
|
||||
[JsonPropertyName("extension_id")]
|
||||
public int ExtensionId { get; set; }
|
||||
}
|
||||
@@ -23,27 +23,39 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MachineDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("model")]
|
||||
public string Model { get; set; }
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
[JsonPropertyName("company_logo")]
|
||||
public Guid? CompanyLogo { get; set; }
|
||||
[JsonPropertyName("introduced")]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[JsonPropertyName("family_id")]
|
||||
public int? FamilyId { get; set; }
|
||||
[JsonPropertyName("family_name")]
|
||||
public string FamilyName { get; set; }
|
||||
public List<GpuDto> Gpus { get; set; }
|
||||
public List<MemoryDto> Memory { get; set; }
|
||||
public List<ProcessorDto> Processors { get; set; }
|
||||
public List<SoundSynthDto> SoundSynthesizers { get; set; }
|
||||
public List<StorageDto> Storage { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("type")]
|
||||
public MachineType Type { get; set; }
|
||||
[JsonPropertyName("family")]
|
||||
public string Family { get; set; }
|
||||
[JsonIgnore]
|
||||
public string IntroducedView =>
|
||||
Introduced?.Year == 1000 ? "Prototype" : Introduced?.ToShortDateString() ?? "Unknown";
|
||||
}
|
||||
@@ -23,11 +23,16 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MachineFamilyDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("company")]
|
||||
public string Company { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("company_id")]
|
||||
public int CompanyId { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MachinePhotoDto : BasePhotoDto
|
||||
{
|
||||
[JsonPropertyName("source")]
|
||||
public string Source { get; set; }
|
||||
[JsonPropertyName("machine_name")]
|
||||
public string MachineName { get; set; }
|
||||
[JsonPropertyName("machine_company_name")]
|
||||
public string MachineCompanyName { get; set; }
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MagazineByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("magazine_id")]
|
||||
public long MagazineId { get; set; }
|
||||
[JsonPropertyName("magazine")]
|
||||
public string Magazine { get; set; }
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("machine")]
|
||||
public string Machine { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MagazineByMachineFamilyDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("magazine_id")]
|
||||
public long MagazineId { get; set; }
|
||||
[JsonPropertyName("magazine")]
|
||||
public string Magazine { get; set; }
|
||||
[JsonPropertyName("machine_family_id")]
|
||||
public int MachineFamilyId { get; set; }
|
||||
[JsonPropertyName("machine_family")]
|
||||
public string MachineFamily { get; set; }
|
||||
}
|
||||
@@ -23,10 +23,14 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MagazineDto : DocumentBaseDto
|
||||
{
|
||||
[JsonPropertyName("issn")]
|
||||
public string Issn { get; set; }
|
||||
[JsonPropertyName("first_publication")]
|
||||
public DateTime? FirstPublication { get; set; }
|
||||
}
|
||||
@@ -23,16 +23,26 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MagazineIssueDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("magazine_id")]
|
||||
public long MagazineId { get; set; }
|
||||
[JsonPropertyName("magazine_title")]
|
||||
public string MagazineTitle { get; set; }
|
||||
[JsonPropertyName("caption")]
|
||||
public string Caption { get; set; }
|
||||
[JsonPropertyName("native_caption")]
|
||||
public string NativeCaption { get; set; }
|
||||
[JsonPropertyName("published")]
|
||||
public DateTime? Published { get; set; }
|
||||
[JsonPropertyName("product_code")]
|
||||
public string ProductCode { get; set; }
|
||||
[JsonPropertyName("pages")]
|
||||
public short? Pages { get; set; }
|
||||
[JsonPropertyName("issue_number")]
|
||||
public uint? IssueNumber { get; set; }
|
||||
}
|
||||
@@ -23,10 +23,14 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MagazineScanDto : DocumentScanBaseDto
|
||||
{
|
||||
[JsonPropertyName("magazine_id")]
|
||||
public long MagazineId { get; set; }
|
||||
[JsonPropertyName("magazine")]
|
||||
public string Magazine { get; set; }
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Aaru.CommonTypes;
|
||||
using Marechai.Database;
|
||||
using Marechai.Database.Models;
|
||||
@@ -31,29 +32,54 @@ namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MediaDto : BaseDto<ulong>
|
||||
{
|
||||
[JsonPropertyName("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonPropertyName("sequence")]
|
||||
public ushort? Sequence { get; set; }
|
||||
[JsonPropertyName("last_sequence")]
|
||||
public ushort? LastSequence { get; set; }
|
||||
[JsonPropertyName("type")]
|
||||
public MediaType Type { get; set; }
|
||||
[JsonPropertyName("write_offset")]
|
||||
public int? WriteOffset { get; set; }
|
||||
[JsonPropertyName("sides")]
|
||||
public ushort? Sides { get; set; }
|
||||
[JsonPropertyName("layers")]
|
||||
public ushort? Layers { get; set; }
|
||||
[JsonPropertyName("sessions")]
|
||||
public ushort? Sessions { get; set; }
|
||||
[JsonPropertyName("tracks")]
|
||||
public ushort? Tracks { get; set; }
|
||||
[JsonPropertyName("sectors")]
|
||||
public ulong Sectors { get; set; }
|
||||
[JsonPropertyName("size")]
|
||||
public ulong Size { get; set; }
|
||||
[JsonPropertyName("copy_protection")]
|
||||
public string CopyProtection { get; set; }
|
||||
[JsonPropertyName("part_number")]
|
||||
public string PartNumber { get; set; }
|
||||
[JsonPropertyName("serial_number")]
|
||||
public string SerialNumber { get; set; }
|
||||
[JsonPropertyName("barcode")]
|
||||
public string Barcode { get; set; }
|
||||
[JsonPropertyName("catalogue_number")]
|
||||
public string CatalogueNumber { get; set; }
|
||||
[JsonPropertyName("manufacturer")]
|
||||
public string Manufacturer { get; set; }
|
||||
[JsonPropertyName("model")]
|
||||
public string Model { get; set; }
|
||||
[JsonPropertyName("revision")]
|
||||
public string Revision { get; set; }
|
||||
[JsonPropertyName("firmware")]
|
||||
public string Firmware { get; set; }
|
||||
[JsonPropertyName("physical_block_size")]
|
||||
public int? PhysicalBlockSize { get; set; }
|
||||
[JsonPropertyName("logical_block_size")]
|
||||
public int? LogicalBlockSize { get; set; }
|
||||
[JsonPropertyName("block_sizes")]
|
||||
public VariableBlockSize[] BlockSizes { get; set; }
|
||||
[JsonPropertyName("storage_interface")]
|
||||
public StorageInterface? StorageInterface { get; set; }
|
||||
[JsonPropertyName("table_of_contents")]
|
||||
public OpticalDiscTrack[] TableOfContents { get; set; }
|
||||
}
|
||||
@@ -23,15 +23,21 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MemoryByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("type")]
|
||||
public MemoryType Type { get; set; }
|
||||
[JsonPropertyName("usage")]
|
||||
public MemoryUsage Usage { get; set; }
|
||||
[JsonPropertyName("size")]
|
||||
public long? Size { get; set; }
|
||||
[JsonPropertyName("speed")]
|
||||
public double? Speed { get; set; }
|
||||
}
|
||||
@@ -23,14 +23,19 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class MemoryDto
|
||||
{
|
||||
[JsonPropertyName("type")]
|
||||
public MemoryType Type { get; set; }
|
||||
[JsonPropertyName("usage")]
|
||||
public MemoryUsage Usage { get; set; }
|
||||
[JsonPropertyName("size")]
|
||||
public long? Size { get; set; }
|
||||
[JsonPropertyName("speed")]
|
||||
public double? Speed { get; set; }
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
@@ -40,10 +41,16 @@ public sealed class NewsDto : BaseDto<int>
|
||||
ItemName = itemName;
|
||||
}
|
||||
|
||||
[JsonPropertyName("type")]
|
||||
public NewsType Type { get; set; }
|
||||
[JsonPropertyName("affected_id")]
|
||||
public int AffectedId { get; set; }
|
||||
[JsonPropertyName("controller")]
|
||||
public string Controller { get; }
|
||||
[JsonPropertyName("item_name")]
|
||||
public string ItemName { get; }
|
||||
[JsonPropertyName("text")]
|
||||
public string Text { get; }
|
||||
[JsonPropertyName("timestamp")]
|
||||
public DateTime Timestamp { get; set; }
|
||||
}
|
||||
@@ -23,18 +23,28 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class PersonByBookDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("person_id")]
|
||||
public int PersonId { get; set; }
|
||||
[JsonPropertyName("book_id")]
|
||||
public long BookId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("alias")]
|
||||
public string Alias { get; set; }
|
||||
[JsonPropertyName("surname")]
|
||||
public string Surname { get; set; }
|
||||
[JsonPropertyName("display_name")]
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}";
|
||||
}
|
||||
@@ -23,18 +23,28 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class PersonByDocumentDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("person_id")]
|
||||
public int PersonId { get; set; }
|
||||
[JsonPropertyName("document_id")]
|
||||
public long DocumentId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("alias")]
|
||||
public string Alias { get; set; }
|
||||
[JsonPropertyName("surname")]
|
||||
public string Surname { get; set; }
|
||||
[JsonPropertyName("display_name")]
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}";
|
||||
}
|
||||
@@ -23,18 +23,28 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class PersonByMagazineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("person_id")]
|
||||
public int PersonId { get; set; }
|
||||
[JsonPropertyName("magazine_id")]
|
||||
public long MagazineId { get; set; }
|
||||
[JsonPropertyName("role_id")]
|
||||
public string RoleId { get; set; }
|
||||
[JsonPropertyName("role")]
|
||||
public string Role { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("alias")]
|
||||
public string Alias { get; set; }
|
||||
[JsonPropertyName("surname")]
|
||||
public string Surname { get; set; }
|
||||
[JsonPropertyName("display_name")]
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}";
|
||||
}
|
||||
@@ -23,22 +23,36 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class PersonDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("surname")]
|
||||
public string Surname { get; set; }
|
||||
[JsonPropertyName("country")]
|
||||
public string CountryOfBirth { get; set; }
|
||||
[JsonPropertyName("birthdate")]
|
||||
public DateTime BirthDate { get; set; }
|
||||
[JsonPropertyName("death_date")]
|
||||
public DateTime? DeathDate { get; set; }
|
||||
[JsonPropertyName("webpage")]
|
||||
public string Webpage { get; set; }
|
||||
[JsonPropertyName("twitter")]
|
||||
public string Twitter { get; set; }
|
||||
[JsonPropertyName("facebook")]
|
||||
public string Facebook { get; set; }
|
||||
[JsonPropertyName("photo")]
|
||||
public Guid Photo { get; set; }
|
||||
[JsonPropertyName("alias")]
|
||||
public string Alias { get; set; }
|
||||
[JsonPropertyName("display_name")]
|
||||
public string DisplayName { get; set; }
|
||||
[JsonPropertyName("country_id")]
|
||||
public short? CountryOfBirthId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}";
|
||||
}
|
||||
@@ -23,13 +23,20 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class ProcessorByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("processor_id")]
|
||||
public int ProcessorId { get; set; }
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string CompanyName { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("speed")]
|
||||
public float? Speed { get; set; }
|
||||
}
|
||||
@@ -23,38 +23,68 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class ProcessorDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string CompanyName { get; set; }
|
||||
[JsonPropertyName("model_code")]
|
||||
public string ModelCode { get; set; }
|
||||
[JsonPropertyName("introduced")]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[JsonPropertyName("speed")]
|
||||
public double? Speed { get; set; }
|
||||
[JsonPropertyName("package")]
|
||||
public string Package { get; set; }
|
||||
[JsonPropertyName("gprs")]
|
||||
public int? Gprs { get; set; }
|
||||
[JsonPropertyName("gpr_size")]
|
||||
public int? GprSize { get; set; }
|
||||
[JsonPropertyName("fprs")]
|
||||
public int? Fprs { get; set; }
|
||||
[JsonPropertyName("fpr_size")]
|
||||
public int? FprSize { get; set; }
|
||||
[JsonPropertyName("cores")]
|
||||
public int? Cores { get; set; }
|
||||
[JsonPropertyName("threads_per_core")]
|
||||
public int? ThreadsPerCore { get; set; }
|
||||
[JsonPropertyName("process")]
|
||||
public string Process { get; set; }
|
||||
[JsonPropertyName("process_nm")]
|
||||
public float? ProcessNm { get; set; }
|
||||
[JsonPropertyName("die_size")]
|
||||
public float? DieSize { get; set; }
|
||||
[JsonPropertyName("transistors")]
|
||||
public long? Transistors { get; set; }
|
||||
[JsonPropertyName("data_bus")]
|
||||
public int? DataBus { get; set; }
|
||||
[JsonPropertyName("address_bus")]
|
||||
public int? AddrBus { get; set; }
|
||||
[JsonPropertyName("simd_registers")]
|
||||
public int? SimdRegisters { get; set; }
|
||||
[JsonPropertyName("simd_size")]
|
||||
public int? SimdSize { get; set; }
|
||||
[JsonPropertyName("l1_instruction")]
|
||||
public float? L1Instruction { get; set; }
|
||||
[JsonPropertyName("l1_data")]
|
||||
public float? L1Data { get; set; }
|
||||
[JsonPropertyName("l2")]
|
||||
public float? L2 { get; set; }
|
||||
[JsonPropertyName("l3")]
|
||||
public float? L3 { get; set; }
|
||||
[JsonPropertyName("instruction_set")]
|
||||
public string InstructionSet { get; set; }
|
||||
[JsonPropertyName("instruction_set_extensions")]
|
||||
public List<string> InstructionSetExtensions { get; set; }
|
||||
[JsonPropertyName("company_id")]
|
||||
public int? CompanyId { get; set; }
|
||||
[JsonPropertyName("instruction_set_id")]
|
||||
public int? InstructionSetId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown";
|
||||
}
|
||||
@@ -23,11 +23,16 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class ResolutionByGpuDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("resolution_id")]
|
||||
public int ResolutionId { get; set; }
|
||||
[JsonPropertyName("gpu_id")]
|
||||
public int GpuId { get; set; }
|
||||
[JsonPropertyName("resolution")]
|
||||
public ResolutionDto Resolution { get; set; }
|
||||
}
|
||||
@@ -23,11 +23,16 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class ResolutionByScreenDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("resolution_id")]
|
||||
public int ResolutionId { get; set; }
|
||||
[JsonPropertyName("screen_id")]
|
||||
public int ScreenId { get; set; }
|
||||
[JsonPropertyName("resolution")]
|
||||
public ResolutionDto Resolution { get; set; }
|
||||
}
|
||||
@@ -23,17 +23,25 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class ResolutionDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("width")]
|
||||
public int Width { get; set; }
|
||||
[JsonPropertyName("height")]
|
||||
public int Height { get; set; }
|
||||
[JsonPropertyName("colors")]
|
||||
public long? Colors { get; set; }
|
||||
[JsonPropertyName("palette")]
|
||||
public long? Palette { get; set; }
|
||||
[JsonPropertyName("chars")]
|
||||
public bool Chars { get; set; }
|
||||
[JsonPropertyName("grayscale")]
|
||||
public bool Grayscale { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public long? PaletteView => Palette ?? Colors;
|
||||
|
||||
public override string ToString()
|
||||
|
||||
@@ -23,11 +23,16 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class ScreenByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("screen")]
|
||||
public ScreenDto Screen { get; set; }
|
||||
[JsonPropertyName("screen_id")]
|
||||
public int ScreenId { get; set; }
|
||||
}
|
||||
@@ -23,18 +23,27 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class ScreenDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("width")]
|
||||
public double? Width { get; set; }
|
||||
[JsonPropertyName("height")]
|
||||
public double? Height { get; set; }
|
||||
[JsonPropertyName("diagonal")]
|
||||
public double Diagonal { get; set; }
|
||||
[JsonPropertyName("native_resolution_id")]
|
||||
public int NativeResolutionId { get; set; }
|
||||
[JsonPropertyName("native_resolution")]
|
||||
public ResolutionDto NativeResolution { get; set; }
|
||||
[JsonPropertyName("effective_colors")]
|
||||
public long? EffectiveColors { get; set; }
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public long? Colors => EffectiveColors ?? NativeResolution.Colors;
|
||||
|
||||
public string Size
|
||||
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class SoftwareFamilyDto : BaseDto<ulong>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("introduced")]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[JsonPropertyName("parent")]
|
||||
public string Parent { get; set; }
|
||||
[JsonPropertyName("parent_id")]
|
||||
public ulong? ParentId { get; set; }
|
||||
}
|
||||
@@ -23,26 +23,43 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class SoftwareVariantDto : BaseDto<ulong>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("version")]
|
||||
public string Version { get; set; }
|
||||
[JsonPropertyName("introduced")]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[JsonPropertyName("parent_id")]
|
||||
public ulong? ParentId { get; set; }
|
||||
[JsonPropertyName("parent")]
|
||||
public string Parent { get; set; }
|
||||
[JsonPropertyName("version_id")]
|
||||
public ulong SoftwareVersionId { get; set; }
|
||||
[JsonPropertyName("version")]
|
||||
public string SoftwareVersion { get; set; }
|
||||
[JsonPropertyName("minimum_memory")]
|
||||
public ulong? MinimumMemory { get; set; }
|
||||
[JsonPropertyName("recommended_memory")]
|
||||
public ulong? RecommendedMemory { get; set; }
|
||||
[JsonPropertyName("required_storage")]
|
||||
public ulong? RequiredStorage { get; set; }
|
||||
[JsonPropertyName("part_number")]
|
||||
public string PartNumber { get; set; }
|
||||
[JsonPropertyName("serial_number")]
|
||||
public string SerialNumber { get; set; }
|
||||
[JsonPropertyName("product_code")]
|
||||
public string ProductCode { get; set; }
|
||||
[JsonPropertyName("catalogue_number")]
|
||||
public string CatalogueNumber { get; set; }
|
||||
[JsonPropertyName("distribution_mode")]
|
||||
public DistributionMode DistributionMode { get; set; }
|
||||
[JsonPropertyName("family")]
|
||||
public string Family { get; set; }
|
||||
}
|
||||
@@ -23,18 +23,30 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class SoftwareVersionDto : BaseDto<ulong>
|
||||
{
|
||||
[JsonPropertyName("family")]
|
||||
public string Family { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("codename")]
|
||||
public string Codename { get; set; }
|
||||
[JsonPropertyName("version")]
|
||||
public string Version { get; set; }
|
||||
[JsonPropertyName("introduced")]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[JsonPropertyName("previous")]
|
||||
public string Previous { get; set; }
|
||||
[JsonPropertyName("license")]
|
||||
public string License { get; set; }
|
||||
[JsonPropertyName("family_id")]
|
||||
public ulong FamilyId { get; set; }
|
||||
[JsonPropertyName("license_id")]
|
||||
public int? LicenseId { get; set; }
|
||||
[JsonPropertyName("previous_id")]
|
||||
public ulong? PreviousId { get; set; }
|
||||
}
|
||||
@@ -23,12 +23,18 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class SoundSynthByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("sound_synth_id")]
|
||||
public int SoundSynthId { get; set; }
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string CompanyName { get; set; }
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@@ -23,21 +23,34 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class SoundSynthDto : BaseDto<int>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonPropertyName("company")]
|
||||
public string CompanyName { get; set; }
|
||||
[JsonPropertyName("company_id")]
|
||||
public int? CompanyId { get; set; }
|
||||
[JsonPropertyName("model_code")]
|
||||
public string ModelCode { get; set; }
|
||||
[JsonPropertyName("introduced")]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[JsonPropertyName("voices")]
|
||||
public int? Voices { get; set; }
|
||||
[JsonPropertyName("frequency")]
|
||||
public double? Frequency { get; set; }
|
||||
[JsonPropertyName("depth")]
|
||||
public int? Depth { get; set; }
|
||||
[JsonPropertyName("square_wave")]
|
||||
public int? SquareWave { get; set; }
|
||||
[JsonPropertyName("white_noise")]
|
||||
public int? WhiteNoise { get; set; }
|
||||
[JsonPropertyName("type")]
|
||||
public int? Type { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown";
|
||||
}
|
||||
@@ -23,14 +23,19 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class StorageByMachineDto : BaseDto<long>
|
||||
{
|
||||
[JsonPropertyName("machine_id")]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("type")]
|
||||
public StorageType Type { get; set; }
|
||||
[JsonPropertyName("interface")]
|
||||
public StorageInterface Interface { get; set; }
|
||||
[JsonPropertyName("capacity")]
|
||||
public long? Capacity { get; set; }
|
||||
}
|
||||
@@ -23,13 +23,17 @@
|
||||
// Copyright © 2003-2021 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Marechai.Database;
|
||||
|
||||
namespace Marechai.Data.Dtos;
|
||||
|
||||
public class StorageDto
|
||||
{
|
||||
[JsonPropertyName("type")]
|
||||
public StorageType Type { get; set; }
|
||||
[JsonPropertyName("interface")]
|
||||
public StorageInterface Interface { get; set; }
|
||||
[JsonPropertyName("capacity")]
|
||||
public long? Capacity { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user