Модели Apps, Scheduler
This commit is contained in:
@@ -14,5 +14,10 @@ namespace PARR.DAL.Context
|
||||
public DbSet<Host> Hosts { get; set; }
|
||||
public DbSet<Job> Jobs { get; set; }
|
||||
public DbSet<JobJournal> JobJournals { get; set; }
|
||||
public DbSet<Application> Applications { get; set; }
|
||||
public DbSet<ApplicationType> ApplicationTypes { get; set; }
|
||||
public DbSet<ApplicationInHost> ApplicationsInHosts { get; set; }
|
||||
public DbSet<Scheduler> Schedulers { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
9
PARR.DAL/Contracts/ApplicationTypesEnum.cs
Normal file
9
PARR.DAL/Contracts/ApplicationTypesEnum.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace PARR.DAL.Contracts
|
||||
{
|
||||
public enum ApplicationTypesEnum
|
||||
{
|
||||
APP,
|
||||
OS,
|
||||
DB
|
||||
}
|
||||
}
|
||||
29
PARR.DAL/Models/Application.cs
Normal file
29
PARR.DAL/Models/Application.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using PARR.DAL.Models.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("Applications")]
|
||||
public class Application : IBase
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
public required string Name { get; set; }
|
||||
|
||||
public Guid ApplicationTypeId { get; set; }
|
||||
[ForeignKey(nameof(ApplicationTypeId))]
|
||||
public ApplicationType? ApplicationType { get; set; }
|
||||
|
||||
|
||||
public ICollection<ApplicationInHost> ApplicationsInHosts { get; set; } = new HashSet<ApplicationInHost>();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
PARR.DAL/Models/ApplicationInHost.cs
Normal file
28
PARR.DAL/Models/ApplicationInHost.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using PARR.DAL.Models.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("ApplicationsinHosts")]
|
||||
public class ApplicationInHost : IBase
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
|
||||
public Guid ApplicationId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(ApplicationId))]
|
||||
public Application? Application { get; set; }
|
||||
|
||||
public Guid HostId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(HostId))]
|
||||
public Host? Host { get; set; }
|
||||
}
|
||||
}
|
||||
20
PARR.DAL/Models/ApplicationType.cs
Normal file
20
PARR.DAL/Models/ApplicationType.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using PARR.DAL.Models.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("ApplicationTypes")]
|
||||
public class ApplicationType : IBase
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -11,19 +11,17 @@ namespace PARR.DAL.Models
|
||||
public Guid Id { get; set; }
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
public string HostName { get; set; }
|
||||
public string HostName { get; set; }
|
||||
public required string IP { get; set; }
|
||||
public string? RegionalEK { get; set; }
|
||||
public string? LinkEK { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public string? WorkGroup { get; set; }
|
||||
public string? Responsible { get; set; }
|
||||
public string? OS { get; set; }
|
||||
public string? DB { get; set; }
|
||||
public string? APP { get; set; }
|
||||
|
||||
|
||||
|
||||
public ICollection<JobJournal> JobJournals { get; set; } = new HashSet<JobJournal>();
|
||||
public ICollection<ApplicationInHost> ApplicationsInHosts { get; set; } = new HashSet<ApplicationInHost>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace PARR.DAL.Models
|
||||
public Guid JobCategoryId { get; set; }
|
||||
[ForeignKey(nameof(JobCategoryId))]
|
||||
public JobCategory? JobCategorye { get; set; }
|
||||
|
||||
|
||||
public Guid JobTypeId { get; set; }
|
||||
[ForeignKey(nameof(JobTypeId))]
|
||||
public JobType? JobType { get; set; }
|
||||
|
||||
19
PARR.DAL/Models/Scheduler.cs
Normal file
19
PARR.DAL/Models/Scheduler.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using PARR.DAL.Models.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("Schedulers")]
|
||||
public class Scheduler : IBase
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public int Frequency { get; set; }
|
||||
public required DateTimeOffset StartAt { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace PARR.DAL.Services.Implementations
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public async Task<Host?> GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK)
|
||||
public async Task<Host?> GetHostWithAppsAsync(string IP, string RegionalEK)//TODO
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user