Синхронизация данных АИХ ИТ с ПАРР

This commit is contained in:
Mikhail Kuznetsov
2023-08-14 15:24:57 +10:00
parent e16eecaeba
commit 260a20e9bf
26 changed files with 475 additions and 329 deletions

View File

@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Contracts;
using PARR.DAL.Models;
using PARR.DAL.Models.AIHIT;
using PARR.DAL.Models.V1;
@@ -13,12 +14,16 @@ namespace PARR.DAL.Context
public DbSet<V1_JobCategory> JobCategories { get; set; }
public DbSet<V1_JobMode> JobModes { get; set; }
public DbSet<V1_JobStatus> JobStatuses { get; set; }
public DbSet<V1_Host> Hosts { get; set; }
public DbSet<V1_Host> V1_Hosts { get; set; }
public DbSet<Host> Hosts { get; set; }
public DbSet<V1_Job> Jobs { get; set; }
public DbSet<V1_JobJournal> JobJournals { get; set; }
public DbSet<V1_Application> Applications { get; set; }
public DbSet<V1_ApplicationType> ApplicationTypes { get; set; }
public DbSet<V1_ApplicationInHost> ApplicationsInHosts { get; set; }
public DbSet<Application> Applications { get; set; }
public DbSet<ApplicationType> ApplicationTypes { get; set; }
public DbSet<ApplicationInHost> ApplicationsInHosts { get; set; }
public DbSet<V1_Application> V1_Applications { get; set; }
public DbSet<V1_ApplicationType> V1_ApplicationTypes { get; set; }
public DbSet<V1_ApplicationInHost> V1_ApplicationsInHosts { get; set; }
public DbSet<Setting> Settings { get; set; }
public DbSet<RawDataEK> RawDataEKs { get; set; }
//public DbSet<Scheduler> Schedulers { get; set; }
@@ -48,7 +53,7 @@ namespace PARR.DAL.Context
});
modelBuilder.Entity<V1_ApplicationType>(f =>
modelBuilder.Entity<ApplicationType>(f =>
{
f.HasData(
new() { Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"), DateCreated = dateCreated, DateModified = null, Name = ApplicationTypesEnum.APP.ToString(), Description = "Поле СП xml АИХ ИТ" },
@@ -64,7 +69,6 @@ namespace PARR.DAL.Context
new() { Id = new Guid("50F66704-4D26-4587-BB1E-DCA70C8F4B89"), DateCreated = dateCreated, DateModified = null, Group = AIHTITSettings.RespAreaGroupName, Name = "ZAB", Value = "94-ЗАБ", Description = "Зона ответственности" },
new() { Id = new Guid("1FD43634-4A06-4237-9727-EDFA6F3EEBE8"), DateCreated = dateCreated, DateModified = null, Group = AIHTITSettings.RespAreaGroupName, Name = "DVS", Value = "96-ДВС", Description = "Зона ответственности" },
new() { Id = new Guid("77C73C0A-8E4D-4676-B6E2-6A112F20E346"), DateCreated = dateCreated, DateModified = null, Group = AIHTITSettings.StatusGroupName, Name = "Exploitation", Value = "3-В эксплуатации", Description = "Статус актуальных ЭК" }
);
});
}

View File

@@ -239,6 +239,141 @@ namespace PARR.DAL.Migrations
});
});
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("ApplicationTypeId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset?>("DateModified")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ApplicationTypeId");
b.ToTable("Applications");
});
modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("ApplicationId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset?>("DateModified")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("HostId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("ApplicationId");
b.HasIndex("HostId");
b.ToTable("ApplicationsInHost");
});
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid?>("ApplicationTypeId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset?>("DateModified")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ApplicationTypeId");
b.ToTable("ApplicationTypes");
b.HasData(
new
{
Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"),
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Поле СП xml АИХ ИТ",
Name = "APP"
},
new
{
Id = new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"),
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Поле ОС xml АИХ ИТ",
Name = "OS"
},
new
{
Id = new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"),
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Поле СУБД xml АИХ ИТ",
Name = "DB"
});
});
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset?>("DateModified")
.HasColumnType("timestamp with time zone");
b.Property<string>("HostName")
.HasColumnType("text");
b.Property<string>("IP")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Status")
.HasColumnType("text");
b.Property<string>("WorkGroup")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Hosts");
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
{
b.Property<Guid>("Id")
@@ -283,12 +418,17 @@ namespace PARR.DAL.Migrations
b.Property<Guid>("HostId")
.HasColumnType("uuid");
b.Property<Guid?>("V1_ApplicationId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("ApplicationId");
b.HasIndex("HostId");
b.HasIndex("V1_ApplicationId");
b.ToTable("V1_ApplicationsInHost");
});
@@ -319,29 +459,6 @@ namespace PARR.DAL.Migrations
b.HasIndex("V1_ApplicationTypeId");
b.ToTable("V1_ApplicationTypes");
b.HasData(
new
{
Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"),
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Поле СП xml АИХ ИТ",
Name = "APP"
},
new
{
Id = new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"),
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Поле ОС xml АИХ ИТ",
Name = "OS"
},
new
{
Id = new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"),
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Поле СУБД xml АИХ ИТ",
Name = "DB"
});
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Host", b =>
@@ -604,6 +721,43 @@ namespace PARR.DAL.Migrations
b.ToTable("V1_JobTypes");
});
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
{
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
.WithMany()
.HasForeignKey("ApplicationTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ApplicationType");
});
modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b =>
{
b.HasOne("PARR.DAL.Models.Application", "Application")
.WithMany("ApplicationsInHosts")
.HasForeignKey("ApplicationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.Host", "Host")
.WithMany("ApplicationsInHosts")
.HasForeignKey("HostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Application");
b.Navigation("Host");
});
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
{
b.HasOne("PARR.DAL.Models.ApplicationType", null)
.WithMany("ApplicationTypes")
.HasForeignKey("ApplicationTypeId");
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
{
b.HasOne("PARR.DAL.Models.V1.V1_ApplicationType", "ApplicationType")
@@ -617,8 +771,8 @@ namespace PARR.DAL.Migrations
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationInHost", b =>
{
b.HasOne("PARR.DAL.Models.V1.V1_Application", "Application")
.WithMany("ApplicationsInHosts")
b.HasOne("PARR.DAL.Models.Application", "Application")
.WithMany()
.HasForeignKey("ApplicationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -629,6 +783,10 @@ namespace PARR.DAL.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.V1.V1_Application", null)
.WithMany("V1_ApplicationsInHosts")
.HasForeignKey("V1_ApplicationId");
b.Navigation("Application");
b.Navigation("Host");
@@ -637,13 +795,13 @@ namespace PARR.DAL.Migrations
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
{
b.HasOne("PARR.DAL.Models.V1.V1_ApplicationType", null)
.WithMany("ApplicationTypes")
.WithMany("V1_ApplicationTypes")
.HasForeignKey("V1_ApplicationTypeId");
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b =>
{
b.HasOne("PARR.DAL.Models.V1.V1_Application", "Application")
b.HasOne("PARR.DAL.Models.Application", "Application")
.WithMany()
.HasForeignKey("ApplicationId")
.OnDelete(DeleteBehavior.Cascade)
@@ -699,16 +857,31 @@ namespace PARR.DAL.Migrations
b.Navigation("Status");
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
{
b.Navigation("ApplicationsInHosts");
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
{
b.Navigation("ApplicationTypes");
});
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
{
b.Navigation("ApplicationsInHosts");
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
{
b.Navigation("V1_ApplicationsInHosts");
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
{
b.Navigation("V1_ApplicationTypes");
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Host", b =>
{
b.Navigation("ApplicationsInHosts");

View File

@@ -2,10 +2,13 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using PARR.DAL.Context;
using PARR.DAL.Services.Implementation;
using PARR.DAL.Services.Implementations;
using PARR.DAL.Services.Implementations.AIHIT;
using PARR.DAL.Services.Implementations.V1;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.AIHIT;
using PARR.DAL.Services.Interfaces.V1;
namespace PARR.DAL
{
@@ -17,12 +20,16 @@ namespace PARR.DAL
opt.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
);
services.AddTransient<V1_IHostService, V1_HostService>();
services.AddTransient<IHostService, HostService>();
services.AddTransient<IApplicationService, ApplicationService>();
services.AddTransient<IApplicationTypeService, ApplicationTypeService>();
services.AddTransient<IApplicationInHostService, ApplicationInHostService>();
services.AddTransient<IJobService, JobService>();
services.AddTransient<IJobJournalService, JobJournalService>();
services.AddTransient<V1_IApplicationService, V1_ApplicationService>();
services.AddTransient<V1_IApplicationTypeService, V1_ApplicationTypeService>();
services.AddTransient<V1_IApplicationInHostService, V1_ApplicationInHostService>();
services.AddTransient<V1_IJobService, V1_JobService>();
services.AddTransient<V1_IJobJournalService, V1_JobJournalService>();
services.AddTransient<IRawDataEKService, RawDataEKService>();
services.AddTransient<ISettingService, SettingService>();
//services.AddTransient<ISchedulerService, SchedulerService>();

View File

@@ -1,13 +1,13 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class ApplicationInHostService : BaseService<V1_ApplicationInHost>, IApplicationInHostService
internal class ApplicationInHostService : BaseService<ApplicationInHost>, IApplicationInHostService
{
private readonly DataContext dataContext;
private readonly ILogger<ApplicationInHostService> logger;
@@ -18,7 +18,7 @@ namespace PARR.DAL.Services.Implementations
this.logger = logger;
}
protected override DbSet<V1_ApplicationInHost> EntitySet => dataContext.ApplicationsInHosts;
protected override DbSet<ApplicationInHost> EntitySet => dataContext.ApplicationsInHosts;
protected override DataContext EntitiContext => dataContext;
}

View File

@@ -1,13 +1,13 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class ApplicationService : BaseService<V1_Application>, IApplicationService
internal class ApplicationService : BaseService<Application>, IApplicationService
{
private readonly DataContext dataContext;
private readonly ILogger<ApplicationService> logger;
@@ -18,11 +18,11 @@ namespace PARR.DAL.Services.Implementations
this.logger = logger;
}
protected override DbSet<V1_Application> EntitySet => dataContext.Applications;
protected override DbSet<Application> EntitySet => dataContext.Applications;
protected override DataContext EntitiContext => dataContext;
public async Task<V1_Application?> GetByNameAsync(string appName)
public async Task<Application?> GetByNameAsync(string appName)
{
return await EntitySet.FirstOrDefaultAsync(t => t.Name.ToLower() == appName.Trim().ToLower());
}

View File

@@ -1,13 +1,13 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
namespace PARR.DAL.Services.Implementation
{
internal class ApplicationTypeService : BaseService<V1_ApplicationType>, IApplicationTypeService
internal class ApplicationTypeService : BaseService<ApplicationType>, IApplicationTypeService
{
private readonly DataContext dataContext;
private readonly ILogger<ApplicationTypeService> logger;
@@ -18,7 +18,7 @@ namespace PARR.DAL.Services.Implementations
this.logger = logger;
}
protected override DbSet<V1_ApplicationType> EntitySet => dataContext.ApplicationTypes;
protected override DbSet<ApplicationType> EntitySet => dataContext.ApplicationTypes;
protected override DataContext EntitiContext => dataContext;
}

View File

@@ -1,18 +1,18 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class HostService : BaseService<V1_Host>, IHostService
internal class HostService : BaseService<Host>, IHostService
{
private readonly DataContext dataContext;
private readonly ILogger<HostService> logger;
protected override DbSet<V1_Host> EntitySet => dataContext.Hosts;
protected override DbSet<Host> EntitySet => dataContext.Hosts;
protected override DataContext EntitiContext => dataContext;
public HostService(DataContext dataContext, ILogger<HostService> logger) : base(logger)
@@ -21,7 +21,7 @@ namespace PARR.DAL.Services.Implementations
this.logger = logger;
}
public async Task<V1_Host?> GetHostWithAppsAsync(string IP, string RegionalEK)
public async Task<Host?> GetHostWithAppsAsync(string IP)
{
//try
@@ -37,21 +37,7 @@ namespace PARR.DAL.Services.Implementations
return await EntitySet
.Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType)
.AsSplitQuery()
.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
}
public async Task<V1_Host?> GetHostWithAppsAsync(string IP, string linkEK, string regionalEK)
{
return await EntitySet
.Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType)
.AsSplitQuery()
.FirstOrDefaultAsync(h => h.IP == IP && h.LinkEK == linkEK && h.RegionalEK == regionalEK);
}
public async Task<V1_Host?> GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK)
{
return await EntitySet.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
.FirstOrDefaultAsync(h => h.IP == IP);
}
//public async Task<Host?> GetHostByRegionalEKAsync(string RegionalEK)И

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class JobCategoryService : BaseService<V1_JobCategory>, IJobCategoryService
{
private readonly DataContext dataContext;
private readonly ILogger<JobCategoryService> logger;
public JobCategoryService(DataContext dataContext, ILogger<JobCategoryService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<V1_JobCategory> EntitySet => dataContext.JobCategories;
protected override DataContext EntitiContext => dataContext;
}
}

View File

@@ -1,41 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Extensions;
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class JobJournalService : BaseService<V1_JobJournal>, IJobJournalService
{
private readonly DataContext dataContext;
private readonly ILogger<JobJournalService> logger;
public JobJournalService(DataContext dataContext, ILogger<JobJournalService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<V1_JobJournal> EntitySet => dataContext.JobJournals;
protected override DataContext EntitiContext => dataContext;
public async Task<V1_JobJournal?> GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date)
{
//var n=DateTimeOffset.UtcNow;
//var opers = await EntitySet
// .Where(j => j.JobId == jobId && j.HostId == hostId && (j.DateOper!=DateTimeOffset.MinValue))/*date.StartOfDay()*/// && j.DateOper < date.EndOfDay()))
// .OrderBy(t => t.DateOper)
// .LastOrDefaultAsync();
var opers = await EntitySet
.Where(j => j.JobId == jobId && j.HostId == hostId && j.DateOper.DateTime.Date == date.DateTime.Date)
.OrderBy(t => t.DateOper)
.LastOrDefaultAsync();
return opers;
}
}
}

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class JobModeService : BaseService<V1_JobMode>, IJobModeService
{
private readonly DataContext dataContext;
private readonly ILogger<JobModeService> logger;
public JobModeService(DataContext dataContext, ILogger<JobModeService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<V1_JobMode> EntitySet => dataContext.JobModes;
protected override DataContext EntitiContext => dataContext;
}
}

View File

@@ -1,30 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PARR.DAL.Services.Implementations
{
internal class JobService : BaseService<V1_Job>, IJobService
{
private readonly DataContext dataContext;
private readonly ILogger<JobService> logger;
public JobService(DataContext dataContext,ILogger<JobService> logger):base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<V1_Job> EntitySet => dataContext.Jobs;
protected override DataContext EntitiContext => dataContext;
}
}

View File

@@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class JobStatusService : BaseService<V1_JobStatus>, IJobStatusService
{
private readonly DataContext dataContext;
private readonly ILogger<JobStatusService> logger;
public JobStatusService(DataContext dataContext, ILogger<JobStatusService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<V1_JobStatus> EntitySet => dataContext.JobStatuses;
protected override DataContext EntitiContext => dataContext;
}
}

View File

@@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
//internal class SchedulerService : BaseService<Scheduler>, ISchedulerService
//{
// private readonly DataContext dataContext;
// public SchedulerService(DataContext dataContext, ILogger<SchedulerService> logger) : base(logger)
// {
// this.dataContext = dataContext;
// }
// protected override DbSet<Scheduler> EntitySet => dataContext.Schedulers;
// protected override DataContext EntitiContext => dataContext;
//}
}

View File

@@ -1,9 +1,9 @@
using PARR.DAL.Models.V1;
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IApplicationInHostService : IBaseService<V1_ApplicationInHost>
public interface IApplicationInHostService : IBaseService<ApplicationInHost>
{
}
}

View File

@@ -1,10 +1,10 @@
using PARR.DAL.Models.V1;
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IApplicationService : IBaseService<V1_Application>
public interface IApplicationService : IBaseService<Application>
{
Task<V1_Application?> GetByNameAsync(string appName);
Task<Application?> GetByNameAsync(string appName);
}
}

View File

@@ -1,9 +1,9 @@
using PARR.DAL.Models.V1;
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IApplicationTypeService : IBaseService<V1_ApplicationType>
public interface IApplicationTypeService : IBaseService<ApplicationType>
{
}
}

View File

@@ -1,13 +1,11 @@
using PARR.DAL.Models.V1;
using PARR.DAL.Models;
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IHostService : IBaseService<V1_Host>
public interface IHostService : IBaseService<Host>
{
Task<V1_Host?> GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK);
Task<V1_Host?> GetHostWithAppsAsync(string IP, string linkEK, string regionalEK);
//Task<Host?> GetHostByRegionalEKAsync(string LinkEK);
//Task<bool> UpdateAsync(Host host);
Task<Host?> GetHostWithAppsAsync(string IP);
}
}

View File

@@ -1,9 +0,0 @@
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
internal interface IJobCategoryService : IBaseService<V1_JobCategory>
{
}
}

View File

@@ -1,9 +0,0 @@
using PARR.DAL.Models.V1;
namespace PARR.DAL.Services.Interfaces
{
public interface IJobJournalService
{
Task<V1_JobJournal?> GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date);
}
}

View File

@@ -1,9 +0,0 @@
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
internal interface IJobModeService : IBaseService<V1_JobMode>
{
}
}

View File

@@ -1,9 +0,0 @@
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IJobService : IBaseService<V1_Job>
{
}
}

View File

@@ -1,9 +0,0 @@
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
internal interface IJobStatusService : IBaseService<V1_JobStatus>
{
}
}

View File

@@ -1,9 +0,0 @@
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
//public interface ISchedulerService : IBaseService<Scheduler>
//{
//}
}