feat(dal,api): Удалены старые таблицы AppInWorks
This commit is contained in:
@@ -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) { }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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) { }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IApplicationInHostService : IBaseService<ApplicationInHost>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IApplicationTypeService : IBaseService<ApplicationType>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IEkStatusService
|
||||
{
|
||||
IQueryable<EkStatus> Get();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IResponseAreaService
|
||||
{
|
||||
IQueryable<ResponseArea> Get();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user