diff --git a/PARR.AIHIT/AIHIT/MappingProfiles/RequestToDomain.cs b/PARR.AIHIT/AIHIT/MappingProfiles/RequestToDomain.cs index 1862ffc5..e6e16757 100644 --- a/PARR.AIHIT/AIHIT/MappingProfiles/RequestToDomain.cs +++ b/PARR.AIHIT/AIHIT/MappingProfiles/RequestToDomain.cs @@ -1,4 +1,5 @@ using AutoMapper; +using PARR.DAL.Models.V1; using System.Xml; namespace PARR.AIHIT.MappingProfiles @@ -7,7 +8,7 @@ namespace PARR.AIHIT.MappingProfiles { public RequestToDomain() { - CreateMap() + CreateMap() .ForMember(d => d.HostName, o => o.MapFrom(s => (s.Attributes!["ХОСТ"] != null) ? s.Attributes!["ХОСТ"]!.Value.Trim() : "")) .ForMember(d => d.IP, o => o.MapFrom(s => s.Attributes!["IP_АДРЕС"]!.Value.Trim())) .ForMember(d => d.RegionalEK, o => o.MapFrom(s => s.Attributes!["РЕГИОНАЛЬНЫЙ_ЭК"]!.Value.Trim())) diff --git a/PARR.AIHIT/AIHIT/Syncher.cs b/PARR.AIHIT/AIHIT/Syncher.cs index 664aa55e..ff290bb8 100644 --- a/PARR.AIHIT/AIHIT/Syncher.cs +++ b/PARR.AIHIT/AIHIT/Syncher.cs @@ -25,7 +25,7 @@ namespace PARR.AIHIT private readonly IApplicationTypeService appTypeService; private readonly IApplicationInHostService appInHostService; - public List AppTypes { get; private set; } = new List(); + public List AppTypes { get; private set; } = new List(); public Syncher( ILogger logger, @@ -97,7 +97,7 @@ namespace PARR.AIHIT // var foundHost = await hostService.GetHostAsync(ip, linkEK, regionalEK); var foundHost = await hostService.GetHostWithAppsAsync(ip, linkEK, regionalEK); - var mappedHost = mapper.Map(vm); + var mappedHost = mapper.Map(vm); var hostApplications = await GetAndFillApplicationsAsync(vm); @@ -209,7 +209,7 @@ namespace PARR.AIHIT } } - private async Task SyncApplicationAndHostAsync(Host? host, List hostApplications, bool isUpdateDateModified = false) + private async Task SyncApplicationAndHostAsync(V1_Host? host, List hostApplications, bool isUpdateDateModified = false) { var isUpdated = false; if (host == null) @@ -226,7 +226,7 @@ namespace PARR.AIHIT //add logger.LogInformation($"Host: {host.Id}, {host.LinkEK} добавление нового приложения Application {changedHostApp.Name}"); - var newAppHost = new ApplicationInHost { Id = Guid.NewGuid(), ApplicationId = changedHostApp.Id, HostId = host.Id }; + var newAppHost = new V1_ApplicationInHost { Id = Guid.NewGuid(), ApplicationId = changedHostApp.Id, HostId = host.Id }; if (!await appInHostService.CreateAsync(newAppHost)) logger.LogError($"Не удалось создать ApplicationInHost {changedHostApp.Name}, host: {host.Id}, {host.LinkEK}"); @@ -262,10 +262,10 @@ namespace PARR.AIHIT } - private async Task> GetAndFillApplicationsAsync(XmlNode vm) + private async Task> GetAndFillApplicationsAsync(XmlNode vm) { logger.LogInformation($"--- Начало парсинга данных о программном обеспечении(СП, БД, ОС) из Xml документа от АИХ ИТ ---"); - var applications = new List(); + var applications = new List(); //TODO GetAppFromXML(vm?.Attributes?["СП"]?.Value).ForEach(async item => await CreateAppIfNotExistAsync(item, ApplicationTypesEnum.APP)); //GetDBFromXML(vm?.Attributes?["СУБД"]?.Value).ForEach(async item => await CreateAppIfNotExistAsync(item, ApplicationTypesEnum.DB)); @@ -330,7 +330,7 @@ namespace PARR.AIHIT return osList; } - private async Task CreateAppIfNotExistAsync(string appName, ApplicationTypesEnum type)//Application application) + private async Task CreateAppIfNotExistAsync(string appName, ApplicationTypesEnum type)//Application application) { if (string.IsNullOrEmpty(appName) || string.IsNullOrWhiteSpace(appName)) return null; @@ -346,7 +346,7 @@ namespace PARR.AIHIT return null; } - var app = new DAL.Models.Application + var app = new DAL.Models.V1_Application { Id = Guid.NewGuid(), Name = appName.Trim(), @@ -361,7 +361,7 @@ namespace PARR.AIHIT return await appService.GetAsync(app.Id); } - private ApplicationType? GetAppTypeByName(ApplicationTypesEnum type) + private V1_ApplicationType? GetAppTypeByName(ApplicationTypesEnum type) { var existType = AppTypes.FirstOrDefault(t => t.Name == type.ToString()); if (existType == null) diff --git a/PARR.API/Controllers/V1/JobController.cs b/PARR.API/Controllers/V1/JobController.cs index a398d567..7afee1c1 100644 --- a/PARR.API/Controllers/V1/JobController.cs +++ b/PARR.API/Controllers/V1/JobController.cs @@ -9,7 +9,7 @@ using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; using PARR.DAL.DomainModels; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces; namespace PARR.API.Controllers.V1 @@ -49,7 +49,7 @@ namespace PARR.API.Controllers.V1 public async Task GetAll([FromQuery] PaginationQuery paginationQuery, [FromQuery] JobGetAllQuery filter) { var paginationFilter = mapper.Map(paginationQuery); - IQueryable query = jobService.Get().Include(t => t.JobMode).OrderBy(s => s.StartAt); + IQueryable query = jobService.Get().Include(t => t.JobMode).OrderBy(s => s.StartAt); if (filter.IsEnabled.HasValue) query = query.Where(t => t.IsEnabled == filter.IsEnabled); @@ -86,7 +86,7 @@ namespace PARR.API.Controllers.V1 // С одним IP может быть несколько информационных систем, соответственного а таблице храниться несколько записей хостов с одинаковым IP var hosts = await hostService.Get().Where(h => h.IP == ip).ToListAsync(); - var hostJobsDict = new Dictionary>(); + var hostJobsDict = new Dictionary>(); foreach (var host in hosts) { var jobsHost = await jobService.Get() @@ -102,8 +102,8 @@ namespace PARR.API.Controllers.V1 } } - var jobsList = new List(); - var jobsToResponse = new List(); + var jobsList = new List(); + var jobsToResponse = new List(); foreach (var hostAndJobs in hostJobsDict) { @@ -146,9 +146,9 @@ namespace PARR.API.Controllers.V1 } - private async Task> GetListJobsAsync(Job job, DAL.Models.Host host, DateTimeOffset queryDate) + private async Task> GetListJobsAsync(V1_Job job, V1_Host host, DateTimeOffset queryDate) { - var jobs = new List(); + var jobs = new List(); #region description // freaq > суток или нет? @@ -182,7 +182,7 @@ namespace PARR.API.Controllers.V1 // если в истории нет записей, то запускаем сегодня в стартЭт // берем квери дэйт и ем задаем время из Джобс СтартЭт var startDateTimeNext = new DateTimeOffset(queryDate.Year, queryDate.Month, queryDate.Day, job.StartAt.Hour, job.StartAt.Minute, job.StartAt.Second, new TimeSpan(0)); - var jobToAdded = mapper.Map(job);//new Job { StartAt = startDateTimeNext }; + var jobToAdded = mapper.Map(job);//new Job { StartAt = startDateTimeNext }; jobToAdded.StartAt = startDateTimeNext; jobs.Add(jobToAdded); @@ -195,7 +195,7 @@ namespace PARR.API.Controllers.V1 // если берем прошлую последнюю операцию из журнала, и к ней прибавить фрекунси, то время следующего старта сдвинется на время выполнения прошлого задания // чтобы это избежать, берем квери дэйт и ем задаем время из Джобс СтартЭт var startDateTimeNext = new DateTimeOffset(queryDate.Year, queryDate.Month, queryDate.Day, job.StartAt.Hour, job.StartAt.Minute, job.StartAt.Second, new TimeSpan(0)); - var jobToAdded = mapper.Map(job); + var jobToAdded = mapper.Map(job); jobToAdded.StartAt = startDateTimeNext; jobs.Add(jobToAdded); } @@ -214,7 +214,7 @@ namespace PARR.API.Controllers.V1 while (min >= 0) { //var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) }; - var jobToAdded = mapper.Map(job); + var jobToAdded = mapper.Map(job); jobToAdded.StartAt = queryDate.StartOfDay().AddMinutes(min); jobs.Add(jobToAdded); min = min - job.Frequency; @@ -225,7 +225,7 @@ namespace PARR.API.Controllers.V1 while (min < allDayMinutes) { //var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) }; - var jobToAdded = mapper.Map(job); + var jobToAdded = mapper.Map(job); jobToAdded.StartAt = queryDate.StartOfDay().AddMinutes(min); jobs.Add(jobToAdded); min = min + job.Frequency; @@ -239,7 +239,7 @@ namespace PARR.API.Controllers.V1 while (min < allDayMinutes) { //var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) }; - var jobToAdded = mapper.Map(job); + var jobToAdded = mapper.Map(job); jobToAdded.StartAt = queryDate.StartOfDay().AddMinutes(min); jobs.Add(jobToAdded); min = min + job.Frequency; diff --git a/PARR.API/MappingProfiles/DomainToDomainProfile.cs b/PARR.API/MappingProfiles/DomainToDomainProfile.cs index 699e379c..498b6a71 100644 --- a/PARR.API/MappingProfiles/DomainToDomainProfile.cs +++ b/PARR.API/MappingProfiles/DomainToDomainProfile.cs @@ -1,5 +1,5 @@ using AutoMapper; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; namespace PARR.API.MappingProfiles { @@ -7,7 +7,7 @@ namespace PARR.API.MappingProfiles { public DomainToDomainProfile() { - CreateMap(); + CreateMap(); } } } diff --git a/PARR.API/MappingProfiles/DomainToResponseProfile.cs b/PARR.API/MappingProfiles/DomainToResponseProfile.cs index 07394eb3..a21e52f2 100644 --- a/PARR.API/MappingProfiles/DomainToResponseProfile.cs +++ b/PARR.API/MappingProfiles/DomainToResponseProfile.cs @@ -1,6 +1,6 @@ using AutoMapper; using PARR.API.Contracts.V1.Responses; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; namespace PARR.API.MappingProfiles { @@ -9,23 +9,23 @@ namespace PARR.API.MappingProfiles public DomainToResponseProfile() { // --- Job --- - CreateMap() - .Include() + CreateMap() + .Include() .ForMember(d => d.FrequencyMinute, o => o.MapFrom(s => s.Frequency)) .ForMember(d => d.Script, o => o.MapFrom(s => s.ScriptName)); - CreateMap(); + CreateMap(); - CreateMap, JobMinResponse>() + CreateMap, JobMinResponse>() .ForMember(d => d.Scheduled, o => o.MapFrom(s => s)); - CreateMap() + CreateMap() .ForMember(d => d.Script, o => o.MapFrom(s => s.ScriptName)); // === Job === - CreateMap(); + CreateMap(); } } } diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index 96c0fa77..9107382e 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -8,16 +8,16 @@ namespace PARR.DAL.Context { public DataContext(DbContextOptions options) : base(options) { } - public DbSet JobTypes { get; set; } - public DbSet JobCategories { get; set; } - public DbSet JobModes { get; set; } - public DbSet JobStatuses { get; set; } - public DbSet Hosts { get; set; } - public DbSet Jobs { get; set; } - public DbSet JobJournals { get; set; } - public DbSet Applications { get; set; } - public DbSet ApplicationTypes { get; set; } - public DbSet ApplicationsInHosts { get; set; } + public DbSet JobTypes { get; set; } + public DbSet JobCategories { get; set; } + public DbSet JobModes { get; set; } + public DbSet JobStatuses { get; set; } + public DbSet Hosts { get; set; } + public DbSet Jobs { get; set; } + public DbSet JobJournals { get; set; } + public DbSet Applications { get; set; } + public DbSet ApplicationTypes { get; set; } + public DbSet ApplicationsInHosts { get; set; } //public DbSet Schedulers { get; set; } //todo init application type+check migrations @@ -28,7 +28,7 @@ namespace PARR.DAL.Context var dateCreated = new DateTimeOffset(2023, 05, 01, 0, 0, 0, new TimeSpan(0)); - modelBuilder.Entity(f => + modelBuilder.Entity(f => { f.HasData( new() { Id = new Guid("FBA4202C-5BAD-49C4-B076-D1CA6E1FB158"), DateCreated = dateCreated, DateModified = null, Name = JobModeEnum.auto.ToString() }, @@ -36,7 +36,7 @@ namespace PARR.DAL.Context ); }); - modelBuilder.Entity(f => + modelBuilder.Entity(f => { f.HasData( new() { Id = new Guid("EDEF6DC3-ADAD-4C77-8AD1-63BB9052355A"), DateCreated = dateCreated, DateModified = null, Name = JobStatusEnum.started.ToString(), Description = "Задание запущено" }, @@ -45,7 +45,7 @@ namespace PARR.DAL.Context }); - modelBuilder.Entity(f => + modelBuilder.Entity(f => { f.HasData( new() { Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"), DateCreated = dateCreated, DateModified = null, Name = ApplicationTypesEnum.APP.ToString(), Description = "Поле СП xml АИХ ИТ" }, diff --git a/PARR.DAL/Migrations/20230621014955_DbV5.Designer.cs b/PARR.DAL/Migrations/20230621014955_DbV5.Designer.cs index df4f7c54..2523349c 100644 --- a/PARR.DAL/Migrations/20230621014955_DbV5.Designer.cs +++ b/PARR.DAL/Migrations/20230621014955_DbV5.Designer.cs @@ -78,7 +78,7 @@ namespace PARR.DAL.Migrations b.ToTable("ApplicationsInHosts"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -392,13 +392,13 @@ namespace PARR.DAL.Migrations modelBuilder.Entity("PARR.DAL.Models.Application", b => { - b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType") + b.HasOne("PARR.DAL.Models.V1_ApplicationType", "V1_ApplicationType") .WithMany() .HasForeignKey("ApplicationTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.Navigation("ApplicationType"); + b.Navigation("V1_ApplicationType"); }); modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => @@ -420,9 +420,9 @@ namespace PARR.DAL.Migrations b.Navigation("Host"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { - b.HasOne("PARR.DAL.Models.ApplicationType", null) + b.HasOne("PARR.DAL.Models.V1_ApplicationType", null) .WithMany("ApplicationTypes") .HasForeignKey("ApplicationTypeId"); }); @@ -492,7 +492,7 @@ namespace PARR.DAL.Migrations b.Navigation("ApplicationsInHosts"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { b.Navigation("ApplicationTypes"); }); diff --git a/PARR.DAL/Migrations/20230621015625_DbV5.1.Designer.cs b/PARR.DAL/Migrations/20230621015625_DbV5.1.Designer.cs index 5d44c19a..21ef1f46 100644 --- a/PARR.DAL/Migrations/20230621015625_DbV5.1.Designer.cs +++ b/PARR.DAL/Migrations/20230621015625_DbV5.1.Designer.cs @@ -78,7 +78,7 @@ namespace PARR.DAL.Migrations b.ToTable("ApplicationsInHosts"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -392,13 +392,13 @@ namespace PARR.DAL.Migrations modelBuilder.Entity("PARR.DAL.Models.Application", b => { - b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType") + b.HasOne("PARR.DAL.Models.V1_ApplicationType", "V1_ApplicationType") .WithMany() .HasForeignKey("ApplicationTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.Navigation("ApplicationType"); + b.Navigation("V1_ApplicationType"); }); modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => @@ -420,9 +420,9 @@ namespace PARR.DAL.Migrations b.Navigation("Host"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { - b.HasOne("PARR.DAL.Models.ApplicationType", null) + b.HasOne("PARR.DAL.Models.V1_ApplicationType", null) .WithMany("ApplicationTypes") .HasForeignKey("ApplicationTypeId"); }); @@ -490,7 +490,7 @@ namespace PARR.DAL.Migrations b.Navigation("ApplicationsInHosts"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { b.Navigation("ApplicationTypes"); }); diff --git a/PARR.DAL/Migrations/DataContextModelSnapshot.cs b/PARR.DAL/Migrations/DataContextModelSnapshot.cs index 14add7a5..2a655f30 100644 --- a/PARR.DAL/Migrations/DataContextModelSnapshot.cs +++ b/PARR.DAL/Migrations/DataContextModelSnapshot.cs @@ -22,7 +22,7 @@ namespace PARR.DAL.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("PARR.DAL.Models.Application", b => + modelBuilder.Entity("PARR.DAL.Models.V1_Application", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -45,10 +45,10 @@ namespace PARR.DAL.Migrations b.HasIndex("ApplicationTypeId"); - b.ToTable("Applications"); + b.ToTable("V1_Application"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationInHost", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -72,18 +72,15 @@ namespace PARR.DAL.Migrations b.HasIndex("HostId"); - b.ToTable("ApplicationsInHosts"); + b.ToTable("V1_ApplicationInHost"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); - b.Property("ApplicationTypeId") - .HasColumnType("uuid"); - b.Property("DateCreated") .HasColumnType("timestamp with time zone"); @@ -97,11 +94,14 @@ namespace PARR.DAL.Migrations .IsRequired() .HasColumnType("text"); + b.Property("V1_ApplicationTypeId") + .HasColumnType("uuid"); + b.HasKey("Id"); - b.HasIndex("ApplicationTypeId"); + b.HasIndex("V1_ApplicationTypeId"); - b.ToTable("ApplicationTypes"); + b.ToTable("V1_ApplicationType"); b.HasData( new @@ -127,7 +127,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.Host", b => + modelBuilder.Entity("PARR.DAL.Models.V1_Host", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -163,10 +163,10 @@ namespace PARR.DAL.Migrations b.HasKey("Id"); - b.ToTable("Hosts"); + b.ToTable("V1_Host"); }); - modelBuilder.Entity("PARR.DAL.Models.Job", b => + modelBuilder.Entity("PARR.DAL.Models.V1_Job", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -217,10 +217,10 @@ namespace PARR.DAL.Migrations b.HasIndex("JobTypeId"); - b.ToTable("Jobs"); + b.ToTable("V1_Job"); }); - modelBuilder.Entity("PARR.DAL.Models.JobCategory", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobCategory", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -241,10 +241,10 @@ namespace PARR.DAL.Migrations b.HasKey("Id"); - b.ToTable("JobCategories"); + b.ToTable("V1_JobCategory"); }); - modelBuilder.Entity("PARR.DAL.Models.JobJournal", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobJournal", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -285,10 +285,10 @@ namespace PARR.DAL.Migrations b.HasIndex("JobStatusId"); - b.ToTable("JobJournals"); + b.ToTable("V1_JobJournal"); }); - modelBuilder.Entity("PARR.DAL.Models.JobMode", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobMode", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -306,7 +306,7 @@ namespace PARR.DAL.Migrations b.HasKey("Id"); - b.ToTable("JobModes"); + b.ToTable("V1_JobMode"); b.HasData( new @@ -323,7 +323,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.JobStatus", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobStatus", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -344,7 +344,7 @@ namespace PARR.DAL.Migrations b.HasKey("Id"); - b.ToTable("JobStatuses"); + b.ToTable("V1_JobStatus"); b.HasData( new @@ -363,7 +363,7 @@ namespace PARR.DAL.Migrations }); }); - modelBuilder.Entity("PARR.DAL.Models.JobType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -384,12 +384,12 @@ namespace PARR.DAL.Migrations b.HasKey("Id"); - b.ToTable("JobTypes"); + b.ToTable("V1_JobType"); }); - modelBuilder.Entity("PARR.DAL.Models.Application", b => + modelBuilder.Entity("PARR.DAL.Models.V1_Application", b => { - b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType") + b.HasOne("PARR.DAL.Models.V1_ApplicationType", "ApplicationType") .WithMany() .HasForeignKey("ApplicationTypeId") .OnDelete(DeleteBehavior.Cascade) @@ -398,15 +398,15 @@ namespace PARR.DAL.Migrations b.Navigation("ApplicationType"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationInHost", b => { - b.HasOne("PARR.DAL.Models.Application", "Application") + b.HasOne("PARR.DAL.Models.V1_Application", "Application") .WithMany("ApplicationsInHosts") .HasForeignKey("ApplicationId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Host", "Host") + b.HasOne("PARR.DAL.Models.V1_Host", "Host") .WithMany("ApplicationsInHosts") .HasForeignKey("HostId") .OnDelete(DeleteBehavior.Cascade) @@ -417,32 +417,32 @@ namespace PARR.DAL.Migrations b.Navigation("Host"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { - b.HasOne("PARR.DAL.Models.ApplicationType", null) + b.HasOne("PARR.DAL.Models.V1_ApplicationType", null) .WithMany("ApplicationTypes") - .HasForeignKey("ApplicationTypeId"); + .HasForeignKey("V1_ApplicationTypeId"); }); - modelBuilder.Entity("PARR.DAL.Models.Job", b => + modelBuilder.Entity("PARR.DAL.Models.V1_Job", b => { - b.HasOne("PARR.DAL.Models.Application", "Application") + b.HasOne("PARR.DAL.Models.V1_Application", "Application") .WithMany() .HasForeignKey("ApplicationId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.JobCategory", "JobCategorye") + b.HasOne("PARR.DAL.Models.V1_JobCategory", "JobCategorye") .WithMany("Jobs") .HasForeignKey("JobCategoryId"); - b.HasOne("PARR.DAL.Models.JobMode", "JobMode") + b.HasOne("PARR.DAL.Models.V1_JobMode", "JobMode") .WithMany("Jobs") .HasForeignKey("JobModeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.JobType", "JobType") + b.HasOne("PARR.DAL.Models.V1_JobType", "JobType") .WithMany("Jobs") .HasForeignKey("JobTypeId"); @@ -455,21 +455,21 @@ namespace PARR.DAL.Migrations b.Navigation("JobType"); }); - modelBuilder.Entity("PARR.DAL.Models.JobJournal", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobJournal", b => { - b.HasOne("PARR.DAL.Models.Host", "Host") + b.HasOne("PARR.DAL.Models.V1_Host", "Host") .WithMany("JobJournals") .HasForeignKey("HostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.Job", "Job") + b.HasOne("PARR.DAL.Models.V1_Job", "Job") .WithMany("Journals") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("PARR.DAL.Models.JobStatus", "Status") + b.HasOne("PARR.DAL.Models.V1_JobStatus", "Status") .WithMany("Journals") .HasForeignKey("JobStatusId") .OnDelete(DeleteBehavior.Cascade) @@ -482,44 +482,44 @@ namespace PARR.DAL.Migrations b.Navigation("Status"); }); - modelBuilder.Entity("PARR.DAL.Models.Application", b => + modelBuilder.Entity("PARR.DAL.Models.V1_Application", b => { b.Navigation("ApplicationsInHosts"); }); - modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b => { b.Navigation("ApplicationTypes"); }); - modelBuilder.Entity("PARR.DAL.Models.Host", b => + modelBuilder.Entity("PARR.DAL.Models.V1_Host", b => { b.Navigation("ApplicationsInHosts"); b.Navigation("JobJournals"); }); - modelBuilder.Entity("PARR.DAL.Models.Job", b => + modelBuilder.Entity("PARR.DAL.Models.V1_Job", b => { b.Navigation("Journals"); }); - modelBuilder.Entity("PARR.DAL.Models.JobCategory", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobCategory", b => { b.Navigation("Jobs"); }); - modelBuilder.Entity("PARR.DAL.Models.JobMode", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobMode", b => { b.Navigation("Jobs"); }); - modelBuilder.Entity("PARR.DAL.Models.JobStatus", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobStatus", b => { b.Navigation("Journals"); }); - modelBuilder.Entity("PARR.DAL.Models.JobType", b => + modelBuilder.Entity("PARR.DAL.Models.V1_JobType", b => { b.Navigation("Jobs"); }); diff --git a/PARR.DAL/Models/Application.cs b/PARR.DAL/Models/Application.cs deleted file mode 100644 index 58f734ae..00000000 --- a/PARR.DAL/Models/Application.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -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 ApplicationsInHosts { get; set; } = new HashSet(); - //public ICollection Applications { get;set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/ApplicationInHost.cs b/PARR.DAL/Models/ApplicationInHost.cs deleted file mode 100644 index 969c03c0..00000000 --- a/PARR.DAL/Models/ApplicationInHost.cs +++ /dev/null @@ -1,23 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations.Schema; - -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; } - } -} diff --git a/PARR.DAL/Models/ApplicationType.cs b/PARR.DAL/Models/ApplicationType.cs deleted file mode 100644 index df1cc841..00000000 --- a/PARR.DAL/Models/ApplicationType.cs +++ /dev/null @@ -1,18 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations.Schema; - -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; } - - - public ICollection ApplicationTypes { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/Host.cs b/PARR.DAL/Models/Host.cs deleted file mode 100644 index 21b0940e..00000000 --- a/PARR.DAL/Models/Host.cs +++ /dev/null @@ -1,27 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models -{ - [Table("Hosts")] - public class Host : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { 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 ICollection JobJournals { get; set; } = new HashSet(); - public ICollection ApplicationsInHosts { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/Job.cs b/PARR.DAL/Models/Job.cs deleted file mode 100644 index e18b12ea..00000000 --- a/PARR.DAL/Models/Job.cs +++ /dev/null @@ -1,50 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models -{ - [Table("Jobs")] - public class Job : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - public required string Name { get; set; } - public required string ScriptName { get; set; } - - - public Guid JobModeId { get; set; } - [ForeignKey(nameof(JobModeId))] - public JobMode? JobMode { get; set; } - - 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; } - - public Guid ApplicationId { get; set; } - [ForeignKey(nameof(ApplicationId))] - public Application? Application { get; set; } - /// - /// Частота запуска Job в минутах - /// - public int Frequency { get; set; } - /// - /// В режиме manual значит время регистрации регламентной работы АСУ ЕСПП, в auto - время старта Job. - /// - public DateTimeOffset StartAt { get; set; } - /// - /// Активация Job - /// - public bool IsEnabled { get; set; } - - - public ICollection Journals { get; set; } = new HashSet(); - - } -} diff --git a/PARR.DAL/Models/JobCategory.cs b/PARR.DAL/Models/JobCategory.cs deleted file mode 100644 index 69c58dff..00000000 --- a/PARR.DAL/Models/JobCategory.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models -{ - [Table("JobCategories")] - public class JobCategory : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - /// - /// app, db - /// - public required string Name { get; set; } - public string? Description { get; set; } - - - - public ICollection Jobs { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/JobJournal.cs b/PARR.DAL/Models/JobJournal.cs deleted file mode 100644 index 4f2d7c94..00000000 --- a/PARR.DAL/Models/JobJournal.cs +++ /dev/null @@ -1,39 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models -{ - [Table("JobJournals")] - public class JobJournal : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - public DateTimeOffset DateOper { get; set; } - public string? Other { get; set; } - //Возможно нужно перенести в Job - public int? TimeOut { get; set; } - //Возможно нужно перенести в Job - public string? Info { get; set; } - - - - public Guid JobStatusId { get; set; } - - [ForeignKey(nameof(JobStatusId))] - public JobStatus? Status { get; set; } - - - public Guid HostId { get; set; } - - [ForeignKey(nameof(HostId))] - public Host? Host { get; set; } - - - public Guid JobId { get; set; } - [ForeignKey(nameof(JobId))] - public Job? Job { get; set; } - } -} diff --git a/PARR.DAL/Models/JobMode.cs b/PARR.DAL/Models/JobMode.cs deleted file mode 100644 index ca0f74e8..00000000 --- a/PARR.DAL/Models/JobMode.cs +++ /dev/null @@ -1,23 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models -{ - [Table("JobModes")] - public class JobMode : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - /// - /// manual, auto - /// - public required string Name { get; set; } - - - - public ICollection Jobs { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/JobStatus.cs b/PARR.DAL/Models/JobStatus.cs deleted file mode 100644 index 821f4e3d..00000000 --- a/PARR.DAL/Models/JobStatus.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models -{ - [Table("JobStatuses")] - public class JobStatus : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - /// - /// started, finished, timeout, error - /// - public required string Name { get; set; } - public string? Description { get; set; } - - - - public ICollection Journals { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/JobType.cs b/PARR.DAL/Models/JobType.cs deleted file mode 100644 index 54862ca5..00000000 --- a/PARR.DAL/Models/JobType.cs +++ /dev/null @@ -1,23 +0,0 @@ -using PARR.DAL.Models.Base; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace PARR.DAL.Models -{ - [Table("JobTypes")] - public class JobType : IBase - { - [Key] - public Guid Id { get; set; } - public DateTimeOffset DateCreated { get; set; } - public DateTimeOffset? DateModified { get; set; } - /// - /// log-rotate, vacuum-psqld - /// - public required string Name { get; set; } - public string? Description { get; set; } - - - public ICollection Jobs { get; set; } = new HashSet(); - } -} diff --git a/PARR.DAL/Models/Scheduler.cs b/PARR.DAL/Models/Scheduler.cs deleted file mode 100644 index 9fa7ef66..00000000 --- a/PARR.DAL/Models/Scheduler.cs +++ /dev/null @@ -1,19 +0,0 @@ -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; } - //} -} diff --git a/PARR.DAL/Services/Implementations/ApplicationInHostService.cs b/PARR.DAL/Services/Implementations/ApplicationInHostService.cs index 52d87dd1..caeae063 100644 --- a/PARR.DAL/Services/Implementations/ApplicationInHostService.cs +++ b/PARR.DAL/Services/Implementations/ApplicationInHostService.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.DAL.Context; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Abstracts; using PARR.DAL.Services.Interfaces; namespace PARR.DAL.Services.Implementations { - internal class ApplicationInHostService : BaseService, IApplicationInHostService + internal class ApplicationInHostService : BaseService, IApplicationInHostService { private readonly DataContext dataContext; private readonly ILogger logger; @@ -18,7 +18,7 @@ namespace PARR.DAL.Services.Implementations this.logger = logger; } - protected override DbSet EntitySet => dataContext.ApplicationsInHosts; + protected override DbSet EntitySet => dataContext.ApplicationsInHosts; protected override DataContext EntitiContext => dataContext; } diff --git a/PARR.DAL/Services/Implementations/ApplicationService.cs b/PARR.DAL/Services/Implementations/ApplicationService.cs index bdfae542..42562063 100644 --- a/PARR.DAL/Services/Implementations/ApplicationService.cs +++ b/PARR.DAL/Services/Implementations/ApplicationService.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.DAL.Context; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Abstracts; using PARR.DAL.Services.Interfaces; namespace PARR.DAL.Services.Implementations { - internal class ApplicationService : BaseService, IApplicationService + internal class ApplicationService : BaseService, IApplicationService { private readonly DataContext dataContext; private readonly ILogger logger; @@ -18,11 +18,11 @@ namespace PARR.DAL.Services.Implementations this.logger = logger; } - protected override DbSet EntitySet => dataContext.Applications; + protected override DbSet EntitySet => dataContext.Applications; protected override DataContext EntitiContext => dataContext; - public async Task GetByNameAsync(string appName) + public async Task GetByNameAsync(string appName) { return await EntitySet.FirstOrDefaultAsync(t => t.Name.ToLower() == appName.Trim().ToLower()); } diff --git a/PARR.DAL/Services/Implementations/ApplicationTypeService.cs b/PARR.DAL/Services/Implementations/ApplicationTypeService.cs index f0f73ad2..5d446c91 100644 --- a/PARR.DAL/Services/Implementations/ApplicationTypeService.cs +++ b/PARR.DAL/Services/Implementations/ApplicationTypeService.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.DAL.Context; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Abstracts; using PARR.DAL.Services.Interfaces; namespace PARR.DAL.Services.Implementations { - internal class ApplicationTypeService : BaseService, IApplicationTypeService + internal class ApplicationTypeService : BaseService, IApplicationTypeService { private readonly DataContext dataContext; private readonly ILogger logger; @@ -18,7 +18,7 @@ namespace PARR.DAL.Services.Implementations this.logger = logger; } - protected override DbSet EntitySet => dataContext.ApplicationTypes; + protected override DbSet EntitySet => dataContext.ApplicationTypes; protected override DataContext EntitiContext => dataContext; } diff --git a/PARR.DAL/Services/Implementations/HostService.cs b/PARR.DAL/Services/Implementations/HostService.cs index 5c50fb55..ed95a003 100644 --- a/PARR.DAL/Services/Implementations/HostService.cs +++ b/PARR.DAL/Services/Implementations/HostService.cs @@ -1,18 +1,18 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.DAL.Context; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Abstracts; using PARR.DAL.Services.Interfaces; namespace PARR.DAL.Services.Implementations { - internal class HostService : BaseService, IHostService + internal class HostService : BaseService, IHostService { private readonly DataContext dataContext; private readonly ILogger logger; - protected override DbSet EntitySet => dataContext.Hosts; + protected override DbSet EntitySet => dataContext.Hosts; protected override DataContext EntitiContext => dataContext; public HostService(DataContext dataContext, ILogger logger) : base(logger) @@ -21,7 +21,7 @@ namespace PARR.DAL.Services.Implementations this.logger = logger; } - public async Task GetHostWithAppsAsync(string IP, string RegionalEK) + public async Task GetHostWithAppsAsync(string IP, string RegionalEK) { //try @@ -40,7 +40,7 @@ namespace PARR.DAL.Services.Implementations .FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK); } - public async Task GetHostWithAppsAsync(string IP, string linkEK, string regionalEK) + public async Task GetHostWithAppsAsync(string IP, string linkEK, string regionalEK) { return await EntitySet .Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType) @@ -49,7 +49,7 @@ namespace PARR.DAL.Services.Implementations } - public async Task GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK) + public async Task GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK) { return await EntitySet.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK); } diff --git a/PARR.DAL/Services/Implementations/JobCategoryService.cs b/PARR.DAL/Services/Implementations/JobCategoryService.cs index 437eb087..4fa3fa39 100644 --- a/PARR.DAL/Services/Implementations/JobCategoryService.cs +++ b/PARR.DAL/Services/Implementations/JobCategoryService.cs @@ -7,7 +7,7 @@ using PARR.DAL.Services.Interfaces; namespace PARR.DAL.Services.Implementations { - internal class JobCategoryService : BaseService, IJobCategoryService + internal class JobCategoryService : BaseService, IJobCategoryService { private readonly DataContext dataContext; private readonly ILogger logger; @@ -17,7 +17,7 @@ namespace PARR.DAL.Services.Implementations this.dataContext = dataContext; this.logger = logger; } - protected override DbSet EntitySet => dataContext.JobCategories; + protected override DbSet EntitySet => dataContext.JobCategories; protected override DataContext EntitiContext => dataContext; } diff --git a/PARR.DAL/Services/Implementations/JobJournalService.cs b/PARR.DAL/Services/Implementations/JobJournalService.cs index 6317c97f..1b55731e 100644 --- a/PARR.DAL/Services/Implementations/JobJournalService.cs +++ b/PARR.DAL/Services/Implementations/JobJournalService.cs @@ -2,13 +2,13 @@ using Microsoft.Extensions.Logging; using PARR.DAL.Context; using PARR.DAL.Extensions; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Abstracts; using PARR.DAL.Services.Interfaces; namespace PARR.DAL.Services.Implementations { - internal class JobJournalService : BaseService, IJobJournalService + internal class JobJournalService : BaseService, IJobJournalService { private readonly DataContext dataContext; private readonly ILogger logger; @@ -18,11 +18,11 @@ namespace PARR.DAL.Services.Implementations this.dataContext = dataContext; this.logger = logger; } - protected override DbSet EntitySet => dataContext.JobJournals; + protected override DbSet EntitySet => dataContext.JobJournals; protected override DataContext EntitiContext => dataContext; - public async Task GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date) + public async Task GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date) { //var n=DateTimeOffset.UtcNow; //var opers = await EntitySet diff --git a/PARR.DAL/Services/Implementations/JobModeService.cs b/PARR.DAL/Services/Implementations/JobModeService.cs index 58c06b6e..9fab17f1 100644 --- a/PARR.DAL/Services/Implementations/JobModeService.cs +++ b/PARR.DAL/Services/Implementations/JobModeService.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.DAL.Context; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Abstracts; using PARR.DAL.Services.Interfaces; namespace PARR.DAL.Services.Implementations { - internal class JobModeService : BaseService, IJobModeService + internal class JobModeService : BaseService, IJobModeService { private readonly DataContext dataContext; private readonly ILogger logger; @@ -17,7 +17,7 @@ namespace PARR.DAL.Services.Implementations this.dataContext = dataContext; this.logger = logger; } - protected override DbSet EntitySet => dataContext.JobModes; + protected override DbSet EntitySet => dataContext.JobModes; protected override DataContext EntitiContext => dataContext; } diff --git a/PARR.DAL/Services/Implementations/JobService.cs b/PARR.DAL/Services/Implementations/JobService.cs index f8126cd3..707d7680 100644 --- a/PARR.DAL/Services/Implementations/JobService.cs +++ b/PARR.DAL/Services/Implementations/JobService.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.DAL.Context; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Abstracts; using PARR.DAL.Services.Interfaces; using System; @@ -12,7 +12,7 @@ using System.Threading.Tasks; namespace PARR.DAL.Services.Implementations { - internal class JobService : BaseService, IJobService + internal class JobService : BaseService, IJobService { private readonly DataContext dataContext; private readonly ILogger logger; @@ -22,7 +22,7 @@ namespace PARR.DAL.Services.Implementations this.dataContext = dataContext; this.logger = logger; } - protected override DbSet EntitySet => dataContext.Jobs; + protected override DbSet EntitySet => dataContext.Jobs; protected override DataContext EntitiContext => dataContext; diff --git a/PARR.DAL/Services/Implementations/JobStatusService.cs b/PARR.DAL/Services/Implementations/JobStatusService.cs index 1e6b8020..17c09ce2 100644 --- a/PARR.DAL/Services/Implementations/JobStatusService.cs +++ b/PARR.DAL/Services/Implementations/JobStatusService.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.DAL.Context; -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Abstracts; using PARR.DAL.Services.Interfaces; namespace PARR.DAL.Services.Implementations { - internal class JobStatusService : BaseService, IJobStatusService + internal class JobStatusService : BaseService, IJobStatusService { private readonly DataContext dataContext; private readonly ILogger logger; @@ -17,7 +17,7 @@ namespace PARR.DAL.Services.Implementations this.dataContext = dataContext; this.logger = logger; } - protected override DbSet EntitySet => dataContext.JobStatuses; + protected override DbSet EntitySet => dataContext.JobStatuses; protected override DataContext EntitiContext => dataContext; } diff --git a/PARR.DAL/Services/Interfaces/IApplicationInHostService.cs b/PARR.DAL/Services/Interfaces/IApplicationInHostService.cs index c1dc02b3..0b5c67d3 100644 --- a/PARR.DAL/Services/Interfaces/IApplicationInHostService.cs +++ b/PARR.DAL/Services/Interfaces/IApplicationInHostService.cs @@ -1,9 +1,9 @@ -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces { - public interface IApplicationInHostService : IBaseService + public interface IApplicationInHostService : IBaseService { } } diff --git a/PARR.DAL/Services/Interfaces/IApplicationService.cs b/PARR.DAL/Services/Interfaces/IApplicationService.cs index 4834fc61..263cce09 100644 --- a/PARR.DAL/Services/Interfaces/IApplicationService.cs +++ b/PARR.DAL/Services/Interfaces/IApplicationService.cs @@ -1,10 +1,10 @@ -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces { - public interface IApplicationService : IBaseService + public interface IApplicationService : IBaseService { - Task GetByNameAsync(string appName); + Task GetByNameAsync(string appName); } } diff --git a/PARR.DAL/Services/Interfaces/IApplicationTypeService.cs b/PARR.DAL/Services/Interfaces/IApplicationTypeService.cs index 93f6622e..6f9373f2 100644 --- a/PARR.DAL/Services/Interfaces/IApplicationTypeService.cs +++ b/PARR.DAL/Services/Interfaces/IApplicationTypeService.cs @@ -1,9 +1,9 @@ -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces { - public interface IApplicationTypeService : IBaseService + public interface IApplicationTypeService : IBaseService { } } diff --git a/PARR.DAL/Services/Interfaces/IHostService.cs b/PARR.DAL/Services/Interfaces/IHostService.cs index fc7694c4..264c3371 100644 --- a/PARR.DAL/Services/Interfaces/IHostService.cs +++ b/PARR.DAL/Services/Interfaces/IHostService.cs @@ -1,12 +1,12 @@ -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces { - public interface IHostService : IBaseService + public interface IHostService : IBaseService { - Task GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK); - Task GetHostWithAppsAsync(string IP, string linkEK, string regionalEK); + Task GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK); + Task GetHostWithAppsAsync(string IP, string linkEK, string regionalEK); //Task GetHostByRegionalEKAsync(string LinkEK); //Task UpdateAsync(Host host); } diff --git a/PARR.DAL/Services/Interfaces/IJobCategoryService.cs b/PARR.DAL/Services/Interfaces/IJobCategoryService.cs index cf1defbe..b73b0545 100644 --- a/PARR.DAL/Services/Interfaces/IJobCategoryService.cs +++ b/PARR.DAL/Services/Interfaces/IJobCategoryService.cs @@ -3,7 +3,7 @@ using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces { - internal interface IJobCategoryService : IBaseService + internal interface IJobCategoryService : IBaseService { } } diff --git a/PARR.DAL/Services/Interfaces/IJobJournalService.cs b/PARR.DAL/Services/Interfaces/IJobJournalService.cs index e6876f3d..a08c4b12 100644 --- a/PARR.DAL/Services/Interfaces/IJobJournalService.cs +++ b/PARR.DAL/Services/Interfaces/IJobJournalService.cs @@ -1,9 +1,9 @@ -using PARR.DAL.Models; +using PARR.DAL.Models.V1; namespace PARR.DAL.Services.Interfaces { public interface IJobJournalService { - Task GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date); + Task GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date); } } diff --git a/PARR.DAL/Services/Interfaces/IJobModeService.cs b/PARR.DAL/Services/Interfaces/IJobModeService.cs index 312230fc..7d35c788 100644 --- a/PARR.DAL/Services/Interfaces/IJobModeService.cs +++ b/PARR.DAL/Services/Interfaces/IJobModeService.cs @@ -1,9 +1,9 @@ -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces { - internal interface IJobModeService : IBaseService + internal interface IJobModeService : IBaseService { } } diff --git a/PARR.DAL/Services/Interfaces/IJobService.cs b/PARR.DAL/Services/Interfaces/IJobService.cs index 3343d2d8..620367aa 100644 --- a/PARR.DAL/Services/Interfaces/IJobService.cs +++ b/PARR.DAL/Services/Interfaces/IJobService.cs @@ -1,9 +1,9 @@ -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces { - public interface IJobService : IBaseService + public interface IJobService : IBaseService { } } diff --git a/PARR.DAL/Services/Interfaces/IJobStatusService.cs b/PARR.DAL/Services/Interfaces/IJobStatusService.cs index 4fe1eded..78af4cb2 100644 --- a/PARR.DAL/Services/Interfaces/IJobStatusService.cs +++ b/PARR.DAL/Services/Interfaces/IJobStatusService.cs @@ -1,9 +1,9 @@ -using PARR.DAL.Models; +using PARR.DAL.Models.V1; using PARR.DAL.Services.Interfaces.Base; namespace PARR.DAL.Services.Interfaces { - internal interface IJobStatusService : IBaseService + internal interface IJobStatusService : IBaseService { } }