From 5094945c8e63b566cc6edd277f557044d883ca1a Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Tue, 21 Jul 2026 11:48:21 +1000 Subject: [PATCH] =?UTF-8?q?feat(dal,domain):=20=D0=A2=D0=B0=D0=B1=D0=BB?= =?UTF-8?q?=D0=B8=D1=86=D1=8B=20=D1=80=D0=BE=D0=B1=D0=BE=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=D1=8B?= =?UTF-8?q?=20=D0=B2=20=D1=81=D1=85=D0=B5=D0=BC=D1=83=20robot.=20=D0=A1?= =?UTF-8?q?=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B0=20=D1=82=D0=B0=D0=B1=D0=BB?= =?UTF-8?q?=D0=B8=D1=86=D0=B0=20TemplateRenamePendings=20-=20=D0=A8=D0=B0?= =?UTF-8?q?=D0=B1=D0=BB=D0=BE=D0=BD=D1=8B=20=D0=BD=D0=B0=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D1=8F=D1=89=D0=B8=D0=B5=D1=81=D1=8F=20=D0=B2=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D1=86=D0=B5=D1=81=D1=81=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/V1/RobotHistoryController.cs | 2 +- .../V1/RobotTaskRobotStatusController.cs | 1 + .../Statistics/StatRobotHistoryController.cs | 2 +- .../Middleware/GlobalExceptionHandler.cs | 2 +- .../DomainToResponseProfile.cs | 5 +- .../IRobotHistoryLevelRepository.cs | 2 +- .../Interfaces/IRobotHistoryRepository.cs | 2 +- .../Interfaces/IRobotRepository.cs | 2 +- .../Interfaces/IRobotStatusRepository.cs | 2 +- .../Interfaces/IStatusTemplateRepository.cs | 2 +- .../Interfaces/ITaskStatusRepository.cs | 2 +- .../Implementations/RobotTaskService.cs | 1 + PARR.DAL/Context/DataContext.cs | 42 +- PARR.DAL/DependencyInjection.cs | 5 +- ...20233522_tblRobotsUpdateScheme.Designer.cs | 4096 ++++++++++++++++ .../20260720233522_tblRobotsUpdateScheme.cs | 68 + ...20260720233632_tblRobotsRename.Designer.cs | 4096 ++++++++++++++++ .../20260720233632_tblRobotsRename.cs | 222 + ...3444_tblTemplateRenamePendings.Designer.cs | 4133 +++++++++++++++++ ...0260721013444_tblTemplateRenamePendings.cs | 54 + .../Migrations/DataContextModelSnapshot.cs | 343 +- .../RobotHistoryLevelRepository.cs | 2 +- .../Repositories/RobotHistoryRepository.cs | 2 +- PARR.DAL/Repositories/RobotRepository.cs | 2 +- .../Repositories/RobotStatusRepository.cs | 2 +- .../Repositories/StatusTemplateRepository.cs | 2 +- PARR.DAL/Repositories/TaskStatusRepository.cs | 2 +- PARR.Domain/Constants/DatabaseSchemas.cs | 11 +- PARR.Domain/Entities/RobotConfiguration.cs | 3 +- .../Entities/{ => RobotEntities}/Robot.cs | 6 +- .../{ => RobotEntities}/RobotHistory.cs | 6 +- .../{ => RobotEntities}/RobotHistoryLevel.cs | 11 +- .../{ => RobotEntities}/RobotStatus.cs | 6 +- .../{ => RobotEntities}/TaskStatus.cs | 6 +- PARR.Domain/Entities/Template.cs | 3 + .../TemplateEntities/TemplateRenamePending.cs | 31 + 36 files changed, 12965 insertions(+), 214 deletions(-) create mode 100644 PARR.DAL/Migrations/20260720233522_tblRobotsUpdateScheme.Designer.cs create mode 100644 PARR.DAL/Migrations/20260720233522_tblRobotsUpdateScheme.cs create mode 100644 PARR.DAL/Migrations/20260720233632_tblRobotsRename.Designer.cs create mode 100644 PARR.DAL/Migrations/20260720233632_tblRobotsRename.cs create mode 100644 PARR.DAL/Migrations/20260721013444_tblTemplateRenamePendings.Designer.cs create mode 100644 PARR.DAL/Migrations/20260721013444_tblTemplateRenamePendings.cs rename PARR.Domain/Entities/{ => RobotEntities}/Robot.cs (83%) rename PARR.Domain/Entities/{ => RobotEntities}/RobotHistory.cs (90%) rename PARR.Domain/Entities/{ => RobotEntities}/RobotHistoryLevel.cs (64%) rename PARR.Domain/Entities/{ => RobotEntities}/RobotStatus.cs (83%) rename PARR.Domain/Entities/{ => RobotEntities}/TaskStatus.cs (86%) create mode 100644 PARR.Domain/Entities/TemplateEntities/TemplateRenamePending.cs diff --git a/PARR.API/Controllers/V1/RobotHistoryController.cs b/PARR.API/Controllers/V1/RobotHistoryController.cs index ce1a3090..9ff43aa8 100644 --- a/PARR.API/Controllers/V1/RobotHistoryController.cs +++ b/PARR.API/Controllers/V1/RobotHistoryController.cs @@ -14,7 +14,7 @@ using PARR.API.Services.Interfaces; using PARR.Core.Repositories.Interfaces; using PARR.Domain.Common.Pagination; using PARR.Domain.Common.Roles; -using PARR.Domain.Entities; +using PARR.Domain.Entities.RobotEntities; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/RobotTaskRobotStatusController.cs b/PARR.API/Controllers/V1/RobotTaskRobotStatusController.cs index 3d1246ff..91918a33 100644 --- a/PARR.API/Controllers/V1/RobotTaskRobotStatusController.cs +++ b/PARR.API/Controllers/V1/RobotTaskRobotStatusController.cs @@ -11,6 +11,7 @@ using PARR.API.Services.Interfaces; using PARR.Core.Repositories.Interfaces; using PARR.Domain.Common.Roles; using PARR.Domain.Entities; +using PARR.Domain.Entities.RobotEntities; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1 diff --git a/PARR.API/Controllers/V1/Statistics/StatRobotHistoryController.cs b/PARR.API/Controllers/V1/Statistics/StatRobotHistoryController.cs index bdf07f33..34b11b1e 100644 --- a/PARR.API/Controllers/V1/Statistics/StatRobotHistoryController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatRobotHistoryController.cs @@ -12,7 +12,7 @@ using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; using PARR.Core.Repositories.Interfaces; using PARR.Domain.Common.Roles; -using PARR.Domain.Entities; +using PARR.Domain.Entities.RobotEntities; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Infrastructure/Middleware/GlobalExceptionHandler.cs b/PARR.API/Infrastructure/Middleware/GlobalExceptionHandler.cs index 1b202511..91cc75c4 100644 --- a/PARR.API/Infrastructure/Middleware/GlobalExceptionHandler.cs +++ b/PARR.API/Infrastructure/Middleware/GlobalExceptionHandler.cs @@ -18,7 +18,7 @@ namespace PARR.API.Infrastructure.Middleware public async ValueTask TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken) { - logger.LogError(exception, "Ошибка во время запроса {TraceId}: {Message}", httpContext.TraceIdentifier, exception.Message); + logger.LogDebug(exception, "Ошибка во время запроса {TraceId}: {Message}", httpContext.TraceIdentifier, exception.Message); // определяем статус код, в зависимости от типа исключения diff --git a/PARR.API/MappingProfiles/DomainToResponseProfile.cs b/PARR.API/MappingProfiles/DomainToResponseProfile.cs index 604125c4..82b1d151 100644 --- a/PARR.API/MappingProfiles/DomainToResponseProfile.cs +++ b/PARR.API/MappingProfiles/DomainToResponseProfile.cs @@ -16,6 +16,7 @@ using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; using PARR.Domain.Entities.JobEntities; using PARR.Domain.Entities.JobGroupEntities; +using PARR.Domain.Entities.RobotEntities; using PARR.Domain.Entities.Schedule; using PARR.Domain.Entities.Unit; @@ -79,7 +80,7 @@ namespace PARR.API.MappingProfiles .ForMember(d => d.Script, o => o.MapFrom(s => s.AgentScript)) .ForMember(d => d.TimeOutSec, o => o.MapFrom(s => s.AgentTimeOutSec)); - CreateMap(); + CreateMap(); #region ScheduleResponseAreaTimeOffsetResponse @@ -255,7 +256,7 @@ namespace PARR.API.MappingProfiles CreateMap(); - CreateMap(); + CreateMap(); CreateMap() .ForMember(d => d.Robot, o => o.MapFrom(s => s.Robot)) diff --git a/PARR.Core/Repositories/Interfaces/IRobotHistoryLevelRepository.cs b/PARR.Core/Repositories/Interfaces/IRobotHistoryLevelRepository.cs index 7099934f..889159f1 100644 --- a/PARR.Core/Repositories/Interfaces/IRobotHistoryLevelRepository.cs +++ b/PARR.Core/Repositories/Interfaces/IRobotHistoryLevelRepository.cs @@ -1,4 +1,4 @@ -using PARR.Domain.Entities; +using PARR.Domain.Entities.RobotEntities; namespace PARR.Core.Repositories.Interfaces { diff --git a/PARR.Core/Repositories/Interfaces/IRobotHistoryRepository.cs b/PARR.Core/Repositories/Interfaces/IRobotHistoryRepository.cs index 755f501c..df718973 100644 --- a/PARR.Core/Repositories/Interfaces/IRobotHistoryRepository.cs +++ b/PARR.Core/Repositories/Interfaces/IRobotHistoryRepository.cs @@ -1,5 +1,5 @@ using PARR.Core.Repositories.Base; -using PARR.Domain.Entities; +using PARR.Domain.Entities.RobotEntities; namespace PARR.Core.Repositories.Interfaces { diff --git a/PARR.Core/Repositories/Interfaces/IRobotRepository.cs b/PARR.Core/Repositories/Interfaces/IRobotRepository.cs index be9fff60..d3a6f64d 100644 --- a/PARR.Core/Repositories/Interfaces/IRobotRepository.cs +++ b/PARR.Core/Repositories/Interfaces/IRobotRepository.cs @@ -1,4 +1,4 @@ -using PARR.Domain.Entities; +using PARR.Domain.Entities.RobotEntities; namespace PARR.Core.Repositories.Interfaces { diff --git a/PARR.Core/Repositories/Interfaces/IRobotStatusRepository.cs b/PARR.Core/Repositories/Interfaces/IRobotStatusRepository.cs index 921e7996..de80b5a6 100644 --- a/PARR.Core/Repositories/Interfaces/IRobotStatusRepository.cs +++ b/PARR.Core/Repositories/Interfaces/IRobotStatusRepository.cs @@ -1,4 +1,4 @@ -using PARR.Domain.Entities; +using PARR.Domain.Entities.RobotEntities; namespace PARR.Core.Repositories.Interfaces { diff --git a/PARR.Core/Repositories/Interfaces/IStatusTemplateRepository.cs b/PARR.Core/Repositories/Interfaces/IStatusTemplateRepository.cs index 0167027d..5742a0ce 100644 --- a/PARR.Core/Repositories/Interfaces/IStatusTemplateRepository.cs +++ b/PARR.Core/Repositories/Interfaces/IStatusTemplateRepository.cs @@ -2,6 +2,6 @@ { public interface IStatusTemplateRepository { - IQueryable Get(); + IQueryable Get(); } } diff --git a/PARR.Core/Repositories/Interfaces/ITaskStatusRepository.cs b/PARR.Core/Repositories/Interfaces/ITaskStatusRepository.cs index 43e73ff1..c8a64319 100644 --- a/PARR.Core/Repositories/Interfaces/ITaskStatusRepository.cs +++ b/PARR.Core/Repositories/Interfaces/ITaskStatusRepository.cs @@ -2,6 +2,6 @@ { public interface ITaskStatusRepository { - IQueryable Get(); + IQueryable Get(); } } diff --git a/PARR.Core/Services/RobotTask/Implementations/RobotTaskService.cs b/PARR.Core/Services/RobotTask/Implementations/RobotTaskService.cs index 6f0b9249..a10536b5 100644 --- a/PARR.Core/Services/RobotTask/Implementations/RobotTaskService.cs +++ b/PARR.Core/Services/RobotTask/Implementations/RobotTaskService.cs @@ -9,6 +9,7 @@ using PARR.Core.Services.Shortcodes; using PARR.Domain.DTOs.RobotTask; using PARR.Domain.Entities; using PARR.Domain.Entities.Base.History; +using PARR.Domain.Entities.RobotEntities; using PARR.Domain.Enums; using PARR.Domain.Exceptions; using PARR.Domain.Settings; diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index eb645f08..352e91ae 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -8,6 +8,7 @@ using PARR.Domain.Entities.JobGroupEntities; using PARR.Domain.Entities.RobotEntities; using PARR.Domain.Entities.Schedule; using PARR.Domain.Entities.TaskEntities; +using PARR.Domain.Entities.TemplateEntities; using PARR.Domain.Entities.Unit; using PARR.Domain.Enums; using PARR.Domain.Settings; @@ -18,34 +19,13 @@ namespace PARR.DAL.Context { public DataContext(DbContextOptions options) : base(options) { } - //public DbSet Hosts { get; set; } - //public DbSet WorkGroups { get; set; } - //public DbSet AppInWorkInWorkGroups { get; set; } - //public DbSet EkStatuses { get; set; } - //public DbSet ResponseAreas { get; set; } - //public DbSet Applications { get; set; } - //public DbSet ApplicationTypes { get; set; } - //public DbSet ApplicationsInHosts { get; set; } - - public DbSet