mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add XML comments to public entities.
This commit is contained in:
@@ -34,8 +34,14 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Base database model
|
||||
/// </summary>
|
||||
public abstract class BaseModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Database ID
|
||||
/// </summary>
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
@@ -32,11 +32,26 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Operating system statistics
|
||||
/// </summary>
|
||||
public abstract class BaseOperatingSystem : BaseModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Operating system name
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Operating system version
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
/// <summary>
|
||||
/// Has already been synchronized with Aaru's server
|
||||
/// </summary>
|
||||
public bool Synchronized { get; set; }
|
||||
/// <summary>
|
||||
/// Statistical count
|
||||
/// </summary>
|
||||
public ulong Count { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -34,10 +34,24 @@ using System;
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// CD read offset
|
||||
/// </summary>
|
||||
public class CdOffset : CommonTypes.Metadata.CdOffset
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds an empty CD read offset
|
||||
/// </summary>
|
||||
public CdOffset() {}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a CD read offset with the specified parameters
|
||||
/// </summary>
|
||||
/// <param name="manufacturer">Manufacturer</param>
|
||||
/// <param name="model">Model</param>
|
||||
/// <param name="offset">Read offset</param>
|
||||
/// <param name="submissions">Number of submissions</param>
|
||||
/// <param name="agreement">Percentage of agreement of submissions</param>
|
||||
public CdOffset(string manufacturer, string model, short offset, int submissions, float agreement)
|
||||
{
|
||||
Manufacturer = manufacturer;
|
||||
@@ -48,6 +62,10 @@ namespace Aaru.Database.Models
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a CD read offset from the metadata type
|
||||
/// </summary>
|
||||
/// <param name="offset">Read offset metadata</param>
|
||||
public CdOffset(CommonTypes.Metadata.CdOffset offset)
|
||||
{
|
||||
Manufacturer = offset.Manufacturer;
|
||||
@@ -58,8 +76,17 @@ namespace Aaru.Database.Models
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Database ID
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// Date when model has been added to the database
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
/// <summary>
|
||||
/// Date when model was last modified
|
||||
/// </summary>
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Command statistics.
|
||||
/// </summary>
|
||||
public class Command : NameCountModel {}
|
||||
}
|
||||
@@ -36,10 +36,20 @@ using Aaru.CommonTypes.Metadata;
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Known device
|
||||
/// </summary>
|
||||
public class Device : DeviceReportV2
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds an empty device
|
||||
/// </summary>
|
||||
public Device() => LastSynchronized = DateTime.UtcNow;
|
||||
|
||||
/// <summary>
|
||||
/// Builds a device from a device report
|
||||
/// </summary>
|
||||
/// <param name="report">Device report</param>
|
||||
public Device(DeviceReportV2 report)
|
||||
{
|
||||
ATA = report.ATA;
|
||||
@@ -59,11 +69,20 @@ namespace Aaru.Database.Models
|
||||
GdRomSwapDiscCapabilities = report.GdRomSwapDiscCapabilities;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When this known device was last synchronized with the server
|
||||
/// </summary>
|
||||
public DateTime LastSynchronized { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optimal number of blocks to read at once
|
||||
/// </summary>
|
||||
[DefaultValue(0)]
|
||||
public int OptimalMultipleSectorsRead { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Can read GD-ROM using swap trick?
|
||||
/// </summary>
|
||||
[DefaultValue(null)]
|
||||
public bool? CanReadGdRomUsingSwapDisc { get; set; }
|
||||
}
|
||||
|
||||
@@ -32,12 +32,30 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Device found in usage
|
||||
/// </summary>
|
||||
public class DeviceStat : BaseModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Manufacturer
|
||||
/// </summary>
|
||||
public string Manufacturer { get; set; }
|
||||
/// <summary>
|
||||
/// Model
|
||||
/// </summary>
|
||||
public string Model { get; set; }
|
||||
/// <summary>
|
||||
/// Revision or firmware version
|
||||
/// </summary>
|
||||
public string Revision { get; set; }
|
||||
/// <summary>
|
||||
/// Bus
|
||||
/// </summary>
|
||||
public string Bus { get; set; }
|
||||
/// <summary>
|
||||
/// Has already been synchronized with Aaru's server
|
||||
/// </summary>
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Filesystem found
|
||||
/// </summary>
|
||||
public class Filesystem : NameCountModel {}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Filter used
|
||||
/// </summary>
|
||||
public class Filter : NameCountModel {}
|
||||
}
|
||||
@@ -32,11 +32,26 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Media type found
|
||||
/// </summary>
|
||||
public class Media : BaseModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Media type name
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
/// <summary>
|
||||
/// Found physically, or in image
|
||||
/// </summary>
|
||||
public bool Real { get; set; }
|
||||
/// <summary>
|
||||
/// Has already been synchronized with Aaru's server
|
||||
/// </summary>
|
||||
public bool Synchronized { get; set; }
|
||||
/// <summary>
|
||||
/// Count of times found
|
||||
/// </summary>
|
||||
public ulong Count { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Media image format
|
||||
/// </summary>
|
||||
public class MediaFormat : NameCountModel {}
|
||||
}
|
||||
@@ -32,10 +32,22 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Model for name-count values.
|
||||
/// </summary>
|
||||
public abstract class NameCountModel : BaseModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Value name
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Has already been synchronized with Aaru's server
|
||||
/// </summary>
|
||||
public bool Synchronized { get; set; }
|
||||
/// <summary>
|
||||
/// Value count
|
||||
/// </summary>
|
||||
public ulong Count { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Operating system
|
||||
/// </summary>
|
||||
public class OperatingSystem : BaseOperatingSystem {}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Partitioning scheme
|
||||
/// </summary>
|
||||
public class Partition : NameCountModel {}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Remote application
|
||||
/// </summary>
|
||||
public class RemoteApplication : BaseOperatingSystem {}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Remote architecture
|
||||
/// </summary>
|
||||
public class RemoteArchitecture : NameCountModel {}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Remote operating system
|
||||
/// </summary>
|
||||
public class RemoteOperatingSystem : BaseOperatingSystem {}
|
||||
}
|
||||
@@ -35,14 +35,24 @@ using Aaru.CommonTypes.Metadata;
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Device report
|
||||
/// </summary>
|
||||
public class Report : DeviceReportV2
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds an empty device report
|
||||
/// </summary>
|
||||
public Report()
|
||||
{
|
||||
Created = DateTime.UtcNow;
|
||||
Uploaded = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a device report model from a device report
|
||||
/// </summary>
|
||||
/// <param name="report">Device report</param>
|
||||
public Report(DeviceReportV2 report)
|
||||
{
|
||||
ATA = report.ATA;
|
||||
@@ -62,7 +72,13 @@ namespace Aaru.Database.Models
|
||||
Type = report.Type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Date when the device report was created
|
||||
/// </summary>
|
||||
public DateTime Created { get; set; }
|
||||
/// <summary>
|
||||
/// If this model has already been upload
|
||||
/// </summary>
|
||||
public bool Uploaded { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -35,10 +35,22 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// USB product
|
||||
/// </summary>
|
||||
public class UsbProduct
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds an empty USB product
|
||||
/// </summary>
|
||||
public UsbProduct() {}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a USB product with the specified parameters
|
||||
/// </summary>
|
||||
/// <param name="vendorId">Vendor ID</param>
|
||||
/// <param name="id">Product ID</param>
|
||||
/// <param name="product">Product name</param>
|
||||
public UsbProduct(ushort vendorId, ushort id, string product)
|
||||
{
|
||||
VendorId = vendorId;
|
||||
@@ -47,13 +59,34 @@ namespace Aaru.Database.Models
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Database ID
|
||||
/// </summary>
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// Product ID
|
||||
/// </summary>
|
||||
public ushort ProductId { get; set; }
|
||||
/// <summary>
|
||||
/// Product name
|
||||
/// </summary>
|
||||
public string Product { get; set; }
|
||||
/// <summary>
|
||||
/// Date when model has been added to the database
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
/// <summary>
|
||||
/// Date when model was last modified
|
||||
/// </summary>
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
/// <summary>
|
||||
/// USB vendor ID
|
||||
/// </summary>
|
||||
public ushort VendorId { get; set; }
|
||||
/// <summary>
|
||||
/// Database link to USB vendor
|
||||
/// </summary>
|
||||
public virtual UsbVendor Vendor { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -36,10 +36,21 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// USB vendor
|
||||
/// </summary>
|
||||
public class UsbVendor
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds an empty USB vendor
|
||||
/// </summary>
|
||||
public UsbVendor() {}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a USB vendor with the specified parameters
|
||||
/// </summary>
|
||||
/// <param name="id">Vendor ID</param>
|
||||
/// <param name="vendor">Vendor name</param>
|
||||
public UsbVendor(ushort id, string vendor)
|
||||
{
|
||||
Id = id;
|
||||
@@ -47,12 +58,27 @@ namespace Aaru.Database.Models
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Database ID
|
||||
/// </summary>
|
||||
[Key]
|
||||
public ushort Id { get; set; }
|
||||
/// <summary>
|
||||
/// Vendor name
|
||||
/// </summary>
|
||||
public string Vendor { get; set; }
|
||||
/// <summary>
|
||||
/// Date when model has been added to the database
|
||||
/// </summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
/// <summary>
|
||||
/// Date when model was last modified
|
||||
/// </summary>
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of products from this vendor
|
||||
/// </summary>
|
||||
public virtual ICollection<UsbProduct> Products { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,8 @@
|
||||
|
||||
namespace Aaru.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Aaru version
|
||||
/// </summary>
|
||||
public class Version : NameCountModel {}
|
||||
}
|
||||
Reference in New Issue
Block a user