mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Move server to separate folder.
This commit is contained in:
70
DiscImageChef.Server/Models/CdOffset.cs
Normal file
70
DiscImageChef.Server/Models/CdOffset.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : CdOffset.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing Compact Disc read offsets in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using DiscImageChef.CommonTypes.Metadata;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class CompactDiscOffset : CdOffset
|
||||
{
|
||||
public CompactDiscOffset() { }
|
||||
|
||||
public CompactDiscOffset(string manufacturer, string model, short offset, int submissions, float agreement)
|
||||
{
|
||||
Manufacturer = manufacturer;
|
||||
Model = model;
|
||||
Offset = offset;
|
||||
Submissions = submissions;
|
||||
Agreement = agreement;
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public CompactDiscOffset(CdOffset offset)
|
||||
{
|
||||
Manufacturer = offset.Manufacturer;
|
||||
Model = offset.Model;
|
||||
Offset = offset.Offset;
|
||||
Submissions = offset.Submissions;
|
||||
Agreement = offset.Agreement;
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
[Index]
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
public virtual ICollection<Device> Devices { get; set; }
|
||||
}
|
||||
}
|
||||
44
DiscImageChef.Server/Models/Command.cs
Normal file
44
DiscImageChef.Server/Models/Command.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Command.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing command statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class Command
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
56
DiscImageChef.Server/Models/Context.cs
Normal file
56
DiscImageChef.Server/Models/Context.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Context.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Entity framework database context.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Data.Entity;
|
||||
using MySql.Data.EntityFramework;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||
public sealed class DicServerContext : DbContext
|
||||
{
|
||||
public DbSet<Device> Devices { get; set; }
|
||||
public DbSet<UploadedReport> Reports { get; set; }
|
||||
public DbSet<Command> Commands { get; set; }
|
||||
public DbSet<DeviceStat> DeviceStats { get; set; }
|
||||
public DbSet<Filesystem> Filesystems { get; set; }
|
||||
public DbSet<Filter> Filters { get; set; }
|
||||
public DbSet<Media> Medias { get; set; }
|
||||
public DbSet<MediaFormat> MediaFormats { get; set; }
|
||||
public DbSet<OperatingSystem> OperatingSystems { get; set; }
|
||||
public DbSet<Partition> Partitions { get; set; }
|
||||
public DbSet<Version> Versions { get; set; }
|
||||
public DbSet<UsbVendor> UsbVendors { get; set; }
|
||||
public DbSet<UsbProduct> UsbProducts { get; set; }
|
||||
public DbSet<CompactDiscOffset> CdOffsets { get; set; }
|
||||
}
|
||||
}
|
||||
73
DiscImageChef.Server/Models/Device.cs
Normal file
73
DiscImageChef.Server/Models/Device.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Device.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing processed device reports in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using DiscImageChef.CommonTypes.Metadata;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class Device : DeviceReportV2
|
||||
{
|
||||
public Device()
|
||||
{
|
||||
AddedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public Device(DeviceReportV2 report)
|
||||
{
|
||||
ATA = report.ATA;
|
||||
ATAPI = report.ATAPI;
|
||||
CompactFlash = report.CompactFlash;
|
||||
FireWire = report.FireWire;
|
||||
AddedWhen = DateTime.UtcNow;
|
||||
ModifiedWhen = DateTime.UtcNow;
|
||||
MultiMediaCard = report.MultiMediaCard;
|
||||
PCMCIA = report.PCMCIA;
|
||||
SCSI = report.SCSI;
|
||||
SecureDigital = report.SecureDigital;
|
||||
USB = report.USB;
|
||||
Manufacturer = report.Manufacturer;
|
||||
Model = report.Model;
|
||||
Revision = report.Revision;
|
||||
Type = report.Type;
|
||||
}
|
||||
|
||||
public DateTime AddedWhen { get; set; }
|
||||
[Index]
|
||||
public DateTime? ModifiedWhen { get; set; }
|
||||
public virtual CompactDiscOffset CdOffset { get; set; }
|
||||
[DefaultValue(0)]
|
||||
public int OptimalMultipleSectorsRead { get; set; }
|
||||
}
|
||||
}
|
||||
43
DiscImageChef.Server/Models/DeviceItem.cs
Normal file
43
DiscImageChef.Server/Models/DeviceItem.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : DeviceItem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for showing device statistics.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class DeviceItem
|
||||
{
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public string Bus { get; set; }
|
||||
public int ReportId { get; set; }
|
||||
}
|
||||
}
|
||||
47
DiscImageChef.Server/Models/DeviceStat.cs
Normal file
47
DiscImageChef.Server/Models/DeviceStat.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : DeviceStat.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing device statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class DeviceStat
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public string Bus { get; set; }
|
||||
public virtual Device Report { get; set; }
|
||||
}
|
||||
}
|
||||
44
DiscImageChef.Server/Models/Filesystem.cs
Normal file
44
DiscImageChef.Server/Models/Filesystem.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Filesystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing filesystem statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class Filesystem
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
44
DiscImageChef.Server/Models/Filter.cs
Normal file
44
DiscImageChef.Server/Models/Filter.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Filter.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing filter statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class Filter
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
45
DiscImageChef.Server/Models/Media.cs
Normal file
45
DiscImageChef.Server/Models/Media.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Media.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing media type statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class Media
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Type { get; set; }
|
||||
public bool Real { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
44
DiscImageChef.Server/Models/MediaFormat.cs
Normal file
44
DiscImageChef.Server/Models/MediaFormat.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : MediaFormat.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing media image format statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class MediaFormat
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
41
DiscImageChef.Server/Models/MediaItem.cs
Normal file
41
DiscImageChef.Server/Models/MediaItem.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : MediaItem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for showing media type statistics.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class MediaItem
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string SubType { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
45
DiscImageChef.Server/Models/OperatingSystem.cs
Normal file
45
DiscImageChef.Server/Models/OperatingSystem.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : OperatingSystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing operating system statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class OperatingSystem
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
44
DiscImageChef.Server/Models/Partition.cs
Normal file
44
DiscImageChef.Server/Models/Partition.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Partition.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing partition statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class Partition
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
65
DiscImageChef.Server/Models/UploadedReport.cs
Normal file
65
DiscImageChef.Server/Models/UploadedReport.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UploadedReport.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing uploaded device reports in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using DiscImageChef.CommonTypes.Metadata;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class UploadedReport : DeviceReportV2
|
||||
{
|
||||
public UploadedReport()
|
||||
{
|
||||
UploadedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public UploadedReport(DeviceReportV2 report)
|
||||
{
|
||||
ATA = report.ATA;
|
||||
ATAPI = report.ATAPI;
|
||||
CompactFlash = report.CompactFlash;
|
||||
FireWire = report.FireWire;
|
||||
UploadedWhen = DateTime.UtcNow;
|
||||
MultiMediaCard = report.MultiMediaCard;
|
||||
PCMCIA = report.PCMCIA;
|
||||
SCSI = report.SCSI;
|
||||
SecureDigital = report.SecureDigital;
|
||||
USB = report.USB;
|
||||
Manufacturer = report.Manufacturer;
|
||||
Model = report.Model;
|
||||
Revision = report.Revision;
|
||||
Type = report.Type;
|
||||
}
|
||||
|
||||
public DateTime UploadedWhen { get; set; }
|
||||
}
|
||||
}
|
||||
65
DiscImageChef.Server/Models/UsbProduct.cs
Normal file
65
DiscImageChef.Server/Models/UsbProduct.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UsbProduct.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing USB product identifiers in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class UsbProduct
|
||||
{
|
||||
public UsbProduct() { }
|
||||
|
||||
public UsbProduct(UsbVendor vendor, ushort id, string product)
|
||||
{
|
||||
ProductId = id;
|
||||
Product = product;
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
Vendor = vendor;
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
[Index]
|
||||
public int ProductId { get; set; }
|
||||
public string Product { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
[Index]
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
[Index]
|
||||
public int VendorId { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual UsbVendor Vendor { get; set; }
|
||||
}
|
||||
}
|
||||
64
DiscImageChef.Server/Models/UsbVendor.cs
Normal file
64
DiscImageChef.Server/Models/UsbVendor.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UsbVendor.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing USB vendor identifiers in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class UsbVendor
|
||||
{
|
||||
public UsbVendor() { }
|
||||
|
||||
public UsbVendor(ushort id, string vendor)
|
||||
{
|
||||
VendorId = id;
|
||||
Vendor = vendor;
|
||||
AddedWhen = ModifiedWhen = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
[Index(IsUnique = true)]
|
||||
public int VendorId { get; set; }
|
||||
public string Vendor { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
[Index]
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<UsbProduct> Products { get; set; }
|
||||
}
|
||||
}
|
||||
44
DiscImageChef.Server/Models/Version.cs
Normal file
44
DiscImageChef.Server/Models/Version.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Version.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : DiscImageChef Server.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Model for storing version statistics in database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class Version
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Value { get; set; }
|
||||
public long Count { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user