feat(dal,api): Удалены старые таблицы AppInWorks

This commit is contained in:
Mikhail Trubnikov
2026-04-15 09:35:03 +10:00
parent 50358fd5bd
commit a93e8de4b0
91 changed files with 4855 additions and 2422 deletions

View File

@@ -1,14 +0,0 @@
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Repositories.Base;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class ApplicationInHostService : BaseRepository<ApplicationInHost>, IApplicationInHostService
{
public ApplicationInHostService(DataContext dataContext, ILogger<ApplicationInHostService> logger) : base(logger, dataContext) { }
}
}

View File

@@ -1,19 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Repositories.Base;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class ApplicationService : BaseRepository<Application>, IApplicationService
{
public ApplicationService(DataContext dataContext, ILogger<ApplicationService> logger) : base(logger, dataContext) { }
public async Task<Application?> GetByNameAsync(string appName, Guid typeId)
{
return await EntitySet.FirstOrDefaultAsync(t => t.Name.ToLower() == appName.Trim().ToLower() && t.ApplicationTypeId == typeId);
}
}
}

View File

@@ -1,14 +0,0 @@
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Repositories.Base;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementation
{
internal class ApplicationTypeService : BaseRepository<ApplicationType>, IApplicationTypeService
{
public ApplicationTypeService(DataContext dataContext, ILogger<ApplicationTypeService> logger) : base(logger, dataContext) { }
}
}

View File

@@ -1,19 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Repositories.Base;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class ApplicationsInWorkService : BaseRepository<ApplicationsInWork>, IApplicationsInWorkService
{
public ApplicationsInWorkService(DataContext dataContext, ILogger<ApplicationsInWorkService> logger) : base(logger, dataContext) { }
public async Task<ApplicationsInWork?> GetAsync(Guid applicationId, Guid workId)
{
return await base.Get().FirstOrDefaultAsync(t => t.ApplicationId == applicationId && t.WorkId == workId);
}
}
}

View File

@@ -1,20 +0,0 @@
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class EkStatusService : IEkStatusService
{
private readonly DataContext dataContext;
public EkStatusService(DataContext dataContext)
{
this.dataContext = dataContext;
}
public IQueryable<EkStatus> Get()
{
return dataContext.EkStatuses;
}
}
}

View File

@@ -1,54 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Repositories.Base;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class HostService : BaseRepository<Host>, IHostService
{
public HostService(DataContext dataContext, ILogger<HostService> logger) : base(logger, dataContext) { }
public async Task<Host?> GetHostWithAppsByIpAsync(string ip)
{
return await GetHostWithIncludeApps()
.AsSplitQuery()
.FirstOrDefaultAsync(h => h.IP == ip);
}
public async Task<Host?> GetHostWithAppsByEkAsync(string ek)
{
return await GetHostWithIncludeApps()
.AsSplitQuery()
.FirstOrDefaultAsync(h => h.Ek.ToLower() == ek.ToLower());
}
private IQueryable<Host> GetHostWithIncludeApps()
{
return EntitySet
.Include(t => t.ApplicationsInHosts)
.ThenInclude(a => a.Application)
.ThenInclude(t => t!.ApplicationType)
.Include(t => t.WorkGroup);
}
public async Task<Host?> GetByIpAsync(string ip)
{
return await EntitySet.FirstOrDefaultAsync(t => t.IP == ip);
}
public async Task<Host?> GetByEkAsync(string ek)
{
return await EntitySet.FirstOrDefaultAsync(t => t.Ek.ToLower() == ek.ToLower());
}
}
}

View File

@@ -1,21 +0,0 @@
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class ResponseAreaService : IResponseAreaService
{
private readonly DataContext dataContext;
public ResponseAreaService(DataContext dataContext)
{
this.dataContext = dataContext;
}
public IQueryable<ResponseArea> Get()
{
return dataContext.ResponseAreas;
}
}
}

View File

@@ -1,19 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Repositories.Base;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class WorkGroupService : BaseRepository<WorkGroup>, IWorkGroupService
{
public WorkGroupService(DataContext dataContext, ILogger<WorkGroupService> logger) : base(logger, dataContext) { }
public async Task<WorkGroup?> GetByNameAsync(string name)
{
return await Get().FirstOrDefaultAsync(t => t.Name == name);
}
}
}

View File

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

View File

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

View File

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

View File

@@ -1,10 +0,0 @@
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IApplicationsInWorkService : IBaseService<ApplicationsInWork>
{
Task<ApplicationsInWork?> GetAsync(Guid applicationId, Guid workId);
}
}

View File

@@ -1,9 +0,0 @@
using PARR.DAL.Models;
namespace PARR.DAL.Services.Interfaces
{
public interface IEkStatusService
{
IQueryable<EkStatus> Get();
}
}

View File

@@ -1,14 +0,0 @@
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IHostService : IBaseService<Host>
{
Task<Host?> GetHostWithAppsByIpAsync(string ip);
Task<Host?> GetByIpAsync(string ip);
Task<Host?> GetHostWithAppsByEkAsync(string ek);
Task<Host?> GetByEkAsync(string ek);
}
}

View File

@@ -1,9 +0,0 @@
using PARR.DAL.Models;
namespace PARR.DAL.Services.Interfaces
{
public interface IResponseAreaService
{
IQueryable<ResponseArea> Get();
}
}

View File

@@ -1,10 +0,0 @@
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IWorkGroupService : IBaseService<WorkGroup>
{
Task<WorkGroup?> GetByNameAsync(string name);
}
}