diff --git a/PARR.AIHITMainLoader/AihitMainLoader.cs b/PARR.AIHITMainLoader/AihitMainLoader.cs index 056ec037..8fadc1c9 100644 --- a/PARR.AIHITMainLoader/AihitMainLoader.cs +++ b/PARR.AIHITMainLoader/AihitMainLoader.cs @@ -4,6 +4,7 @@ using PARR.AIHITMainLoader.Models; using PARR.AIHITMainLoader.Services; using PARR.AIHITMainLoader.Settings; using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; using System.Text.Encodings.Web; using System.Text.Json; @@ -16,7 +17,7 @@ namespace PARR.AIHITMainLoader private readonly WorkerSettings workerSettings; private readonly LoaderSettings loaderSettings; private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly IServiceProvider serviceProvider; private static readonly JsonSerializerOptions jsonOptions = new JsonSerializerOptions @@ -30,7 +31,7 @@ namespace PARR.AIHITMainLoader WorkerSettings workerSettings, LoaderSettings loaderSettings, MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, IServiceProvider serviceProvider ) { diff --git a/PARR.AIHITMainLoader/Context/AIHITContext.cs b/PARR.AIHITMainLoader/Context/AIHITContext.cs index 194d8630..4aaa935c 100644 --- a/PARR.AIHITMainLoader/Context/AIHITContext.cs +++ b/PARR.AIHITMainLoader/Context/AIHITContext.cs @@ -1,6 +1,5 @@ using Microsoft.EntityFrameworkCore; using PARR.AIHITMainLoader.Models; -using PARR.BLL.Domain.Mq; namespace PARR.AIHITMainLoader.Context { diff --git a/PARR.AIHITMainLoader/Models/CvkData.cs b/PARR.AIHITMainLoader/Models/CvkData.cs index 74ca8f1d..7f0dc23b 100644 --- a/PARR.AIHITMainLoader/Models/CvkData.cs +++ b/PARR.AIHITMainLoader/Models/CvkData.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.AIHITMainLoader/Models/IMainData.cs b/PARR.AIHITMainLoader/Models/IMainData.cs index 071dfc6f..43777e71 100644 --- a/PARR.AIHITMainLoader/Models/IMainData.cs +++ b/PARR.AIHITMainLoader/Models/IMainData.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; namespace PARR.AIHITMainLoader.Models { diff --git a/PARR.AIHITMainLoader/Models/OrgData.cs b/PARR.AIHITMainLoader/Models/OrgData.cs index dfe30bf5..5c2a93f5 100644 --- a/PARR.AIHITMainLoader/Models/OrgData.cs +++ b/PARR.AIHITMainLoader/Models/OrgData.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.AIHITMainLoader/Models/PtkData.cs b/PARR.AIHITMainLoader/Models/PtkData.cs index ac1f0bfb..3694ae4b 100644 --- a/PARR.AIHITMainLoader/Models/PtkData.cs +++ b/PARR.AIHITMainLoader/Models/PtkData.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.AIHITMainLoader/Models/RegEKData.cs b/PARR.AIHITMainLoader/Models/RegEKData.cs index c863d547..211895e0 100644 --- a/PARR.AIHITMainLoader/Models/RegEKData.cs +++ b/PARR.AIHITMainLoader/Models/RegEKData.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.AIHITMainLoader/Models/StoData.cs b/PARR.AIHITMainLoader/Models/StoData.cs index b1df2c4d..bb7b0842 100644 --- a/PARR.AIHITMainLoader/Models/StoData.cs +++ b/PARR.AIHITMainLoader/Models/StoData.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj b/PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj index 7fb31cbc..de20737b 100644 --- a/PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj +++ b/PARR.AIHITMainLoader/PARR.AIHITMainLoader.csproj @@ -12,6 +12,9 @@ + + + diff --git a/PARR.AIHITMainLoader/Settings/MqSettings.cs b/PARR.AIHITMainLoader/Settings/MqSettings.cs index e2ac1260..27f35e8b 100644 --- a/PARR.AIHITMainLoader/Settings/MqSettings.cs +++ b/PARR.AIHITMainLoader/Settings/MqSettings.cs @@ -1,17 +1,17 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.AIHITMainLoader.Settings { internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; + public string HostName { get; init; } = string.Empty; - public string QueueName { get; set; } = string.Empty; + public string QueueName { get; init; } = string.Empty; - public string User { get; set; } = string.Empty; + public string User { get; init; } = string.Empty; - public string Password { get; set; } = string.Empty; + public string Password { get; init; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.AIHITMainSyncer/AihitMainSyncer.cs b/PARR.AIHITMainSyncer/AihitMainSyncer.cs index 54dbf239..5b2f0078 100644 --- a/PARR.AIHITMainSyncer/AihitMainSyncer.cs +++ b/PARR.AIHITMainSyncer/AihitMainSyncer.cs @@ -2,20 +2,20 @@ using Microsoft.Extensions.Logging; using PARR.AIHITMainSyncer.Services; using PARR.AIHITMainSyncer.Settings; -using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; namespace PARR.AIHITMainSyncer { internal class AihitMainSyncer : IAihitMainSyncer { private readonly ILogger logger; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly MqSettings mqSettings; private readonly IServiceProvider serviceProvider; public AihitMainSyncer( ILogger logger, - IMqService mqService, + IRabbitService mqService, MqSettings mqSettings, IServiceProvider serviceProvider ) diff --git a/PARR.AIHITMainSyncer/Services/SyncerService.cs b/PARR.AIHITMainSyncer/Services/SyncerService.cs index 3519162f..f1781d53 100644 --- a/PARR.AIHITMainSyncer/Services/SyncerService.cs +++ b/PARR.AIHITMainSyncer/Services/SyncerService.cs @@ -2,10 +2,10 @@ using Microsoft.Extensions.Logging; using Newtonsoft.Json.Linq; using PARR.AIHITMainSyncer.Settings; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; using PARR.DAL.Models.Unit; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Rabbit.Messages; namespace PARR.AIHITMainSyncer.Services { diff --git a/PARR.AIHITMainSyncer/Settings/MqSettings.cs b/PARR.AIHITMainSyncer/Settings/MqSettings.cs index 01a22e0b..dc57c30a 100644 --- a/PARR.AIHITMainSyncer/Settings/MqSettings.cs +++ b/PARR.AIHITMainSyncer/Settings/MqSettings.cs @@ -1,17 +1,17 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.AIHITMainSyncer.Settings { internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; + public string HostName { get; init; } = string.Empty; - public string QueueName { get; set; } = string.Empty; + public string QueueName { get; init; } = string.Empty; - public string User { get; set; } = string.Empty; + public string User { get; init; } = string.Empty; - public string Password { get; set; } = string.Empty; + public string Password { get; init; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.API.sln b/PARR.API.sln index 80777162..6c55f29e 100644 --- a/PARR.API.sln +++ b/PARR.API.sln @@ -44,8 +44,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.EsppApi", "PARR.EsppAp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.Test", "PARR.Test\PARR.Test.csproj", "{CFE2A198-67BF-4828-8E8D-31A01858FDA7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.Constants", "PARR.Constants\PARR.Constants.csproj", "{46B09885-C9FB-449C-ACAA-24C671194C4D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.EsppSync", "PARR.EsppSync\PARR.EsppSync.csproj", "{71121EF7-D4C1-43A4-9243-EF5C4C82030F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.EsppScheduleSync", "PARR.EsppScheduleSync\PARR.EsppScheduleSync.csproj", "{1E7F0EFE-784E-42E1-96BA-1FF743998619}" @@ -170,10 +168,6 @@ Global {CFE2A198-67BF-4828-8E8D-31A01858FDA7}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFE2A198-67BF-4828-8E8D-31A01858FDA7}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFE2A198-67BF-4828-8E8D-31A01858FDA7}.Release|Any CPU.Build.0 = Release|Any CPU - {46B09885-C9FB-449C-ACAA-24C671194C4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46B09885-C9FB-449C-ACAA-24C671194C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46B09885-C9FB-449C-ACAA-24C671194C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46B09885-C9FB-449C-ACAA-24C671194C4D}.Release|Any CPU.Build.0 = Release|Any CPU {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Debug|Any CPU.Build.0 = Debug|Any CPU {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/PARR.API/Contracts/V1/Requests/GeneratorTemplateRequest.cs b/PARR.API/Contracts/V1/Requests/GeneratorTemplateRequest.cs index f19c953a..ff05f783 100644 --- a/PARR.API/Contracts/V1/Requests/GeneratorTemplateRequest.cs +++ b/PARR.API/Contracts/V1/Requests/GeneratorTemplateRequest.cs @@ -1,46 +1,46 @@ namespace PARR.API.Contracts.V1.Requests { - public class GeneratorTemplateRequest - { - /// - /// Id работы - /// - public Guid WorkId { get; set; } + //public class GeneratorTemplateRequest + //{ + // /// + // /// Id работы + // /// + // public Guid WorkId { get; set; } - /// - /// Id приложения - /// - public Guid ApplicationId { get; set; } + // /// + // /// Id приложения + // /// + // public Guid ApplicationId { get; set; } - /// - /// Действие: create, deactivate - /// - public required string Action { get; set; } + // /// + // /// Действие: create, deactivate + // /// + // public required string Action { get; set; } - ///// - ///// ЭК, принимает регулярное выражение. Например: *, ВРТ-*-ДВС - ///// - //public required string Ek { get; set; } + // ///// + // ///// ЭК, принимает регулярное выражение. Например: *, ВРТ-*-ДВС + // ///// + // //public required string Ek { get; set; } - /// - /// ЭК, принимает список маск. Например: *, ВРТ-*-ДВС - /// - public required List Ek { get; set; } + // /// + // /// ЭК, принимает список маск. Например: *, ВРТ-*-ДВС + // /// + // public required List Ek { get; set; } - /// - /// Список статусов ЭК. 0 - все статусы, 1,2,3,4,5,6,7,9 - /// - public required List Status { get; set; } + // /// + // /// Список статусов ЭК. 0 - все статусы, 1,2,3,4,5,6,7,9 + // /// + // public required List Status { get; set; } - /// - /// При создании, активировать шаблон - /// - public bool? IsActiveTemplate { get; set; } + // /// + // /// При создании, активировать шаблон + // /// + // public bool? IsActiveTemplate { get; set; } - /// - /// При создании, активировать расписание - /// - public bool? IsActiveSchedule { get; set; } - } + // /// + // /// При создании, активировать расписание + // /// + // public bool? IsActiveSchedule { get; set; } + //} } diff --git a/PARR.API/Contracts/V1/Requests/MatchTemplatesRequest.cs b/PARR.API/Contracts/V1/Requests/MatchTemplatesRequest.cs index b59cfd0c..4a076b19 100644 --- a/PARR.API/Contracts/V1/Requests/MatchTemplatesRequest.cs +++ b/PARR.API/Contracts/V1/Requests/MatchTemplatesRequest.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.API.Contracts.V1.Requests { diff --git a/PARR.API/Contracts/V1/Requests/Queries/RobotHistoryQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/RobotHistoryQuery.cs index 40440021..d80113fd 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/RobotHistoryQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/RobotHistoryQuery.cs @@ -1,5 +1,4 @@ -using PARR.Constants; -using PARR.Domain.Enums; +using PARR.Domain.Enums; namespace PARR.API.Contracts.V1.Requests.Queries { diff --git a/PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs index 5e15b38f..94205254 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; using System.Text.Json.Serialization; namespace PARR.API.Contracts.V1.Requests.Queries diff --git a/PARR.API/Contracts/V1/Requests/RobotStateRequest.cs b/PARR.API/Contracts/V1/Requests/RobotStateRequest.cs index b0978c73..98f726c6 100644 --- a/PARR.API/Contracts/V1/Requests/RobotStateRequest.cs +++ b/PARR.API/Contracts/V1/Requests/RobotStateRequest.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.API.Contracts.V1.Requests { diff --git a/PARR.API/Contracts/V1/Requests/TemplateActivatorRequest.cs b/PARR.API/Contracts/V1/Requests/TemplateActivatorRequest.cs index 4210a9e9..230b9029 100644 --- a/PARR.API/Contracts/V1/Requests/TemplateActivatorRequest.cs +++ b/PARR.API/Contracts/V1/Requests/TemplateActivatorRequest.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.API.Contracts.V1.Requests { diff --git a/PARR.API/Contracts/V1/Responses/ShortcodeResponse.cs b/PARR.API/Contracts/V1/Responses/ShortcodeResponse.cs index 45a4abdf..c64e060d 100644 --- a/PARR.API/Contracts/V1/Responses/ShortcodeResponse.cs +++ b/PARR.API/Contracts/V1/Responses/ShortcodeResponse.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.API.Contracts.V1.Responses { diff --git a/PARR.API/Controllers/V1/AgentHistoryController.cs b/PARR.API/Controllers/V1/AgentHistoryController.cs index 4d6ac08f..dd1831a5 100644 --- a/PARR.API/Controllers/V1/AgentHistoryController.cs +++ b/PARR.API/Controllers/V1/AgentHistoryController.cs @@ -11,11 +11,11 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Unit; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/AgentTaskController.cs b/PARR.API/Controllers/V1/AgentTaskController.cs index b9b2f709..0821e303 100644 --- a/PARR.API/Controllers/V1/AgentTaskController.cs +++ b/PARR.API/Controllers/V1/AgentTaskController.cs @@ -4,9 +4,9 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Requests.Queries; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ApplicationController.cs b/PARR.API/Controllers/V1/ApplicationController.cs index 51f007f3..aaaf9f69 100644 --- a/PARR.API/Controllers/V1/ApplicationController.cs +++ b/PARR.API/Controllers/V1/ApplicationController.cs @@ -8,10 +8,10 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ApplicationInWorkController.cs b/PARR.API/Controllers/V1/ApplicationInWorkController.cs deleted file mode 100644 index 0332139c..00000000 --- a/PARR.API/Controllers/V1/ApplicationInWorkController.cs +++ /dev/null @@ -1,442 +0,0 @@ -using AutoMapper; -using FluentValidation; -using Microsoft.AspNetCore.Authorization; -using PARR.API.Contracts.V1.Requests; -using PARR.API.Contracts.V1.Responses; -using PARR.API.Controllers.V1.Base; -using PARR.API.Services.Interfaces; -using PARR.API.Settings; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; -using PARR.DAL.Services.Interfaces; - -namespace PARR.API.Controllers.V1 -{ - [Authorize(Roles = ParrRoles.Administrator.Role)] - public class ApplicationInWorkController : BaseApiController - { - private readonly ILogger logger; - private readonly IMapper mapper; - private readonly IApplicationsInWorkService applicationsInWorkService; - private readonly IValidator validator; - private readonly IUriService uriService; - private readonly ITemplateService templateService; - private readonly IMqService mqService; - private readonly MqSettings mqSettings; - - public ApplicationInWorkController( - ILogger logger, - IMapper mapper, - IApplicationsInWorkService applicationsInWorkService, - IValidator validator, - IUriService uriService, - ITemplateService templateService, - IMqService mqService, - MqSettings mqSettings - ) - { - this.logger = logger; - this.mapper = mapper; - this.applicationsInWorkService = applicationsInWorkService; - this.validator = validator; - this.uriService = uriService; - this.templateService = templateService; - this.mqService = mqService; - this.mqSettings = mqSettings; - } - - - /// - /// Получить список заданий на выполнение работ(ApplicationInWork) постранично - /// - /// - //[HttpGet(ApiRoutes.Job.GetAll)] - //public async Task GetAll([FromQuery] PaginationQuery paginationQuery, [FromQuery] ApplicationInWorkQuery filter) - //{ - // var paginationFilter = mapper.Map(paginationQuery); - - // IQueryable query = applicationsInWorkService.Get().Include(t => t.Application).ThenInclude(t => t!.ApplicationType); - - // if (filter.IsLight != true) - // { - // query = query - // .Include(t => t.Work) - // //.Include(t => t.Templates) - большой запрос, делаем его отдельно - // .Include(t => t.WorkGroups).ThenInclude(t => t.WorkGroup) - // .Include(t => t.JobAutoControl); - // } - - // query = query.OrderBy(t => t.ShortDescription).ThenBy(t => t.Application!.Name); - - // if (!string.IsNullOrEmpty(filter.ShortDescription)) - // query = query.Where(t => t.ShortDescription.ToLower().Contains(filter.ShortDescription.ToLower())); - - // if (filter.WorkId.HasValue) - // query = query.Where(t => t.WorkId == filter.WorkId.Value); - - // var appInWorks = await applicationsInWorkService.GetPage(query, paginationFilter).ToListAsync(); - - // if (!appInWorks.Any()) - // return NoContent(); - - // var response = mapper.Map>(appInWorks);//TODO Migration to job - - // if (filter.IsLight != true) - // { - // //Если запрос не легкий, загружаем кол-во шаблонов отдельно, это значительно ускоряет запрос - // foreach (var item in response) - // { - // item.TemplatesCount = await templateService.Get().CountAsync(t => t.JobId == item.Id); - - // var statistics = await GetStatisticsAsync(item.Id); - // BindStatistics(item, statistics); - // } - // } - - // var paginationResponse = new PagedResponse(response, true).GetPaginatedProps(paginationFilter, query); - - // return Ok(paginationResponse); - //} - - - /// - /// Получить задание на выполнение работ по id - /// - /// - /// - //[HttpGet(ApiRoutes.Job.Get)] - //public async Task GetById([FromRoute] Guid id) - //{ - // var applicationInWork = await applicationsInWorkService.Get() - // .Include(t => t.Application).ThenInclude(t => t!.ApplicationType) - // .Include(t => t.Work) - // //.Include(t => t.Templates) - // .Include(t => t.WorkGroups).ThenInclude(t => t.WorkGroup) - // .Include(t => t.JobAutoControl) - // .FirstOrDefaultAsync(t => t.Id == id); - - // if (applicationInWork == null) - // return NotFound(); - - // var response = mapper.Map(applicationInWork); - // response.TemplatesCount = await templateService.Get().CountAsync(t => t.ApplicationInWorkId == id); - - // var statistics = await GetStatisticsAsync(response.Id); - // BindStatistics(response, statistics); - - // return Ok(new Response(response, true)); - //} - - - /// - /// Создать задание на выполнение работ (ApplicationInWork) - /// - /// - /// - //[HttpPost(ApiRoutes.Job.Create)] - //public async Task Create([FromBody] ApplicationInWorkRequest request) - //{ - // var resultValidate = await validator.ValidateAsync(request); - - // if (!resultValidate.IsValid) - // return BadRequest(new Response(resultValidate.Errors)); - - // //уникальная запись по полям ApplicationId, WorkId - // var existSameAiW = await applicationsInWorkService.GetAsync(request.ApplicationId, request.WorkId); - // if (existSameAiW != null) - // return BadRequest(new Response(false, new List { new ErrorModel { Message = "Задание на выполнение работ с такими ПО и работой уже существует" } })); - - // var applicationInWork = new ApplicationsInWork - // { - // Id = Guid.NewGuid(), - // WorkId = request.WorkId, - // ApplicationId = request.ApplicationId, - // TemplateDuration = request.TemplateDuration, - // ShortDescription = request.ShortDescription.Trim(), - // FullDescription = request.FullDescription.Trim(), - // Solution = request.Solution.Trim(), - // //NextRun = request.NextRun, - // IsAutoDistributionEnabled = request.IsAutoDistributionEnabled, - // ReferenceDate = request.ReferenceDate, - // IsAgent = request.IsAgent, - // AgentName = request.AgentName?.Trim(), - // AgentTimeOutSec = request.AgentTimeOutSec, - // AgentScript = request.AgentScript?.Trim() - // }; - - // //Добавляем настройки планировщика - // request.Schedule.ForEach(item => - // { - // applicationInWork.EsppSchValues.Add(new EsppSchValue - // { - // ApplicationsInWorkId = applicationInWork.Id, - // TypeConfigId = item.TypeConfigId, - // TypeValueId = item.TypeValueId - // }); - // }); - - // //Добавляем рабочие группы - // request.WorkGroups.ForEach(workGroupId => - // { - // applicationInWork.WorkGroups.Add(new AppInWorkInWorkGroup - // { - // ApplicationsInWorkId = applicationInWork.Id, - // WorkGroupId = workGroupId - // }); - // }); - - // if (!await applicationsInWorkService.CreateAsync(applicationInWork) || !await applicationsInWorkService.CommitAsync()) - // return BadRequest(new Response(false, new List { new ErrorModel { Message = "Ошибка при созании задания на выполнение работ" } })); - - // logger.LogInformation($"Пользователь {User.Identity?.Name} добавил задание на выполнение работ: {applicationInWork.Id}, {applicationInWork.ShortDescription}, {applicationInWork.Solution}"); - - - // var createdApplicationInWork = await applicationsInWorkService.Get() - // .Include(t => t.Application).ThenInclude(t => t!.ApplicationType) - // .Include(t => t.Work) - // //.Include(t => t.Templates) - // .Include(t => t.WorkGroups).ThenInclude(t => t.WorkGroup) - // .Include(t => t.JobAutoControl) - // .FirstAsync(t => t.Id == applicationInWork.Id); - - // var locationUri = uriService.GetUri(ApiRoutes.Job.Get, ApiRoutes.Job.getParam, createdApplicationInWork.Id); - - // var response = mapper.Map(createdApplicationInWork); - // // так как мы только что создали AppInW, то у него нет шаблонов, смело ставим = 0 (ускоряем запрос) - // response.TemplatesCount = 0; - - // return Created(locationUri, new Response(response, true)); - //} - - - /// - /// Обновить задание на выполнение работ (ApplicationInWork) - /// - /// - /// - /// - //[HttpPut(ApiRoutes.Job.Update)] - //public async Task Update([FromRoute] Guid id, [FromBody] ApplicationInWorkRequest request) - //{ - // var resultValidate = await validator.ValidateAsync(request); - // if (!resultValidate.IsValid) - // return BadRequest(new Response(resultValidate.Errors)); - - // //уникальная запись по полям ApplicationId, WorkId у которой id!=[FromRoute]id - // var existSameAiW = await applicationsInWorkService.Get() - // .FirstOrDefaultAsync(t => t.Id != id && t.ApplicationId == request.ApplicationId && t.WorkId == request.WorkId); - // if (existSameAiW != null) - // return BadRequest(new Response(false, new List { new ErrorModel { Message = "Задание на выполнение работ с такими ПО и работой уже существует" } })); - - // var orig = await applicationsInWorkService.Get() - // .Include(t => t.WorkGroups) - // .Include(t => t.EsppSchValues) - // .FirstOrDefaultAsync(t => t.Id == id); - - // if (orig == null) - // return BadRequest(new Response(false, new List { new ErrorModel { Message = $"Ошибка при изменении задания на выполнение работ. Не найдено задание с Id: {id}" } })); - - // //Расписание было изменено, ниже добавим задание в очередь на обновление расписаний у связанных шаблонов - // var isScheduleChanged = IsScheduleChanged(orig, request); - - // orig.WorkId = request.WorkId; - // orig.ApplicationId = request.ApplicationId; - // orig.TemplateDuration = request.TemplateDuration; - // orig.ShortDescription = request.ShortDescription.Trim(); - // orig.FullDescription = request.FullDescription.Trim(); - // orig.Solution = request.Solution.Trim(); - // //orig.NextRun = request.NextRun; - // orig.ReferenceDate = request.ReferenceDate; - // orig.IsAutoDistributionEnabled = request.IsAutoDistributionEnabled; - // orig.IsAgent = request.IsAgent; - // orig.AgentName = request.AgentName?.Trim(); - // orig.AgentTimeOutSec = request.AgentTimeOutSec; - // orig.AgentScript = request.AgentScript?.Trim(); - // orig.DateModified = DateTimeOffset.UtcNow; - - // //обновляем планировщик - // orig.EsppSchValues.Clear(); - // request.Schedule.ForEach(item => - // { - // orig.EsppSchValues.Add(new EsppSchValue - // { - // ApplicationsInWorkId = orig.Id, - // TypeConfigId = item.TypeConfigId, - // TypeValueId = item.TypeValueId - // }); - // }); - - // //Обновляем рабочие группы - // orig.WorkGroups.Clear(); - // request.WorkGroups.ForEach(workGroupId => - // { - // orig.WorkGroups.Add(new AppInWorkInWorkGroup - // { - // ApplicationsInWorkId = orig.Id, - // WorkGroupId = workGroupId - // }); - // }); - - - // if (!await applicationsInWorkService.CommitAsync()) - // return BadRequest(new Response(false, new List { new ErrorModel { Message = "Ошибка при изменении задания на выполнение работ." } })); - - // logger.LogInformation($"Пользователь {User.Identity?.Name} обновил задание на выполнение работ: {orig.Id}," + - // $" {orig.WorkId}, {orig.ApplicationId}, {orig.TemplateDuration}, {orig.ShortDescription}," + - // $" {orig.FullDescription}, {orig.Solution}, {nameof(orig.IsAutoDistributionEnabled)}: {orig.IsAutoDistributionEnabled}, {orig.IsAgent}, {orig.AgentName}, {orig.AgentTimeOutSec}, {orig.AgentScript}"); - - - // if (isScheduleChanged) - // { - // //расписание было обновлено, отправим задание в очередь на перерасчет NextRun - // var requestToMq = new TemplateDistributorMq - // { - // ApplicationInWorkId = id - // }; - - // var msg = JsonSerializer.Serialize(requestToMq); - - // logger.LogDebug($"Расписание в РР applicationInWorkId: {id} было изменено. Отправляем задание в очередь на перерасчет NextRun"); - - // var sendResult = mqService.Send(mqSettings.TemplateDistributor, new[] { msg }); - - // if (sendResult.IsSuccess) - // logger.LogInformation($"Задание на перерасчет NextRun успешно отправлено в очередь MQ {mqSettings.TemplateDistributor.QueueName}"); - // else - // logger.LogError($"Ошибка при отправке задания на перерасчет NextRun в очередь MQ {mqSettings.TemplateDistributor.QueueName}"); - // } - - // var updatedApplicationInWork = await applicationsInWorkService.Get() - // .Include(t => t.Application).ThenInclude(t => t!.ApplicationType) - // .Include(t => t.Work) - // //.Include(t => t.Templates) - // .Include(t => t.WorkGroups).ThenInclude(t => t.WorkGroup) - // .Include(t => t.JobAutoControl) - // .FirstAsync(t => t.Id == orig.Id); - - // var response = mapper.Map(updatedApplicationInWork); - // response.TemplatesCount = await templateService.Get().CountAsync(t => t.ApplicationInWorkId == id); - - // var statistics = await GetStatisticsAsync(response.Id); - // BindStatistics(response, statistics); - - // return Ok(new Response(response, true)); - - //} - - - /// - /// Удалить задание на выполнение работ (только если нет связанных шаблонов) - /// - /// - /// - //[HttpDelete(ApiRoutes.Job.Delete)] - //public async Task Delete([FromRoute] Guid id) - //{ - // var applicationsInWork = await applicationsInWorkService.Get() - // //.Include(t => t.Templates) - // .FirstOrDefaultAsync(t => t.Id == id); - - // if (applicationsInWork == null) - // return BadRequest(new Response(false, new List { new ErrorModel { - // Message = $"Ошибка при удалении задания на выполнение работ. Не найдено задание на выполнение работ Id: {id}" - // } })); - - // var templateCount = await templateService.Get().CountAsync(t => t.ApplicationInWorkId == id); - - // //if (applicationsInWork.Templates.Any()) - // if (templateCount > 0) - // return BadRequest(new Response(false, new List { new ErrorModel { - // Message = $"Ошибка при удалении задания на выполнение работ. С данным заданием связаны шаблоны: {templateCount} шт." - // } })); - - // if (!applicationsInWorkService.Delete(applicationsInWork) || !await applicationsInWorkService.CommitAsync()) - // return BadRequest(new Response(false, new List { new ErrorModel { - // Message = $"Ошибка при удалении задания на выполнение работ" - // } })); - - // logger.LogInformation($"Пользователь {User.Identity?.Name} удалил задание на выполнение работ: {applicationsInWork.Id},{applicationsInWork.WorkId}," + - // $" {applicationsInWork.ApplicationId}, {applicationsInWork.TemplateDuration}, {applicationsInWork.ShortDescription}," + - // $" {applicationsInWork.FullDescription}, {applicationsInWork.Solution}, {nameof(applicationsInWork.IsAutoDistributionEnabled)}: {applicationsInWork.IsAutoDistributionEnabled}, {applicationsInWork.IsAgent}," + - // $" {applicationsInWork.AgentName}, {applicationsInWork.AgentTimeOutSec}, {applicationsInWork.AgentScript}"); - - // return NoContent(); - //} - - - /// - /// Проверка, были ли изменения в расписании - /// - /// - /// - /// - //private bool IsScheduleChanged(ApplicationsInWork orig, ApplicationInWorkRequest request) - //{ - // var isScheduleChanged = false; - - // if (orig.ReferenceDate != request.ReferenceDate) - // isScheduleChanged = true; - - // if (request.Schedule.Count() != orig.EsppSchValues.Count()) - // isScheduleChanged = true; - - // if (request.IsAutoDistributionEnabled != orig.IsAutoDistributionEnabled) - // isScheduleChanged = true; - - // request.Schedule.ForEach(requestSchedule => - // { - // var schExist = orig.EsppSchValues.FirstOrDefault(t => t.ApplicationsInWorkId == orig.Id - // && t.TypeValueId == requestSchedule.TypeValueId - // && t.TypeConfigId == requestSchedule.TypeConfigId); - - // if (schExist == null) - // isScheduleChanged = true; - // }); - - // return isScheduleChanged; - //} - - - /// - /// Загрузка статистики - /// - /// - /// - //private async Task GetStatisticsAsync(Guid applicationInWorkId) - //{ - // var statResult = await applicationsInWorkService.Get() - // .Include(t => t.Templates).ThenInclude(t => t.RobotConfigurations) - // .Where(x => x.Id == applicationInWorkId) - // .Select(t => new - // { - // TemplateActivated = t.Templates.Count(x => x.IsActiveTemplate), - // TemplateSynchronized = t.Templates.Count(x => x.RobotConfigurations.Any(c => c.TaskStatusCode == (int)TaskStatusEnum.Ok && c.RobotCode == (int)RobotsEnum.TemplateOrder)), - // TemplateErrors = t.Templates.Count(x => x.RobotConfigurations.Any(c => c.RobotStatusCode == (int)RobotStatusEnum.Error && c.RobotCode == (int)RobotsEnum.TemplateOrder)), - // ScheduleActivated = t.Templates.Count(x => x.IsActiveSchedule), - // ScheduleSynchronized = t.Templates.Count(x => x.RobotConfigurations.Any(c => c.TaskStatusCode == (int)TaskStatusEnum.Ok && c.RobotCode == (int)RobotsEnum.ScheduleOrder)), - // ScheduleErrors = t.Templates.Count(x => x.RobotConfigurations.Any(c => c.RobotStatusCode == (int)RobotStatusEnum.Error && c.RobotCode == (int)RobotsEnum.ScheduleOrder)) - - // }).FirstOrDefaultAsync(); - - // return new AppInWorkStatModel - // { - // ScheduleStatistics = new ScheduleStats { Activated = statResult?.ScheduleActivated ?? 0, Errors = statResult?.ScheduleErrors ?? 0, Synchronized = statResult?.ScheduleSynchronized ?? 0 }, - // TemplateStatistics = new TemplateStats { Activated = statResult?.TemplateActivated ?? 0, Errors = statResult?.TemplateErrors ?? 0, Synchronized = statResult?.TemplateSynchronized ?? 0 } - // }; - //} - - - private void BindStatistics(ApplicationInWorkResponse applicationsInWork, AppInWorkStatModel statistics) - { - applicationsInWork.TemplateStatistics = new TemplateStats { Activated = statistics.TemplateStatistics.Activated, Errors = statistics.TemplateStatistics.Errors, Synchronized = statistics.TemplateStatistics.Synchronized }; - applicationsInWork.ScheduleStatistics = new ScheduleStats { Activated = statistics.ScheduleStatistics.Activated, Errors = statistics.ScheduleStatistics.Errors, Synchronized = statistics.ScheduleStatistics.Synchronized }; - } - } - - public class AppInWorkStatModel - { - public TemplateStats TemplateStatistics { get; set; } - - public ScheduleStats ScheduleStatistics { get; set; } - } -} diff --git a/PARR.API/Controllers/V1/ApplicationTypeController.cs b/PARR.API/Controllers/V1/ApplicationTypeController.cs index 6f6c3f8a..a1acc4ee 100644 --- a/PARR.API/Controllers/V1/ApplicationTypeController.cs +++ b/PARR.API/Controllers/V1/ApplicationTypeController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/DistributionPeriodController.cs b/PARR.API/Controllers/V1/DistributionPeriodController.cs index 10a8642b..939df0f1 100644 --- a/PARR.API/Controllers/V1/DistributionPeriodController.cs +++ b/PARR.API/Controllers/V1/DistributionPeriodController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/DistributorController.cs b/PARR.API/Controllers/V1/DistributorController.cs index f97d71cc..e6c2d35b 100644 --- a/PARR.API/Controllers/V1/DistributorController.cs +++ b/PARR.API/Controllers/V1/DistributorController.cs @@ -7,9 +7,9 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.API.Settings; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.Common.Rabbit.Messages; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; @@ -21,13 +21,13 @@ namespace PARR.API.Controllers.V1 [Authorize(Roles = ParrRoles.Administrator.Role)] public class DistributorController : BaseApiController { - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly MqSettings mqSettings; private readonly IValidator validator; private readonly IClientService clientService; public DistributorController( - IMqService mqService, + IRabbitService mqService, MqSettings mqSettings, IValidator validator, IClientService clientService diff --git a/PARR.API/Controllers/V1/EkStatusController.cs b/PARR.API/Controllers/V1/EkStatusController.cs index 4bedc35b..2d05ef68 100644 --- a/PARR.API/Controllers/V1/EkStatusController.cs +++ b/PARR.API/Controllers/V1/EkStatusController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/EsppScheduleTypeScheduleController.cs b/PARR.API/Controllers/V1/EsppScheduleTypeScheduleController.cs index 7f0bc6e5..0a2ef7ee 100644 --- a/PARR.API/Controllers/V1/EsppScheduleTypeScheduleController.cs +++ b/PARR.API/Controllers/V1/EsppScheduleTypeScheduleController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/GeneratorTemplateController.cs b/PARR.API/Controllers/V1/GeneratorTemplateController.cs index 11d69836..61fdc7c1 100644 --- a/PARR.API/Controllers/V1/GeneratorTemplateController.cs +++ b/PARR.API/Controllers/V1/GeneratorTemplateController.cs @@ -7,104 +7,104 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.API.Settings; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.Common.Rabbit.Messages; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1 { - [Authorize(Roles = ParrRoles.Administrator.Role)] - public class GeneratorTemplateController : BaseApiController - { - private readonly IValidator validator; - private readonly IMqService mqService; - private readonly IUriService uriService; - private readonly MqSettings mqSettings; - private readonly IClientService clientService; + //[Authorize(Roles = ParrRoles.Administrator.Role)] + //public class GeneratorTemplateController : BaseApiController + //{ + // private readonly IValidator validator; + // private readonly IRabbitService mqService; + // private readonly IUriService uriService; + // private readonly MqSettings mqSettings; + // private readonly IClientService clientService; - public GeneratorTemplateController( - IValidator validator, - IMqService mqService, - IUriService uriService, - MqSettings mqSettings, - IClientService clientService - ) - { - this.validator = validator; - this.mqService = mqService; - this.uriService = uriService; - this.mqSettings = mqSettings; - this.clientService = clientService; - } + // public GeneratorTemplateController( + // IValidator validator, + // IRabbitService mqService, + // IUriService uriService, + // MqSettings mqSettings, + // IClientService clientService + // ) + // { + // this.validator = validator; + // this.mqService = mqService; + // this.uriService = uriService; + // this.mqSettings = mqSettings; + // this.clientService = clientService; + // } - /// !!!!!!!!!! Это старый контроллер, удалить !!!!!!!!!! + // /// !!!!!!!!!! Это старый контроллер, удалить !!!!!!!!!! - /// - /// Запрос на генерацию шаблонов - /// - /// - [HttpPost(ApiRoutes.GeneratorTemplate.Create)] - public async Task Create([FromBody] GeneratorTemplateRequest request) - { - var resultValidate = await validator.ValidateAsync(request); - if (!resultValidate.IsValid) - return BadRequest(new Response(resultValidate.Errors)); + // /// + // /// Запрос на генерацию шаблонов + // /// + // /// + // [HttpPost(ApiRoutes.GeneratorTemplate.Create)] + // public async Task Create([FromBody] GeneratorTemplateRequest request) + // { + // var resultValidate = await validator.ValidateAsync(request); + // if (!resultValidate.IsValid) + // return BadRequest(new Response(resultValidate.Errors)); - var result = true; + // var result = true; - request.Ek.ForEach(ek => - { - //todo: проверить в ForEach(async status - отрабатывает ли нормально async, возможно надо переделать в обычный foreach - request.Status.ForEach(async status => - { - var obj = new GeneratorTemplateMq - { - Action = request.Action, - ApplicationId = request.ApplicationId, - Ek = ek, - WorkId = request.WorkId, - StatusEk = status, - IsActiveTemplate = request.IsActiveTemplate, - IsActiveSchedule = request.IsActiveSchedule, - HistoryInitiator = new HistoryInitiator { InitiatorIp = clientService.GetClientIp()?.ToString(), InitiatorParrComponentId = ParrComponentsEnum.Api } - }; + // request.Ek.ForEach(ek => + // { + // //todo: проверить в ForEach(async status - отрабатывает ли нормально async, возможно надо переделать в обычный foreach + // request.Status.ForEach(async status => + // { + // var obj = new GeneratorTemplateMq + // { + // Action = request.Action, + // ApplicationId = request.ApplicationId, + // Ek = ek, + // WorkId = request.WorkId, + // StatusEk = status, + // IsActiveTemplate = request.IsActiveTemplate, + // IsActiveSchedule = request.IsActiveSchedule, + // HistoryInitiator = new HistoryInitiator { InitiatorIp = clientService.GetClientIp()?.ToString(), InitiatorParrComponentId = ParrComponentsEnum.Api } + // }; - //var msg = JsonSerializer.Serialize(obj); + // //var msg = JsonSerializer.Serialize(obj); - //var _result = await mqService.SendAsync(mqSettings.GenerateTemplates, new[] { msg }); - var _result = await mqService.SendAsync(mqSettings.GenerateTemplates, new List { obj }); + // //var _result = await mqService.SendAsync(mqSettings.GenerateTemplates, new[] { msg }); + // var _result = await mqService.SendAsync(mqSettings.GenerateTemplates, new List { obj }); - if (_result.IsSuccess == false) - result = false; + // if (_result.IsSuccess == false) + // result = false; - }); - }); + // }); + // }); - //var obj = new GeneratorTemplateMq - //{ - // Action = request.Action, - // ApplicationId = request.ApplicationId, - // Ek = request.Ek, - // WorkId = request.WorkId, - // StatusEk = request.Status, - // IsActiveTemplate = request.IsActiveTemplate, - // IsActiveSchedule = request.IsActiveSchedule - //}; + // //var obj = new GeneratorTemplateMq + // //{ + // // Action = request.Action, + // // ApplicationId = request.ApplicationId, + // // Ek = request.Ek, + // // WorkId = request.WorkId, + // // StatusEk = request.Status, + // // IsActiveTemplate = request.IsActiveTemplate, + // // IsActiveSchedule = request.IsActiveSchedule + // //}; - //var msg = JsonSerializer.Serialize(obj); + // //var msg = JsonSerializer.Serialize(obj); - //var result = mqService.Send(mqSettings.GenerateTemplates, new[] { msg }); + // //var result = mqService.Send(mqSettings.GenerateTemplates, new[] { msg }); - //if (!result.IsSuccess) - if (!result) - return BadRequest(new Response(false, new List { new ErrorModel { Message = $"Ошибка при отправке данных." } })); + // //if (!result.IsSuccess) + // if (!result) + // return BadRequest(new Response(false, new List { new ErrorModel { Message = $"Ошибка при отправке данных." } })); - var createdUri = uriService.GetAllUri(ApiRoutes.Template.GetAll); + // var createdUri = uriService.GetAllUri(ApiRoutes.Template.GetAll); - return Created(createdUri, new Response(null, true, new List(), "Отправлен запрос на генерацию шаблонов.")); - } - } + // return Created(createdUri, new Response(null, true, new List(), "Отправлен запрос на генерацию шаблонов.")); + // } + //} } diff --git a/PARR.API/Controllers/V1/JobAutoControlController.cs b/PARR.API/Controllers/V1/JobAutoControlController.cs index 7f79c004..d70ce5a5 100644 --- a/PARR.API/Controllers/V1/JobAutoControlController.cs +++ b/PARR.API/Controllers/V1/JobAutoControlController.cs @@ -9,9 +9,9 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/JobController.cs b/PARR.API/Controllers/V1/JobController.cs index c799c350..e26f3aa5 100644 --- a/PARR.API/Controllers/V1/JobController.cs +++ b/PARR.API/Controllers/V1/JobController.cs @@ -12,10 +12,8 @@ using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; using PARR.API.Settings; -using PARR.BLL.Domain.Mq; using PARR.BLL.Helpers; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; using PARR.DAL.DomainServices.Interfaces; using PARR.DAL.DomainServices.UnitFilterService; using PARR.DAL.Extensions; @@ -24,6 +22,8 @@ using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Unit; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Rabbit.Messages; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; @@ -41,7 +41,7 @@ namespace PARR.API.Controllers.V1 private readonly IJobService jobService; private readonly ITemplateService templateService; private readonly IValidator jobValidator; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly MqSettings mqSettings; private readonly IClientService clientService; private readonly IJobAutoControlService jobAutoControlService; @@ -57,7 +57,7 @@ namespace PARR.API.Controllers.V1 IValidator jobValidator, IUnitFilterService unitFilterService, IUnitService unitService, - IMqService mqService, + IRabbitService mqService, MqSettings mqSettings, IClientService clientService, IJobAutoControlService jobAutoControlService, diff --git a/PARR.API/Controllers/V1/JobGroupController.cs b/PARR.API/Controllers/V1/JobGroupController.cs index 624e9e04..051bce22 100644 --- a/PARR.API/Controllers/V1/JobGroupController.cs +++ b/PARR.API/Controllers/V1/JobGroupController.cs @@ -12,10 +12,8 @@ using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; using PARR.API.Settings; -using PARR.BLL.Domain.Mq; using PARR.BLL.Helpers; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; using PARR.DAL.DomainServices.Interfaces; using PARR.DAL.Models; using PARR.DAL.Models.Job; @@ -23,6 +21,8 @@ using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Schedule; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Rabbit.Messages; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; @@ -44,7 +44,7 @@ namespace PARR.API.Controllers.V1 private readonly IJobGroupTypeService jobGroupTypeService; private readonly IMatchingStatusService matchingStatusService; private readonly IScheduleResponseAreaTimeOffsetService scheduleResponseAreaTimeOffsetService; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly MqSettings mqSettings; public JobGroupController( @@ -58,7 +58,7 @@ namespace PARR.API.Controllers.V1 IJobGroupTypeService jobGroupTypeService, IMatchingStatusService matchingStatusService, IScheduleResponseAreaTimeOffsetService scheduleResponseAreaTimeOffsetService, - IMqService mqService, + IRabbitService mqService, MqSettings mqSettings ) { diff --git a/PARR.API/Controllers/V1/JobGroupTypeController.cs b/PARR.API/Controllers/V1/JobGroupTypeController.cs index 0204a50b..1f9de449 100644 --- a/PARR.API/Controllers/V1/JobGroupTypeController.cs +++ b/PARR.API/Controllers/V1/JobGroupTypeController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/JobGroupUpdateNextRunController.cs b/PARR.API/Controllers/V1/JobGroupUpdateNextRunController.cs index 76c3f4be..38cc130a 100644 --- a/PARR.API/Controllers/V1/JobGroupUpdateNextRunController.cs +++ b/PARR.API/Controllers/V1/JobGroupUpdateNextRunController.cs @@ -5,10 +5,10 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Settings; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Common.Rabbit.Messages; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; @@ -20,12 +20,12 @@ namespace PARR.API.Controllers.V1 [Authorize(Roles = ParrRoles.Administrator.Role)] public class JobGroupUpdateNextRunController : BaseApiController { - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly MqSettings mqSettings; private readonly IJobGroupService jobGroupService; public JobGroupUpdateNextRunController( - IMqService mqService, + IRabbitService mqService, MqSettings mqSettings, IJobGroupService jobGroupService ) diff --git a/PARR.API/Controllers/V1/JobUnitPreviewController.cs b/PARR.API/Controllers/V1/JobUnitPreviewController.cs index d284e41e..1654bd99 100644 --- a/PARR.API/Controllers/V1/JobUnitPreviewController.cs +++ b/PARR.API/Controllers/V1/JobUnitPreviewController.cs @@ -8,10 +8,10 @@ using PARR.API.Contracts.V1.Requests; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.DomainServices.UnitFilterService; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Roles; using Job = PARR.DAL.Models.Job.Job; namespace PARR.API.Controllers.V1 diff --git a/PARR.API/Controllers/V1/KiiUnitController.cs b/PARR.API/Controllers/V1/KiiUnitController.cs index dfb5ab99..acfb4637 100644 --- a/PARR.API/Controllers/V1/KiiUnitController.cs +++ b/PARR.API/Controllers/V1/KiiUnitController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/OrderController.cs b/PARR.API/Controllers/V1/OrderController.cs index f6887a24..6306d8c2 100644 --- a/PARR.API/Controllers/V1/OrderController.cs +++ b/PARR.API/Controllers/V1/OrderController.cs @@ -8,10 +8,10 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ProcessController.cs b/PARR.API/Controllers/V1/ProcessController.cs index 9273a2bb..fedb56d6 100644 --- a/PARR.API/Controllers/V1/ProcessController.cs +++ b/PARR.API/Controllers/V1/ProcessController.cs @@ -11,10 +11,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/RegionalEkPtkGroupController.cs b/PARR.API/Controllers/V1/RegionalEkPtkGroupController.cs index 9aa89d46..07f20ab3 100644 --- a/PARR.API/Controllers/V1/RegionalEkPtkGroupController.cs +++ b/PARR.API/Controllers/V1/RegionalEkPtkGroupController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ResponseAreaController.cs b/PARR.API/Controllers/V1/ResponseAreaController.cs index 163457ea..a96b93f2 100644 --- a/PARR.API/Controllers/V1/ResponseAreaController.cs +++ b/PARR.API/Controllers/V1/ResponseAreaController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/RobotController.cs b/PARR.API/Controllers/V1/RobotController.cs index f3125c98..7fb8784d 100644 --- a/PARR.API/Controllers/V1/RobotController.cs +++ b/PARR.API/Controllers/V1/RobotController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/RobotHistoryController.cs b/PARR.API/Controllers/V1/RobotHistoryController.cs index 818caa19..b1676e7e 100644 --- a/PARR.API/Controllers/V1/RobotHistoryController.cs +++ b/PARR.API/Controllers/V1/RobotHistoryController.cs @@ -11,10 +11,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/RobotHistoryLevelController.cs b/PARR.API/Controllers/V1/RobotHistoryLevelController.cs index 10734603..b94e6a48 100644 --- a/PARR.API/Controllers/V1/RobotHistoryLevelController.cs +++ b/PARR.API/Controllers/V1/RobotHistoryLevelController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/RobotTaskController.cs b/PARR.API/Controllers/V1/RobotTaskController.cs index ffcbe9c7..c0434b44 100644 --- a/PARR.API/Controllers/V1/RobotTaskController.cs +++ b/PARR.API/Controllers/V1/RobotTaskController.cs @@ -9,13 +9,13 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.BLL.Helpers; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.DomainServices.Shortcodes; using PARR.DAL.Models; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Schedule; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; diff --git a/PARR.API/Controllers/V1/RobotTaskRobotStatusController.cs b/PARR.API/Controllers/V1/RobotTaskRobotStatusController.cs index e643b182..cc3c5468 100644 --- a/PARR.API/Controllers/V1/RobotTaskRobotStatusController.cs +++ b/PARR.API/Controllers/V1/RobotTaskRobotStatusController.cs @@ -8,10 +8,10 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1 diff --git a/PARR.API/Controllers/V1/RoleController.cs b/PARR.API/Controllers/V1/RoleController.cs index 144709bf..92b28697 100644 --- a/PARR.API/Controllers/V1/RoleController.cs +++ b/PARR.API/Controllers/V1/RoleController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ScheduleExcludeTypeCalendarController.cs b/PARR.API/Controllers/V1/ScheduleExcludeTypeCalendarController.cs index 9024b3df..64a3b1cd 100644 --- a/PARR.API/Controllers/V1/ScheduleExcludeTypeCalendarController.cs +++ b/PARR.API/Controllers/V1/ScheduleExcludeTypeCalendarController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces.Schedule; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ScheduleExcludeTypeController.cs b/PARR.API/Controllers/V1/ScheduleExcludeTypeController.cs index 9fec1bb7..3fa1afa7 100644 --- a/PARR.API/Controllers/V1/ScheduleExcludeTypeController.cs +++ b/PARR.API/Controllers/V1/ScheduleExcludeTypeController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces.Schedule; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/ShortcodeController.cs b/PARR.API/Controllers/V1/ShortcodeController.cs index 3f44c42d..213a8277 100644 --- a/PARR.API/Controllers/V1/ShortcodeController.cs +++ b/PARR.API/Controllers/V1/ShortcodeController.cs @@ -5,8 +5,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.DomainServices.Shortcodes; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/Statistics/StatAuthController.cs b/PARR.API/Controllers/V1/Statistics/StatAuthController.cs index fc0b3d11..7a16e14d 100644 --- a/PARR.API/Controllers/V1/Statistics/StatAuthController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatAuthController.cs @@ -5,9 +5,9 @@ using PARR.API.Contracts.V1.Requests.Queries; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.InfluxDbServices; using PARR.DAL.Settings; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatOrderController.cs b/PARR.API/Controllers/V1/Statistics/StatOrderController.cs index f7dc5695..9138925f 100644 --- a/PARR.API/Controllers/V1/Statistics/StatOrderController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatOrderController.cs @@ -9,9 +9,9 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; -using PARR.Constants; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatRabbitMqController.cs b/PARR.API/Controllers/V1/Statistics/StatRabbitMqController.cs index 888f4c0e..aeddd328 100644 --- a/PARR.API/Controllers/V1/Statistics/StatRabbitMqController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatRabbitMqController.cs @@ -5,8 +5,8 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Settings; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { @@ -16,17 +16,17 @@ namespace PARR.API.Controllers.V1.Statistics [Authorize(Roles = ParrRoles.Administrator.Role)] public class StatRabbitMqController : BaseApiController { - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly MqSettings mqSettings; private readonly ILogger logger; - private readonly IMqAdminService mqAdminService; + private readonly IRabbitAdminService mqAdminService; private readonly MonitoringSettings monitoringSettings; public StatRabbitMqController( - IMqService mqService, + IRabbitService mqService, MqSettings mqSettings, ILogger logger, - IMqAdminService mqAdminService, + IRabbitAdminService mqAdminService, MonitoringSettings monitoringSettings ) { diff --git a/PARR.API/Controllers/V1/Statistics/StatResponseAreaWorkLoadController.cs b/PARR.API/Controllers/V1/Statistics/StatResponseAreaWorkLoadController.cs index 91066cfa..45a1d759 100644 --- a/PARR.API/Controllers/V1/Statistics/StatResponseAreaWorkLoadController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatResponseAreaWorkLoadController.cs @@ -10,8 +10,8 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatRobotHistoryController.cs b/PARR.API/Controllers/V1/Statistics/StatRobotHistoryController.cs index 0ec3552e..66fd9138 100644 --- a/PARR.API/Controllers/V1/Statistics/StatRobotHistoryController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatRobotHistoryController.cs @@ -10,9 +10,9 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatRobotStateController.cs b/PARR.API/Controllers/V1/Statistics/StatRobotStateController.cs index 61e7f722..55c7e5a9 100644 --- a/PARR.API/Controllers/V1/Statistics/StatRobotStateController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatRobotStateController.cs @@ -14,10 +14,11 @@ using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.API.Settings; -using PARR.Constants; using PARR.DAL.InfluxDbServices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Settings; +using PARR.Domain.Common.Roles; +using PARR.Domain.Enums; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatRobotStatusController.cs b/PARR.API/Controllers/V1/Statistics/StatRobotStatusController.cs index 59b198e5..e8ff8948 100644 --- a/PARR.API/Controllers/V1/Statistics/StatRobotStatusController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatRobotStatusController.cs @@ -7,8 +7,8 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatRobotTaskController.cs b/PARR.API/Controllers/V1/Statistics/StatRobotTaskController.cs index d68d36e1..3fa866c6 100644 --- a/PARR.API/Controllers/V1/Statistics/StatRobotTaskController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatRobotTaskController.cs @@ -8,9 +8,9 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1.Statistics diff --git a/PARR.API/Controllers/V1/Statistics/StatStatusTypeTemplates.cs b/PARR.API/Controllers/V1/Statistics/StatStatusTypeTemplates.cs index 5e567933..a72f11a1 100644 --- a/PARR.API/Controllers/V1/Statistics/StatStatusTypeTemplates.cs +++ b/PARR.API/Controllers/V1/Statistics/StatStatusTypeTemplates.cs @@ -7,8 +7,8 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatTemplateAutoControlController.cs b/PARR.API/Controllers/V1/Statistics/StatTemplateAutoControlController.cs index 0f002a26..eaef29fc 100644 --- a/PARR.API/Controllers/V1/Statistics/StatTemplateAutoControlController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatTemplateAutoControlController.cs @@ -6,7 +6,6 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; -using PARR.Constants; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; using PARR.Domain.Enums; diff --git a/PARR.API/Controllers/V1/Statistics/StatTemplateController.cs b/PARR.API/Controllers/V1/Statistics/StatTemplateController.cs index c78412fb..98418b75 100644 --- a/PARR.API/Controllers/V1/Statistics/StatTemplateController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatTemplateController.cs @@ -7,10 +7,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1.Statistics diff --git a/PARR.API/Controllers/V1/Statistics/StatTemplateDistributionController.cs b/PARR.API/Controllers/V1/Statistics/StatTemplateDistributionController.cs index eea541ff..9215591c 100644 --- a/PARR.API/Controllers/V1/Statistics/StatTemplateDistributionController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatTemplateDistributionController.cs @@ -8,7 +8,6 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.DomainServices.Shortcodes; using PARR.DAL.Models; using PARR.DAL.Models.Job; @@ -16,6 +15,8 @@ using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Schedule; +using PARR.Domain.Common.Roles; +using PARR.Domain.Enums; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatUnitController.cs b/PARR.API/Controllers/V1/Statistics/StatUnitController.cs index e1427571..1d593a1c 100644 --- a/PARR.API/Controllers/V1/Statistics/StatUnitController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatUnitController.cs @@ -7,9 +7,9 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; using PARR.API.Helpers; -using PARR.Constants; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatUnitFieldValuesController.cs b/PARR.API/Controllers/V1/Statistics/StatUnitFieldValuesController.cs index b04cfa74..b8ab7e9d 100644 --- a/PARR.API/Controllers/V1/Statistics/StatUnitFieldValuesController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatUnitFieldValuesController.cs @@ -6,10 +6,10 @@ using PARR.API.Contracts.V1.Requests.BaseRequests; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Contracts.V1.Responses.Statistics; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/Statistics/StatWorkloadController.cs b/PARR.API/Controllers/V1/Statistics/StatWorkloadController.cs index 78a0ca3f..c688fd7f 100644 --- a/PARR.API/Controllers/V1/Statistics/StatWorkloadController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatWorkloadController.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc; using PARR.API.Contracts.V1; using PARR.API.Controllers.V1.Base; -using PARR.Constants; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1.Statistics { diff --git a/PARR.API/Controllers/V1/SubprocessController.cs b/PARR.API/Controllers/V1/SubprocessController.cs index c6a1d005..d5c2651d 100644 --- a/PARR.API/Controllers/V1/SubprocessController.cs +++ b/PARR.API/Controllers/V1/SubprocessController.cs @@ -11,10 +11,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/SyncTaskController.cs b/PARR.API/Controllers/V1/SyncTaskController.cs index 1894fa3c..63a3aec1 100644 --- a/PARR.API/Controllers/V1/SyncTaskController.cs +++ b/PARR.API/Controllers/V1/SyncTaskController.cs @@ -5,9 +5,9 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.API.Settings; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; using PARR.DAL.DomainServices.Interfaces; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; @@ -16,7 +16,7 @@ namespace PARR.API.Controllers.V1 public class SyncTaskController : BaseApiController { private readonly ILogger logger; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly IUriService uriService; private readonly MqSettings mqSettings; private readonly IClientService clientService; @@ -24,7 +24,7 @@ namespace PARR.API.Controllers.V1 public SyncTaskController( ILogger logger, - IMqService mqService, + IRabbitService mqService, IUriService uriService, MqSettings mqSettings, IClientService clientService, diff --git a/PARR.API/Controllers/V1/TaskStatusController.cs b/PARR.API/Controllers/V1/TaskStatusController.cs index 40f20fb5..30a91e74 100644 --- a/PARR.API/Controllers/V1/TaskStatusController.cs +++ b/PARR.API/Controllers/V1/TaskStatusController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/TemplateActivatorController.cs b/PARR.API/Controllers/V1/TemplateActivatorController.cs index f6e45a49..44f973d2 100644 --- a/PARR.API/Controllers/V1/TemplateActivatorController.cs +++ b/PARR.API/Controllers/V1/TemplateActivatorController.cs @@ -7,10 +7,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; using PARR.API.Settings; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Common.Rabbit.Messages; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; @@ -23,7 +23,7 @@ namespace PARR.API.Controllers.V1 public class TemplateActivatorController : BaseApiController { private readonly IValidator validator; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly IUriService uriService; private readonly MqSettings mqSettings; private readonly IJobService jobService; @@ -31,7 +31,7 @@ namespace PARR.API.Controllers.V1 public TemplateActivatorController( IValidator validator, - IMqService mqService, + IRabbitService mqService, IUriService uriService, MqSettings mqSettings, IJobService jobService, diff --git a/PARR.API/Controllers/V1/TemplateController.cs b/PARR.API/Controllers/V1/TemplateController.cs index dfb2436c..e28dd643 100644 --- a/PARR.API/Controllers/V1/TemplateController.cs +++ b/PARR.API/Controllers/V1/TemplateController.cs @@ -11,13 +11,13 @@ using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; using PARR.BLL.Helpers; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.DomainServices.Shortcodes; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Schedule; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; diff --git a/PARR.API/Controllers/V1/TemplateHistoryController.cs b/PARR.API/Controllers/V1/TemplateHistoryController.cs index 8f1344ba..5f49e34a 100644 --- a/PARR.API/Controllers/V1/TemplateHistoryController.cs +++ b/PARR.API/Controllers/V1/TemplateHistoryController.cs @@ -8,10 +8,10 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/TemplateScheduleEspp.cs b/PARR.API/Controllers/V1/TemplateScheduleEspp.cs index 434cd9d8..62f999df 100644 --- a/PARR.API/Controllers/V1/TemplateScheduleEspp.cs +++ b/PARR.API/Controllers/V1/TemplateScheduleEspp.cs @@ -8,8 +8,8 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/TemplateStatusTypeController.cs b/PARR.API/Controllers/V1/TemplateStatusTypeController.cs index 06e2d9fd..52243c85 100644 --- a/PARR.API/Controllers/V1/TemplateStatusTypeController.cs +++ b/PARR.API/Controllers/V1/TemplateStatusTypeController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/TemplateSyncStateController.cs b/PARR.API/Controllers/V1/TemplateSyncStateController.cs index 572b867b..0568f956 100644 --- a/PARR.API/Controllers/V1/TemplateSyncStateController.cs +++ b/PARR.API/Controllers/V1/TemplateSyncStateController.cs @@ -6,9 +6,9 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1 diff --git a/PARR.API/Controllers/V1/TnkController.cs b/PARR.API/Controllers/V1/TnkController.cs index ff8d63bd..1770fc7a 100644 --- a/PARR.API/Controllers/V1/TnkController.cs +++ b/PARR.API/Controllers/V1/TnkController.cs @@ -11,10 +11,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/UnitController.cs b/PARR.API/Controllers/V1/UnitController.cs index b5b3e8fc..07d9f3ed 100644 --- a/PARR.API/Controllers/V1/UnitController.cs +++ b/PARR.API/Controllers/V1/UnitController.cs @@ -9,10 +9,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.BLL.Helpers; -using PARR.Constants; using PARR.DAL.Models.Unit; using PARR.DAL.Services.Interfaces.Unit; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/UnitFieldController.cs b/PARR.API/Controllers/V1/UnitFieldController.cs index 2d22bf06..a8f93044 100644 --- a/PARR.API/Controllers/V1/UnitFieldController.cs +++ b/PARR.API/Controllers/V1/UnitFieldController.cs @@ -6,8 +6,8 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; -using PARR.Constants; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/UnitFieldValueController.cs b/PARR.API/Controllers/V1/UnitFieldValueController.cs index 23be915f..849be477 100644 --- a/PARR.API/Controllers/V1/UnitFieldValueController.cs +++ b/PARR.API/Controllers/V1/UnitFieldValueController.cs @@ -9,10 +9,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.BLL.Helpers; -using PARR.Constants; using PARR.DAL.Models.Unit; using PARR.DAL.Services.Interfaces.Unit; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/UserController.cs b/PARR.API/Controllers/V1/UserController.cs index fd0284a8..671cfaa4 100644 --- a/PARR.API/Controllers/V1/UserController.cs +++ b/PARR.API/Controllers/V1/UserController.cs @@ -11,10 +11,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/UserRoleController.cs b/PARR.API/Controllers/V1/UserRoleController.cs index a8355b0f..ced9c526 100644 --- a/PARR.API/Controllers/V1/UserRoleController.cs +++ b/PARR.API/Controllers/V1/UserRoleController.cs @@ -8,9 +8,9 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/WeekendController.cs b/PARR.API/Controllers/V1/WeekendController.cs index 46de7209..c463e7a9 100644 --- a/PARR.API/Controllers/V1/WeekendController.cs +++ b/PARR.API/Controllers/V1/WeekendController.cs @@ -11,10 +11,10 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.API.Services.Interfaces; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; namespace PARR.API.Controllers.V1 { diff --git a/PARR.API/Controllers/V1/WorkGroupController.cs b/PARR.API/Controllers/V1/WorkGroupController.cs index 3ba7828c..e91c2d47 100644 --- a/PARR.API/Controllers/V1/WorkGroupController.cs +++ b/PARR.API/Controllers/V1/WorkGroupController.cs @@ -8,11 +8,11 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.Domain.Common.Pagination; +using PARR.Domain.Common.Roles; using PARR.Domain.Enums; namespace PARR.API.Controllers.V1 diff --git a/PARR.API/Services/Implementations/AuthService.cs b/PARR.API/Services/Implementations/AuthService.cs index 4d96c5e9..0dd412f0 100644 --- a/PARR.API/Services/Implementations/AuthService.cs +++ b/PARR.API/Services/Implementations/AuthService.cs @@ -3,12 +3,12 @@ using PARR.API.Authentication.Models; using PARR.API.Domain.InfluxDbModels; using PARR.API.Services.Interfaces; using PARR.API.Settings; -using PARR.Constants; using PARR.DAL.Cache.Services.Base; using PARR.DAL.InfluxDbServices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Unit; using PARR.DAL.Settings; +using PARR.Domain.Common.Roles; namespace PARR.API.Services.Implementations { diff --git a/PARR.API/Settings/MqSettings.cs b/PARR.API/Settings/MqSettings.cs index 5763bd1a..fcfa7c65 100644 --- a/PARR.API/Settings/MqSettings.cs +++ b/PARR.API/Settings/MqSettings.cs @@ -1,5 +1,5 @@ -using PARR.BLL.Contracts.Interfaces; -using PARR.Domain.Enums; +using PARR.Domain.Enums; +using PARR.Domain.Settings; namespace PARR.API.Settings { @@ -26,11 +26,11 @@ namespace PARR.API.Settings public class StatMqAuth : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.API/Validators/GeneratorTemplateRequestValidator.cs b/PARR.API/Validators/GeneratorTemplateRequestValidator.cs index c620223c..39a515fb 100644 --- a/PARR.API/Validators/GeneratorTemplateRequestValidator.cs +++ b/PARR.API/Validators/GeneratorTemplateRequestValidator.cs @@ -1,64 +1,58 @@ -using FluentValidation; -using PARR.API.Contracts.V1.Requests; -using PARR.BLL.Contracts; -using PARR.DAL.Services.Interfaces; -using System.Linq; - -namespace PARR.API.Validators +namespace PARR.API.Validators { - public class GeneratorTemplateRequestValidator : AbstractValidator - { - private readonly IApplicationsInWorkService applicationsInWorkService; + //public class GeneratorTemplateRequestValidator : AbstractValidator + //{ + // private readonly IApplicationsInWorkService applicationsInWorkService; - private bool? isValid = null; + // private bool? isValid = null; - public GeneratorTemplateRequestValidator(IApplicationsInWorkService applicationsInWorkService) - { - this.applicationsInWorkService = applicationsInWorkService; + // public GeneratorTemplateRequestValidator(IApplicationsInWorkService applicationsInWorkService) + // { + // this.applicationsInWorkService = applicationsInWorkService; - RuleFor(t => t.WorkId) - .MustAsync(async (entity, value, c) => await IsApplicationContainWork(entity, entity.ApplicationId)) - .WithMessage("У данной работы нет связанных приложений"); + // RuleFor(t => t.WorkId) + // .MustAsync(async (entity, value, c) => await IsApplicationContainWork(entity, entity.ApplicationId)) + // .WithMessage("У данной работы нет связанных приложений"); - RuleFor(t => t.ApplicationId) - .MustAsync(async (entity, value, c) => await IsApplicationContainWork(entity, value)) - .WithMessage("У данного приложения нет связанных работ"); + // RuleFor(t => t.ApplicationId) + // .MustAsync(async (entity, value, c) => await IsApplicationContainWork(entity, value)) + // .WithMessage("У данного приложения нет связанных работ"); - //TODO: возможно сделать проверку, по данному выражению есть ли ЭК - RuleFor(t => t.Ek).NotEmpty().WithMessage("Недопустимое значение ЭК. Возможные значения: *, ВРТ-*-ДВС"); + // //TODO: возможно сделать проверку, по данному выражению есть ли ЭК + // RuleFor(t => t.Ek).NotEmpty().WithMessage("Недопустимое значение ЭК. Возможные значения: *, ВРТ-*-ДВС"); - RuleFor(t => t.Action) - .Must(t => t.ToLower() == GenerateTemplateActionsEnum.create.ToString() || t.ToLower() == GenerateTemplateActionsEnum.deactivate.ToString()) - .WithMessage($"Допустимые значения: {GenerateTemplateActionsEnum.create}, {GenerateTemplateActionsEnum.deactivate}"); + // RuleFor(t => t.Action) + // .Must(t => t.ToLower() == GenerateTemplateActionsEnum.create.ToString() || t.ToLower() == GenerateTemplateActionsEnum.deactivate.ToString()) + // .WithMessage($"Допустимые значения: {GenerateTemplateActionsEnum.create}, {GenerateTemplateActionsEnum.deactivate}"); - //0 - все статусы, 1,2,3,4,5,6,7,9 - var ekStatuses = new List { 0, 1, 2, 3, 4, 5, 6, 7, 9 }; - //RuleFor(t => t.Status).Must(t => ekStatuses.Contains(t)).WithMessage("Допустимые значения: 0 - все статусы, 1,2,3,4,5,6,7,9"); - RuleFor(t => t.Status).Must((statuses) => - { - if (statuses.Count < 1) - return false; + // //0 - все статусы, 1,2,3,4,5,6,7,9 + // var ekStatuses = new List { 0, 1, 2, 3, 4, 5, 6, 7, 9 }; + // //RuleFor(t => t.Status).Must(t => ekStatuses.Contains(t)).WithMessage("Допустимые значения: 0 - все статусы, 1,2,3,4,5,6,7,9"); + // RuleFor(t => t.Status).Must((statuses) => + // { + // if (statuses.Count < 1) + // return false; - var isContains = true; - statuses.ForEach(status => - { - if (ekStatuses.Contains(status) == false) - isContains = false; - }); + // var isContains = true; + // statuses.ForEach(status => + // { + // if (ekStatuses.Contains(status) == false) + // isContains = false; + // }); - return isContains; - }).WithMessage("Допустимые значения: 0 - все статусы, 1,2,3,4,5,6,7,9"); - } + // return isContains; + // }).WithMessage("Допустимые значения: 0 - все статусы, 1,2,3,4,5,6,7,9"); + // } - private async Task IsApplicationContainWork(GeneratorTemplateRequest request, Guid applicationId) - { - //чтобы не делать 2 раза валидацию - if (isValid.HasValue) - return isValid.Value; + // private async Task IsApplicationContainWork(GeneratorTemplateRequest request, Guid applicationId) + // { + // //чтобы не делать 2 раза валидацию + // if (isValid.HasValue) + // return isValid.Value; - isValid = await applicationsInWorkService.GetAsync(applicationId, request.WorkId) != null; + // isValid = await applicationsInWorkService.GetAsync(applicationId, request.WorkId) != null; - return isValid.Value; - } - } + // return isValid.Value; + // } + //} } diff --git a/PARR.API/Validators/RobotStateRequestValidator.cs b/PARR.API/Validators/RobotStateRequestValidator.cs index 7b2087a3..a0f37173 100644 --- a/PARR.API/Validators/RobotStateRequestValidator.cs +++ b/PARR.API/Validators/RobotStateRequestValidator.cs @@ -1,6 +1,6 @@ using FluentValidation; using PARR.API.Contracts.V1.Requests; -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.API.Validators { diff --git a/PARR.API/Validators/TemplateActivatorRequestValidator.cs b/PARR.API/Validators/TemplateActivatorRequestValidator.cs index 399222ea..ce908f9f 100644 --- a/PARR.API/Validators/TemplateActivatorRequestValidator.cs +++ b/PARR.API/Validators/TemplateActivatorRequestValidator.cs @@ -1,8 +1,8 @@ using FluentValidation; using PARR.API.Contracts.V1.Requests; -using PARR.Constants; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Enums; namespace PARR.API.Validators { diff --git a/PARR.BLL/Contracts/GenerateTemplateActionsEnum.cs b/PARR.BLL/Contracts/GenerateTemplateActionsEnum.cs deleted file mode 100644 index ecfbbc5d..00000000 --- a/PARR.BLL/Contracts/GenerateTemplateActionsEnum.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace PARR.BLL.Contracts -{ - /// - /// Действия при генерации шаблонов - /// - public enum GenerateTemplateActionsEnum - { - create, - deactivate - } -} diff --git a/PARR.BLL/Contracts/Interfaces/IMqSettings.cs b/PARR.BLL/Contracts/Interfaces/IMqSettings.cs deleted file mode 100644 index a5a72023..00000000 --- a/PARR.BLL/Contracts/Interfaces/IMqSettings.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace PARR.BLL.Contracts.Interfaces -{ - /// - /// Поля настроек MQ, используется для appsettings.json - /// - public interface IMqSettings - { - string HostName { get; set; } - string QueueName { get; set; } - string User { get; set; } - string Password { get; set; } - /// - /// Кол-во сообщений которые может принимать consumer за один раз. 0 или null - без ограничений - /// - ushort? PrefetchCount { get; set; } - } - - public class MqSettingsBase : IMqSettings - { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; - } -} diff --git a/PARR.BLL/Domain/Mq/MqApiResult.cs b/PARR.BLL/Domain/Mq/MqApiResult.cs deleted file mode 100644 index 8ad233e3..00000000 --- a/PARR.BLL/Domain/Mq/MqApiResult.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace PARR.BLL.Domain.Mq -{ - /// - /// Ответ от API RabbitMQ - /// - public class MqApiResult - { - public bool IsSuccess { get; set; } - - public object? Response { get; set; } - - public Exception? Exception { get; set; } - } -} diff --git a/PARR.BLL/ParrBllInstaller.cs b/PARR.BLL/ParrBllInstaller.cs index 79f992eb..114a6fa9 100644 --- a/PARR.BLL/ParrBllInstaller.cs +++ b/PARR.BLL/ParrBllInstaller.cs @@ -19,9 +19,9 @@ namespace PARR.BLL services.AddTransient(); //services.AddTransient(); - services.AddTransient(); + //services.AddTransient(); - services.AddHttpClient(); + //services.AddHttpClient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/PARR.BLL/Services/Implementations/CalendarService.cs b/PARR.BLL/Services/Implementations/CalendarService.cs index f6f3f9ea..cdffe1c8 100644 --- a/PARR.BLL/Services/Implementations/CalendarService.cs +++ b/PARR.BLL/Services/Implementations/CalendarService.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging; using PARR.BLL.Services.Interfaces; using PARR.Common; -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.BLL.Services.Implementations { diff --git a/PARR.BLL/Services/Implementations/MqService.cs b/PARR.BLL/Services/Implementations/MqService.cs deleted file mode 100644 index 2b9a4be7..00000000 --- a/PARR.BLL/Services/Implementations/MqService.cs +++ /dev/null @@ -1,172 +0,0 @@ -using Microsoft.Extensions.Logging; -using PARR.BLL.Contracts.Interfaces; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; -using RabbitMQ.Client; -using RabbitMQ.Client.Events; -using System.Text; - -namespace PARR.BLL.Services.Implementations -{ - - // RabbitMqClient 6.5.0 - - internal class MqService// : IMqService - { - private readonly ILogger logger; - - private IConnection? connection; - //private IModel? channel; - - public MqService(ILogger logger) - { - this.logger = logger; - } - - public MqSendResult Send(IMqSettings mqSettings, string[] msgList) - { - return new MqSendResult { IsSuccess = false, NotSendMessages = new string[0] }; - - //var factory = new ConnectionFactory - //{ - // HostName = mqSettings.HostName, - // UserName = mqSettings.User, - // Password = mqSettings.Password - //}; - - //// индекс текущей отправки в очередь из массива msgList - //// нужен для формирования списка неотправленных сообщений - //var sendIdx = 0; - - //try - //{ - // using (var connection = factory.CreateConnection()) - // using (var channel = connection.CreateModel()) - // { - // //https://www.rabbitmq.com/lazy-queues.html - // //Рекомендовано при работе порциями использовать ленивые очереди. сообщения не используют память - // //Формируем соответствующий аргумент - // var args = new Dictionary { { "x-queue-mode", "lazy" } }; - - // //Объявляем очередь с которой будем работать. - // //Если такой очереди ещё нет, то создатся. - // //Если нет, нужно параметры типа durable должны совпадать иначе будет ошибка. - // //В целом эти параметры можно посмотреть в админке RabbitMQ - - // channel.QueueDeclare( - // queue: mqSettings.QueueName, - // durable: true, - // exclusive: false, - // autoDelete: false, - // arguments: args - // ); - - // var props = channel.CreateBasicProperties(); - // //храним на диске - // props.DeliveryMode = 2; - // //время жизни, мс - // //props.Expiration = "60000"; - - // foreach (var msg in msgList) - // { - // var body = Encoding.UTF8.GetBytes(msg); - // channel.BasicPublish(exchange: "", routingKey: mqSettings.QueueName, basicProperties: props, body: body); - - // sendIdx++; - // logger.LogDebug($"Отправлено сообщение в очередь: {mqSettings.HostName} {mqSettings.QueueName}, {msg}"); - // } - // } - - // return new MqSendResult { IsSuccess = true }; - //} - //catch (Exception ex) - //{ - // var notSendMsg = new List(); - - // // формируем список неотправленных элементов - // for (int i = sendIdx; i < msgList.Length; i++) - // notSendMsg.Add(msgList[i]); - - // logger.LogError(ex, $"Ошибка при отправке сообщения в очередь {mqSettings.HostName} {mqSettings.QueueName}, {string.Join(',', notSendMsg)}"); - - // return new MqSendResult { IsSuccess = false, NotSendMessages = notSendMsg.ToArray() }; - //} - } - - public bool InitConsumer(IMqSettings mqSettings, MqMessageHandlerDelegate messageHandler) - { - logger.LogInformation($"Устанавливаю соединение с RabbitMQ: {mqSettings.HostName}, {mqSettings.QueueName}"); - - return false; - - //var facory = new ConnectionFactory - //{ - // HostName = mqSettings.HostName, - // UserName = mqSettings.User, - // Password = mqSettings.Password, - // AutomaticRecoveryEnabled = true, - // DispatchConsumersAsync = true - //}; - - //try - //{ - // //using var connection = facory.CreateConnection(); - // //using var channel = connection.CreateModel(); - - // connection = facory.CreateConnection(); - // channel = connection.CreateModel(); - - // var args = new Dictionary { { "x-queue-mode", "lazy" } }; - - // channel.QueueDeclare( - // queue: mqSettings.QueueName, - // durable: true, - // exclusive: false, - // autoDelete: false, - // arguments: args - // ); - - // logger.LogInformation($"Соединение с RabbitMQ установлено: {mqSettings.HostName}, {mqSettings.QueueName}"); - - // channel.CallbackException += (ch, ea) => - // { - // var _channel = (IModel?)ch; - // // может тут если канал упал переоткрывать его - // logger.LogError(ea.Exception, $"Ошибка при обработке очереди MqService сообщений из очереди. Канал открыт: {_channel?.IsOpen}"); - // }; - - // var consumer = new AsyncEventingBasicConsumer(channel); - // consumer.Received += async (ch, ea) => - // { - // var content = Encoding.UTF8.GetString(ea.Body.ToArray()); - // logger.LogDebug($"Получено сообщение: {content}"); - - // await messageHandler.Invoke(content); - - // channel.BasicAck(ea.DeliveryTag, false); - // await Task.Yield(); - // }; - - // string consumerTag = channel.BasicConsume(mqSettings.QueueName, false, consumer); - - // return true; - - //} - //catch (Exception ex) - //{ - // logger.LogError(ex, $"Ошибка при получении сообщений из очереди: {mqSettings.HostName}, {mqSettings.QueueName}"); - - // return false; - //} - } - - public void Dispose() - { - //channel?.Close(); - //connection?.Close(); - - //channel?.Dispose(); - //connection?.Dispose(); - } - } -} diff --git a/PARR.BLL/Services/Interfaces/ICalendarService.cs b/PARR.BLL/Services/Interfaces/ICalendarService.cs index e2c3b468..4d9e63a7 100644 --- a/PARR.BLL/Services/Interfaces/ICalendarService.cs +++ b/PARR.BLL/Services/Interfaces/ICalendarService.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.BLL.Services.Interfaces { diff --git a/PARR.Common/PARR.Common.csproj b/PARR.Common/PARR.Common.csproj index 66f2d2b6..cfadb03d 100644 --- a/PARR.Common/PARR.Common.csproj +++ b/PARR.Common/PARR.Common.csproj @@ -6,8 +6,4 @@ enable - - - - diff --git a/PARR.BLL/Services/Interfaces/IMqAdminService.cs b/PARR.Core/Common/RabbitServices/IRabbitAdminService.cs similarity index 59% rename from PARR.BLL/Services/Interfaces/IMqAdminService.cs rename to PARR.Core/Common/RabbitServices/IRabbitAdminService.cs index 50407230..53cca091 100644 --- a/PARR.BLL/Services/Interfaces/IMqAdminService.cs +++ b/PARR.Core/Common/RabbitServices/IRabbitAdminService.cs @@ -1,22 +1,22 @@ -using PARR.BLL.Contracts.Interfaces; -using PARR.BLL.Domain.Mq; +using PARR.Domain.DTOs.RabbitApi; +using PARR.Domain.Settings; -namespace PARR.BLL.Services.Interfaces +namespace PARR.Core.Common.RabbitServices { - public interface IMqAdminService + public interface IRabbitAdminService { /// /// Получить статистику соединений из RabbitMQ /// /// /// - Task GetConnectionsAsync(IMqSettings mqSettings); + Task GetConnectionsAsync(IMqSettings mqSettings); /// /// Получить статистику по очередям из RabbitMQ /// /// /// - Task GetQueuesAsync(IMqSettings mqSettings); + Task GetQueuesAsync(IMqSettings mqSettings); } } diff --git a/PARR.BLL/Services/Interfaces/IMqService.cs b/PARR.Core/Common/RabbitServices/IRabbitService.cs similarity index 72% rename from PARR.BLL/Services/Interfaces/IMqService.cs rename to PARR.Core/Common/RabbitServices/IRabbitService.cs index 65af0579..bfda5a6b 100644 --- a/PARR.BLL/Services/Interfaces/IMqService.cs +++ b/PARR.Core/Common/RabbitServices/IRabbitService.cs @@ -1,11 +1,11 @@ -using PARR.BLL.Contracts.Interfaces; -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit; +using PARR.Domain.Settings; -namespace PARR.BLL.Services.Interfaces +namespace PARR.Core.Common.RabbitServices { public delegate Task MqMessageHandlerDelegate(string msg); - public interface IMqService : IAsyncDisposable // IDisposable + public interface IRabbitService : IAsyncDisposable { Task InitConsumerAsync(IMqSettings mqSettings, MqMessageHandlerDelegate messageHandler); @@ -16,7 +16,7 @@ namespace PARR.BLL.Services.Interfaces /// /// /// - Task SendAsync(IMqSettings mqSettings, string[] msgList); + Task SendAsync(IMqSettings mqSettings, string[] msgList); /// /// Отправить сообщение в очередь используя список объектов @@ -24,6 +24,6 @@ namespace PARR.BLL.Services.Interfaces /// /// /// - Task SendAsync(IMqSettings mqSettings, List msgObjectList); + Task SendAsync(IMqSettings mqSettings, List msgObjectList); } } diff --git a/PARR.Core/PARR.Core.csproj b/PARR.Core/PARR.Core.csproj index b74e94e8..b742a2b0 100644 --- a/PARR.Core/PARR.Core.csproj +++ b/PARR.Core/PARR.Core.csproj @@ -8,7 +8,6 @@ - diff --git a/PARR.DAL/Cache/Models/MatchingStatusItem.cs b/PARR.DAL/Cache/Models/MatchingStatusItem.cs index 6b630d0c..bae33a03 100644 --- a/PARR.DAL/Cache/Models/MatchingStatusItem.cs +++ b/PARR.DAL/Cache/Models/MatchingStatusItem.cs @@ -1,5 +1,5 @@ -using PARR.Constants; -using PARR.DAL.Cache.Models.Base; +using PARR.DAL.Cache.Models.Base; +using PARR.Domain.Enums; namespace PARR.DAL.Cache.Models { diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index 6dbf8aa4..5d6a4ae9 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -1,12 +1,12 @@ using Microsoft.EntityFrameworkCore; using PARR.BLL.Domain; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Extensions; using PARR.DAL.Models; using PARR.DAL.Models.Job; using PARR.DAL.Models.Schedule; using PARR.DAL.Models.Unit; +using PARR.Domain.Common.Roles; using PARR.Domain.Entities.TaskEntities; using PARR.Domain.Enums; diff --git a/PARR.DAL/DomainModels/ShortcodeInfoDto.cs b/PARR.DAL/DomainModels/ShortcodeInfoDto.cs index 56caa8b6..0db1d4bb 100644 --- a/PARR.DAL/DomainModels/ShortcodeInfoDto.cs +++ b/PARR.DAL/DomainModels/ShortcodeInfoDto.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.DAL.DomainModels { diff --git a/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs b/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs index deea3cb4..87aced32 100644 --- a/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs +++ b/PARR.DAL/DomainServices/Implementations/MatchingStatusService.cs @@ -1,10 +1,10 @@ using Microsoft.EntityFrameworkCore; -using PARR.Constants; using PARR.DAL.Cache.Models; using PARR.DAL.Cache.Services.Base; using PARR.DAL.DomainModels; using PARR.DAL.DomainServices.Interfaces; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Enums; namespace PARR.DAL.DomainServices.Implementations { diff --git a/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs b/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs index 3fc927de..4158e783 100644 --- a/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs +++ b/PARR.DAL/DomainServices/Interfaces/IMatchingStatusService.cs @@ -1,6 +1,6 @@ -using PARR.Constants; -using PARR.DAL.Cache.Models; +using PARR.DAL.Cache.Models; using PARR.DAL.DomainModels; +using PARR.Domain.Enums; namespace PARR.DAL.DomainServices.Interfaces { diff --git a/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs b/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs index 1e942e27..32305dbc 100644 --- a/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs +++ b/PARR.DAL/DomainServices/Shortcodes/ShortcodesService.cs @@ -1,6 +1,5 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Constants; using PARR.DAL.Cache.Services.Base; using PARR.DAL.Contracts; using PARR.DAL.DomainModels; diff --git a/PARR.DAL/Models/Template.cs b/PARR.DAL/Models/Template.cs index 5b63b2c9..6218c291 100644 --- a/PARR.DAL/Models/Template.cs +++ b/PARR.DAL/Models/Template.cs @@ -1,5 +1,4 @@ using Microsoft.EntityFrameworkCore; -using PARR.Constants; using PARR.Domain.Entities.Base; using PARR.Domain.Entities.Base.History; using PARR.Domain.Entities.Base.History.Base; diff --git a/PARR.DAL/Models/TemplateHistory.cs b/PARR.DAL/Models/TemplateHistory.cs index d7f1baa7..6989857b 100644 --- a/PARR.DAL/Models/TemplateHistory.cs +++ b/PARR.DAL/Models/TemplateHistory.cs @@ -1,5 +1,4 @@ -using PARR.Constants; -using PARR.Domain.Entities.Base; +using PARR.Domain.Entities.Base; using PARR.Domain.Entities.Base.History; using PARR.Domain.Entities.Base.History.Base; using PARR.Domain.Enums; diff --git a/PARR.DAL/Models/TemplateStatusType.cs b/PARR.DAL/Models/TemplateStatusType.cs index c5b0e8ff..59b1a344 100644 --- a/PARR.DAL/Models/TemplateStatusType.cs +++ b/PARR.DAL/Models/TemplateStatusType.cs @@ -1,5 +1,5 @@ using Microsoft.EntityFrameworkCore; -using PARR.Constants; +using PARR.Domain.Enums; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/PARR.DAL/NextRunServices/INextRunService.cs b/PARR.DAL/NextRunServices/INextRunService.cs index 8d5fff32..db673e33 100644 --- a/PARR.DAL/NextRunServices/INextRunService.cs +++ b/PARR.DAL/NextRunServices/INextRunService.cs @@ -1,6 +1,6 @@ -using PARR.Constants; -using PARR.DAL.Models.Job; +using PARR.DAL.Models.Job; using PARR.DAL.NextRunServices.Models; +using PARR.Domain.Enums; namespace PARR.DAL.NextRunServices { diff --git a/PARR.DAL/NextRunServices/NextRunService.cs b/PARR.DAL/NextRunServices/NextRunService.cs index 9e54bb29..48584553 100644 --- a/PARR.DAL/NextRunServices/NextRunService.cs +++ b/PARR.DAL/NextRunServices/NextRunService.cs @@ -1,6 +1,5 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.DomainServices.Shortcodes; using PARR.DAL.Models; @@ -10,6 +9,7 @@ using PARR.DAL.NextRunServices.Subservices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Schedule; +using PARR.Domain.Enums; namespace PARR.DAL.NextRunServices { diff --git a/PARR.DAL/PARR.DAL.csproj b/PARR.DAL/PARR.DAL.csproj index 20341eba..95436011 100644 --- a/PARR.DAL/PARR.DAL.csproj +++ b/PARR.DAL/PARR.DAL.csproj @@ -22,7 +22,6 @@ - diff --git a/PARR.DAL/Services/Implementations/OrderStatusService.cs b/PARR.DAL/Services/Implementations/OrderStatusService.cs index 38cb568c..a8764fa1 100644 --- a/PARR.DAL/Services/Implementations/OrderStatusService.cs +++ b/PARR.DAL/Services/Implementations/OrderStatusService.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging; -using PARR.Constants; using PARR.DAL.Context; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Enums; namespace PARR.DAL.Services.Implementations { diff --git a/PARR.DAL/Services/Implementations/RobotConfigurationService.cs b/PARR.DAL/Services/Implementations/RobotConfigurationService.cs index cf8fd8d1..4223b79c 100644 --- a/PARR.DAL/Services/Implementations/RobotConfigurationService.cs +++ b/PARR.DAL/Services/Implementations/RobotConfigurationService.cs @@ -1,6 +1,5 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Constants; using PARR.DAL.Context; using PARR.DAL.Models; using PARR.DAL.Repositories.Base; diff --git a/PARR.DAL/Services/Implementations/TemplateService.cs b/PARR.DAL/Services/Implementations/TemplateService.cs index f7864303..8e195ea2 100644 --- a/PARR.DAL/Services/Implementations/TemplateService.cs +++ b/PARR.DAL/Services/Implementations/TemplateService.cs @@ -1,7 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Npgsql; -using PARR.Constants; using PARR.DAL.Context; using PARR.DAL.Models; using PARR.DAL.Repositories.Base; diff --git a/PARR.DAL/Services/Interfaces/IOrderStatusService.cs b/PARR.DAL/Services/Interfaces/IOrderStatusService.cs index 4600f03b..c2fc96a3 100644 --- a/PARR.DAL/Services/Interfaces/IOrderStatusService.cs +++ b/PARR.DAL/Services/Interfaces/IOrderStatusService.cs @@ -1,6 +1,6 @@ -using PARR.Constants; -using PARR.DAL.Contracts; +using PARR.DAL.Contracts; using PARR.DAL.Models; +using PARR.Domain.Enums; namespace PARR.DAL.Services.Interfaces { diff --git a/PARR.DAL/Services/Interfaces/IRobotConfigurationService.cs b/PARR.DAL/Services/Interfaces/IRobotConfigurationService.cs index 792ce998..05a8edac 100644 --- a/PARR.DAL/Services/Interfaces/IRobotConfigurationService.cs +++ b/PARR.DAL/Services/Interfaces/IRobotConfigurationService.cs @@ -1,5 +1,4 @@ -using PARR.Constants; -using PARR.DAL.Models; +using PARR.DAL.Models; using PARR.DAL.Services.Interfaces.Base; using PARR.Domain.Enums; diff --git a/PARR.DAL/TaskServices/ITaskManagementService.cs b/PARR.DAL/TaskServices/ITaskManagementService.cs index d74511e2..161c264e 100644 --- a/PARR.DAL/TaskServices/ITaskManagementService.cs +++ b/PARR.DAL/TaskServices/ITaskManagementService.cs @@ -1,6 +1,6 @@ -using PARR.BLL.Contracts.Interfaces; -using PARR.Domain.Entities.Base.History; +using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; +using PARR.Domain.Settings; namespace PARR.DAL.TaskServices { diff --git a/PARR.DAL/TaskServices/TaskManagementService.cs b/PARR.DAL/TaskServices/TaskManagementService.cs index 4f0a4bbe..dca781c5 100644 --- a/PARR.DAL/TaskServices/TaskManagementService.cs +++ b/PARR.DAL/TaskServices/TaskManagementService.cs @@ -1,10 +1,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.BLL.Contracts.Interfaces; using PARR.Core.Repositories.Interfaces.TaskRepositories; using PARR.Domain.Entities.Base.History; using PARR.Domain.Entities.TaskEntities; using PARR.Domain.Enums; +using PARR.Domain.Settings; using System.Text.Encodings.Web; using System.Text.Json; diff --git a/PARR.BLL/Domain/Mq/AihitDataMq.cs b/PARR.Domain/Common/Rabbit/Messages/AihitDataMq.cs similarity index 93% rename from PARR.BLL/Domain/Mq/AihitDataMq.cs rename to PARR.Domain/Common/Rabbit/Messages/AihitDataMq.cs index b5455816..28dcb607 100644 --- a/PARR.BLL/Domain/Mq/AihitDataMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/AihitDataMq.cs @@ -1,4 +1,4 @@ -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Модель в MQ, данные из АИХИТ diff --git a/PARR.BLL/Domain/Mq/AihitMainDataMq.cs b/PARR.Domain/Common/Rabbit/Messages/AihitMainDataMq.cs similarity index 91% rename from PARR.BLL/Domain/Mq/AihitMainDataMq.cs rename to PARR.Domain/Common/Rabbit/Messages/AihitMainDataMq.cs index 0ae64cff..f2d81dad 100644 --- a/PARR.BLL/Domain/Mq/AihitMainDataMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/AihitMainDataMq.cs @@ -1,4 +1,4 @@ -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Модель в MQ, данные из АИХИТ для любой ХП diff --git a/PARR.BLL/Domain/Mq/GeneratorTemplateMq.cs b/PARR.Domain/Common/Rabbit/Messages/GeneratorTemplateMq.cs similarity index 97% rename from PARR.BLL/Domain/Mq/GeneratorTemplateMq.cs rename to PARR.Domain/Common/Rabbit/Messages/GeneratorTemplateMq.cs index 26657081..d76d955b 100644 --- a/PARR.BLL/Domain/Mq/GeneratorTemplateMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/GeneratorTemplateMq.cs @@ -1,6 +1,6 @@ using PARR.Domain.Entities.Base.History; -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Модель в MQ, запрос на генерацию шаблона diff --git a/PARR.BLL/Domain/Mq/NextRunUpdateMq.cs b/PARR.Domain/Common/Rabbit/Messages/NextRunUpdateMq.cs similarity index 87% rename from PARR.BLL/Domain/Mq/NextRunUpdateMq.cs rename to PARR.Domain/Common/Rabbit/Messages/NextRunUpdateMq.cs index f70247cd..2b43c31f 100644 --- a/PARR.BLL/Domain/Mq/NextRunUpdateMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/NextRunUpdateMq.cs @@ -1,6 +1,6 @@ using PARR.Domain.Entities.Base.History; -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Запрос на обновление всех nextRun для JobGroup diff --git a/PARR.BLL/Domain/Mq/OrderManageMq.cs b/PARR.Domain/Common/Rabbit/Messages/OrderManageMq.cs similarity index 81% rename from PARR.BLL/Domain/Mq/OrderManageMq.cs rename to PARR.Domain/Common/Rabbit/Messages/OrderManageMq.cs index 06c5e731..f411a75f 100644 --- a/PARR.BLL/Domain/Mq/OrderManageMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/OrderManageMq.cs @@ -1,4 +1,4 @@ -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Модель в MQ, запрос на изменение Наряда в ЕСПП diff --git a/PARR.BLL/Domain/Mq/TemplateActivatorMq.cs b/PARR.Domain/Common/Rabbit/Messages/TemplateActivatorMq.cs similarity index 91% rename from PARR.BLL/Domain/Mq/TemplateActivatorMq.cs rename to PARR.Domain/Common/Rabbit/Messages/TemplateActivatorMq.cs index 226284ff..7030377b 100644 --- a/PARR.BLL/Domain/Mq/TemplateActivatorMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/TemplateActivatorMq.cs @@ -1,7 +1,7 @@ -using PARR.Constants; -using PARR.Domain.Entities.Base.History; +using PARR.Domain.Entities.Base.History; +using PARR.Domain.Enums; -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Модель в MQ, активация/деактивация шаблонов/расписаний diff --git a/PARR.BLL/Domain/Mq/TemplateDistributorMq.cs b/PARR.Domain/Common/Rabbit/Messages/TemplateDistributorMq.cs similarity index 88% rename from PARR.BLL/Domain/Mq/TemplateDistributorMq.cs rename to PARR.Domain/Common/Rabbit/Messages/TemplateDistributorMq.cs index abee7836..56b36d3e 100644 --- a/PARR.BLL/Domain/Mq/TemplateDistributorMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/TemplateDistributorMq.cs @@ -1,6 +1,6 @@ using PARR.Domain.Entities.Base.History; -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Модель в MQ, распределить шаблоны для JobGroupId (для TemplateDistributor) diff --git a/PARR.BLL/Domain/Mq/TemplateGeneratorMq.cs b/PARR.Domain/Common/Rabbit/Messages/TemplateGeneratorMq.cs similarity index 96% rename from PARR.BLL/Domain/Mq/TemplateGeneratorMq.cs rename to PARR.Domain/Common/Rabbit/Messages/TemplateGeneratorMq.cs index ceb6c11b..2abe3bdb 100644 --- a/PARR.BLL/Domain/Mq/TemplateGeneratorMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/TemplateGeneratorMq.cs @@ -1,6 +1,6 @@ using PARR.Domain.Entities.Base.History; -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Модель в MQ, простого создания Template diff --git a/PARR.BLL/Domain/Mq/TemplateMatcherMq.cs b/PARR.Domain/Common/Rabbit/Messages/TemplateMatcherMq.cs similarity index 70% rename from PARR.BLL/Domain/Mq/TemplateMatcherMq.cs rename to PARR.Domain/Common/Rabbit/Messages/TemplateMatcherMq.cs index ba9f13ce..999e4f21 100644 --- a/PARR.BLL/Domain/Mq/TemplateMatcherMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/TemplateMatcherMq.cs @@ -1,7 +1,7 @@ -using PARR.Constants; -using PARR.Domain.Entities.Base.History; +using PARR.Domain.Entities.Base.History; +using PARR.Domain.Enums; -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { public class TemplateMatcherMq { diff --git a/PARR.BLL/Domain/Mq/TemplateTaskGeneratorMq.cs b/PARR.Domain/Common/Rabbit/Messages/TemplateTaskGeneratorMq.cs similarity index 87% rename from PARR.BLL/Domain/Mq/TemplateTaskGeneratorMq.cs rename to PARR.Domain/Common/Rabbit/Messages/TemplateTaskGeneratorMq.cs index 854c9aa4..40a739b4 100644 --- a/PARR.BLL/Domain/Mq/TemplateTaskGeneratorMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/TemplateTaskGeneratorMq.cs @@ -1,4 +1,4 @@ -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { /// /// Модель в MQ, генератора заданий на генерацию шаблонов diff --git a/PARR.BLL/Domain/Mq/TemplateUpdaterMq.cs b/PARR.Domain/Common/Rabbit/Messages/TemplateUpdaterMq.cs similarity index 94% rename from PARR.BLL/Domain/Mq/TemplateUpdaterMq.cs rename to PARR.Domain/Common/Rabbit/Messages/TemplateUpdaterMq.cs index cd6928e1..9cab0794 100644 --- a/PARR.BLL/Domain/Mq/TemplateUpdaterMq.cs +++ b/PARR.Domain/Common/Rabbit/Messages/TemplateUpdaterMq.cs @@ -1,7 +1,7 @@ -using PARR.Constants; -using PARR.Domain.Entities.Base.History; +using PARR.Domain.Entities.Base.History; +using PARR.Domain.Enums; -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit.Messages { public class TemplateUpdaterMq { diff --git a/PARR.BLL/Domain/Mq/MqSendResult.cs b/PARR.Domain/Common/Rabbit/RabbitSendResult.cs similarity index 64% rename from PARR.BLL/Domain/Mq/MqSendResult.cs rename to PARR.Domain/Common/Rabbit/RabbitSendResult.cs index b719b484..1519af78 100644 --- a/PARR.BLL/Domain/Mq/MqSendResult.cs +++ b/PARR.Domain/Common/Rabbit/RabbitSendResult.cs @@ -1,18 +1,18 @@ -namespace PARR.BLL.Domain.Mq +namespace PARR.Domain.Common.Rabbit { /// /// Результат отправки очереди в MQ /// - public class MqSendResult + public record RabbitSendResult { /// /// Результат отправки /// - public bool IsSuccess { get; set; } + public bool IsSuccess { get; init; } /// /// Неотправленные сообщения /// - public string[]? NotSendMessages { get; set; } + public string[]? NotSendMessages { get; init; } } } diff --git a/PARR.Constants/ParrRoles.cs b/PARR.Domain/Common/Roles/ParrRoles.cs similarity index 97% rename from PARR.Constants/ParrRoles.cs rename to PARR.Domain/Common/Roles/ParrRoles.cs index e95b6ac7..553f3708 100644 --- a/PARR.Constants/ParrRoles.cs +++ b/PARR.Domain/Common/Roles/ParrRoles.cs @@ -1,4 +1,4 @@ -namespace PARR.Constants +namespace PARR.Domain.Common.Roles { /// /// Роли ПАРР diff --git a/PARR.Domain/DTOs/RabbitApi/RabbitApiResult.cs b/PARR.Domain/DTOs/RabbitApi/RabbitApiResult.cs new file mode 100644 index 00000000..13c1bbb5 --- /dev/null +++ b/PARR.Domain/DTOs/RabbitApi/RabbitApiResult.cs @@ -0,0 +1,14 @@ +namespace PARR.Domain.DTOs.RabbitApi +{ + /// + /// Ответ от API RabbitMQ + /// + public record RabbitApiResult + { + public bool IsSuccess { get; init; } + + public object? Response { get; init; } + + public Exception? Exception { get; init; } + } +} diff --git a/PARR.Constants/DistributionPeriodTypeEnum.cs b/PARR.Domain/Enums/DistributionPeriodTypeEnum.cs similarity index 87% rename from PARR.Constants/DistributionPeriodTypeEnum.cs rename to PARR.Domain/Enums/DistributionPeriodTypeEnum.cs index 6ca38294..11e8c482 100644 --- a/PARR.Constants/DistributionPeriodTypeEnum.cs +++ b/PARR.Domain/Enums/DistributionPeriodTypeEnum.cs @@ -1,4 +1,4 @@ -namespace PARR.Constants +namespace PARR.Domain.Enums { /// /// Тип периода распределения РР diff --git a/PARR.Constants/OrderStatusEnum.cs b/PARR.Domain/Enums/OrderStatusEnum.cs similarity index 95% rename from PARR.Constants/OrderStatusEnum.cs rename to PARR.Domain/Enums/OrderStatusEnum.cs index 79825b6b..4fb77851 100644 --- a/PARR.Constants/OrderStatusEnum.cs +++ b/PARR.Domain/Enums/OrderStatusEnum.cs @@ -1,4 +1,4 @@ -namespace PARR.Constants +namespace PARR.Domain.Enums { /// /// Статус Наряда в ЕСПП diff --git a/PARR.Constants/RobotsAllEnum.cs b/PARR.Domain/Enums/RobotsAllEnum.cs similarity index 96% rename from PARR.Constants/RobotsAllEnum.cs rename to PARR.Domain/Enums/RobotsAllEnum.cs index 9846eecf..5cb2016a 100644 --- a/PARR.Constants/RobotsAllEnum.cs +++ b/PARR.Domain/Enums/RobotsAllEnum.cs @@ -1,4 +1,4 @@ -namespace PARR.Constants +namespace PARR.Domain.Enums { /// /// Список всех роботов (в бд нет 3, 4) diff --git a/PARR.Constants/RobotsEnum.cs b/PARR.Domain/Enums/RobotsEnum.cs similarity index 94% rename from PARR.Constants/RobotsEnum.cs rename to PARR.Domain/Enums/RobotsEnum.cs index 3aa6da9a..0b2ebf70 100644 --- a/PARR.Constants/RobotsEnum.cs +++ b/PARR.Domain/Enums/RobotsEnum.cs @@ -1,4 +1,4 @@ -namespace PARR.Constants +namespace PARR.Domain.Enums { /// /// Список роботов diff --git a/PARR.Constants/ShortcodeTypeEnum.cs b/PARR.Domain/Enums/ShortcodeTypeEnum.cs similarity index 90% rename from PARR.Constants/ShortcodeTypeEnum.cs rename to PARR.Domain/Enums/ShortcodeTypeEnum.cs index 255a7f7f..8efebc88 100644 --- a/PARR.Constants/ShortcodeTypeEnum.cs +++ b/PARR.Domain/Enums/ShortcodeTypeEnum.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PARR.Constants +namespace PARR.Domain.Enums { [JsonConverter(typeof(JsonStringEnumConverter))] public enum ShortcodeTypeEnum diff --git a/PARR.Constants/SyncTaskEntityTypeEnum.cs b/PARR.Domain/Enums/SyncTaskEntityTypeEnum.cs similarity index 87% rename from PARR.Constants/SyncTaskEntityTypeEnum.cs rename to PARR.Domain/Enums/SyncTaskEntityTypeEnum.cs index f919c9bf..e5c4624b 100644 --- a/PARR.Constants/SyncTaskEntityTypeEnum.cs +++ b/PARR.Domain/Enums/SyncTaskEntityTypeEnum.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PARR.Constants +namespace PARR.Domain.Enums { [JsonConverter(typeof(JsonStringEnumConverter))] public enum SyncTaskEntityTypeEnum diff --git a/PARR.Constants/TemplateActivatorActionsEnum.cs b/PARR.Domain/Enums/TemplateActivatorActionsEnum.cs similarity index 98% rename from PARR.Constants/TemplateActivatorActionsEnum.cs rename to PARR.Domain/Enums/TemplateActivatorActionsEnum.cs index dbda9418..e3a13683 100644 --- a/PARR.Constants/TemplateActivatorActionsEnum.cs +++ b/PARR.Domain/Enums/TemplateActivatorActionsEnum.cs @@ -1,4 +1,4 @@ -namespace PARR.Constants +namespace PARR.Domain.Enums { //todo: удалить!!! diff --git a/PARR.Constants/TemplateActivatorEsppObjectTypesEnum.cs b/PARR.Domain/Enums/TemplateActivatorEsppObjectTypesEnum.cs similarity index 94% rename from PARR.Constants/TemplateActivatorEsppObjectTypesEnum.cs rename to PARR.Domain/Enums/TemplateActivatorEsppObjectTypesEnum.cs index ef86f2bb..f61f83f0 100644 --- a/PARR.Constants/TemplateActivatorEsppObjectTypesEnum.cs +++ b/PARR.Domain/Enums/TemplateActivatorEsppObjectTypesEnum.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PARR.Constants +namespace PARR.Domain.Enums { /// /// Объект воздействия активатора diff --git a/PARR.Constants/TemplateMatcherActionEnum.cs b/PARR.Domain/Enums/TemplateMatcherActionEnum.cs similarity index 96% rename from PARR.Constants/TemplateMatcherActionEnum.cs rename to PARR.Domain/Enums/TemplateMatcherActionEnum.cs index a5ab2625..08d471aa 100644 --- a/PARR.Constants/TemplateMatcherActionEnum.cs +++ b/PARR.Domain/Enums/TemplateMatcherActionEnum.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PARR.Constants +namespace PARR.Domain.Enums { [JsonConverter(typeof(JsonStringEnumConverter))] public enum TemplateMatcherActionEnum diff --git a/PARR.Constants/TemplateStatusTypeEnum.cs b/PARR.Domain/Enums/TemplateStatusTypeEnum.cs similarity index 94% rename from PARR.Constants/TemplateStatusTypeEnum.cs rename to PARR.Domain/Enums/TemplateStatusTypeEnum.cs index c54c1c16..5722322e 100644 --- a/PARR.Constants/TemplateStatusTypeEnum.cs +++ b/PARR.Domain/Enums/TemplateStatusTypeEnum.cs @@ -1,4 +1,4 @@ -namespace PARR.Constants +namespace PARR.Domain.Enums { public enum TemplateStatusTypeEnum { diff --git a/PARR.Domain/PARR.Domain.csproj b/PARR.Domain/PARR.Domain.csproj index 6dd9b14e..49e7037b 100644 --- a/PARR.Domain/PARR.Domain.csproj +++ b/PARR.Domain/PARR.Domain.csproj @@ -7,9 +7,8 @@ - + - diff --git a/PARR.Domain/Settings/IMqSettings.cs b/PARR.Domain/Settings/IMqSettings.cs new file mode 100644 index 00000000..479ee0d1 --- /dev/null +++ b/PARR.Domain/Settings/IMqSettings.cs @@ -0,0 +1,27 @@ +namespace PARR.Domain.Settings +{ + /// + /// Поля настроек MQ, используется для appsettings.json + /// + public interface IMqSettings + { + string HostName { get; init; } + string QueueName { get; init; } + string User { get; init; } + string Password { get; init; } + + /// + /// Кол-во сообщений которые может принимать consumer за один раз. 0 или null - без ограничений + /// + ushort? PrefetchCount { get; init; } + } + + public record MqSettingsBase : IMqSettings + { + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; + } +} diff --git a/PARR.EsppApi/Models/EsppOrder.cs b/PARR.EsppApi/Models/EsppOrder.cs index 02c0e8b0..eed2d99e 100644 --- a/PARR.EsppApi/Models/EsppOrder.cs +++ b/PARR.EsppApi/Models/EsppOrder.cs @@ -1,5 +1,4 @@ -using Microsoft.Extensions.Logging; -using PARR.Constants; +using PARR.Domain.Enums; using PARR.EsppApi.Settings; using System.Globalization; using System.Text.Json.Serialization; diff --git a/PARR.EsppApi/PARR.EsppApi.csproj b/PARR.EsppApi/PARR.EsppApi.csproj index c4c78f10..cdfa269e 100644 --- a/PARR.EsppApi/PARR.EsppApi.csproj +++ b/PARR.EsppApi/PARR.EsppApi.csproj @@ -15,7 +15,7 @@ - + diff --git a/PARR.EsppOrderManager/EsppOrderManager.cs b/PARR.EsppOrderManager/EsppOrderManager.cs index 1d2504a2..667dc168 100644 --- a/PARR.EsppOrderManager/EsppOrderManager.cs +++ b/PARR.EsppOrderManager/EsppOrderManager.cs @@ -1,10 +1,11 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Enums; using PARR.EsppOrderManager.Services; using PARR.EsppOrderManager.Settings; @@ -14,7 +15,7 @@ namespace PARR.EsppOrderManager internal class EsppOrderManager : IEsppOrderManager { private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly ILogger logger; private readonly ITransformService transformService; private readonly IEsppOrderService esppOrderService; @@ -23,7 +24,7 @@ namespace PARR.EsppOrderManager public EsppOrderManager( MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, ILogger logger, ITransformService transformService, IEsppOrderService esppOrderService, diff --git a/PARR.EsppOrderManager/Services/EsppOrderService.cs b/PARR.EsppOrderManager/Services/EsppOrderService.cs index 621df5ab..67505517 100644 --- a/PARR.EsppOrderManager/Services/EsppOrderService.cs +++ b/PARR.EsppOrderManager/Services/EsppOrderService.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Logging; -using PARR.Constants; using PARR.DAL.Models; +using PARR.Domain.Enums; using PARR.EsppApi; using PARR.EsppApi.Constants; using PARR.EsppApi.Models.Query; diff --git a/PARR.EsppOrderManager/Settings/MqSettings.cs b/PARR.EsppOrderManager/Settings/MqSettings.cs index 1a8c55bb..4d7bb7b0 100644 --- a/PARR.EsppOrderManager/Settings/MqSettings.cs +++ b/PARR.EsppOrderManager/Settings/MqSettings.cs @@ -1,13 +1,13 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.EsppOrderManager.Settings { internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs index 77cbb600..3cf487b8 100644 --- a/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs +++ b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs @@ -1,5 +1,4 @@ -using PARR.Constants; -using PARR.Domain.Enums; +using PARR.Domain.Enums; using PARR.EsppSync; using PARR.EsppSync.Attributes; diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs index d62db435..668bfb3c 100644 --- a/PARR.EsppScheduleSync/ScheduleSyncher.cs +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -2,8 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using PARR.BLL.Helpers; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.NextRunServices; @@ -22,7 +21,7 @@ namespace PARR.EsppScheduleSync { private readonly ILogger logger; private readonly GlobalSettings globalSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly ISyncService syncService; private readonly SettingsFromDb settingsFromDb; private readonly IServiceProvider serviceProvider; @@ -32,7 +31,7 @@ namespace PARR.EsppScheduleSync public ScheduleSyncher( ILogger logger, GlobalSettings globalSettings, - IMqService mqService, + IRabbitService mqService, ISyncService syncService, SettingsFromDb settingsFromDb, IServiceProvider serviceProvider diff --git a/PARR.EsppScheduleSync/Settings/GlobalSettings.cs b/PARR.EsppScheduleSync/Settings/GlobalSettings.cs index ab1dda14..94b43d1f 100644 --- a/PARR.EsppScheduleSync/Settings/GlobalSettings.cs +++ b/PARR.EsppScheduleSync/Settings/GlobalSettings.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.EsppScheduleSync.Settings { @@ -10,10 +10,10 @@ namespace PARR.EsppScheduleSync.Settings internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.EsppSync/IEsppObject.cs b/PARR.EsppSync/IEsppObject.cs index e62efe81..c90e565d 100644 --- a/PARR.EsppSync/IEsppObject.cs +++ b/PARR.EsppSync/IEsppObject.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.EsppSync { diff --git a/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs b/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs index 934a705b..ad617ee8 100644 --- a/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs +++ b/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; using PARR.EsppSync; namespace PARR.EsppTemplateSync.Domain diff --git a/PARR.EsppTemplateSync/Settings/GlobalSettings.cs b/PARR.EsppTemplateSync/Settings/GlobalSettings.cs index 5b0037ed..00671723 100644 --- a/PARR.EsppTemplateSync/Settings/GlobalSettings.cs +++ b/PARR.EsppTemplateSync/Settings/GlobalSettings.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.EsppTemplateSync.Settings { @@ -13,11 +13,11 @@ namespace PARR.EsppTemplateSync.Settings internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } internal class StorageSettings diff --git a/PARR.EsppTemplateSync/TemplateMQSyncer.cs b/PARR.EsppTemplateSync/TemplateMQSyncer.cs index 0dcdcd61..30446b5f 100644 --- a/PARR.EsppTemplateSync/TemplateMQSyncer.cs +++ b/PARR.EsppTemplateSync/TemplateMQSyncer.cs @@ -1,5 +1,5 @@ using Microsoft.Extensions.Logging; -using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.EsppSync; @@ -12,7 +12,7 @@ namespace PARR.EsppTemplateSync { private readonly ILogger logger; private readonly GlobalSettings globalSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly SettingsFromDb settingsFromDb; private readonly ISyncService syncService; @@ -20,7 +20,7 @@ namespace PARR.EsppTemplateSync public TemplateMQSyncer( ILogger logger, GlobalSettings globalSettings, - IMqService mqService, + IRabbitService mqService, SettingsFromDb settingsFromDb, ISyncService syncService ) diff --git a/PARR.Infrastructure/DependencyInjection.cs b/PARR.Infrastructure/DependencyInjection.cs index cf7a03af..ef27fb9a 100644 --- a/PARR.Infrastructure/DependencyInjection.cs +++ b/PARR.Infrastructure/DependencyInjection.cs @@ -1,5 +1,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using PARR.Core.Common.RabbitServices; +using PARR.Infrastructure.Rabbit; namespace PARR.Infrastructure { @@ -15,6 +17,10 @@ namespace PARR.Infrastructure { // тут регистрируем все внешние сервисы, Rabbit, Redis, Email... + services.AddHttpClient(); + services.AddTransient(); + + //services.AddTransient(); //services.AddTransient(); ////Redis (singleton) diff --git a/PARR.Infrastructure/PARR.Infrastructure.csproj b/PARR.Infrastructure/PARR.Infrastructure.csproj index 1440b026..8d9de693 100644 --- a/PARR.Infrastructure/PARR.Infrastructure.csproj +++ b/PARR.Infrastructure/PARR.Infrastructure.csproj @@ -7,7 +7,9 @@ - + + + diff --git a/PARR.BLL/Services/Implementations/MqAdminService.cs b/PARR.Infrastructure/Rabbit/RabbitAdminService.cs similarity index 67% rename from PARR.BLL/Services/Implementations/MqAdminService.cs rename to PARR.Infrastructure/Rabbit/RabbitAdminService.cs index 02ef557e..960ae084 100644 --- a/PARR.BLL/Services/Implementations/MqAdminService.cs +++ b/PARR.Infrastructure/Rabbit/RabbitAdminService.cs @@ -1,27 +1,27 @@ using Microsoft.Extensions.Logging; -using PARR.BLL.Contracts.Interfaces; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.DTOs.RabbitApi; +using PARR.Domain.Settings; using System.Net; using System.Net.Http.Headers; using System.Text; using System.Text.Json; -namespace PARR.BLL.Services.Implementations +namespace PARR.Infrastructure.Rabbit { - internal class MqAdminService : IMqAdminService + internal class RabbitAdminService : IRabbitAdminService { private readonly HttpClient httpClient; - private readonly ILogger logger; + private readonly ILogger logger; - public MqAdminService(HttpClient httpClient, ILogger logger) + public RabbitAdminService(HttpClient httpClient, ILogger logger) { this.httpClient = httpClient; this.logger = logger; } - public async Task GetConnectionsAsync(IMqSettings mqSettings) + public async Task GetConnectionsAsync(IMqSettings mqSettings) { var url = $"http://{mqSettings.HostName}:15672/api/connections"; @@ -29,7 +29,7 @@ namespace PARR.BLL.Services.Implementations } - public async Task GetQueuesAsync(IMqSettings mqSettings) + public async Task GetQueuesAsync(IMqSettings mqSettings) { var url = $"http://{mqSettings.HostName}:15672/api/queues"; @@ -37,7 +37,7 @@ namespace PARR.BLL.Services.Implementations } - private async Task SendRequestAsync(IMqSettings mqSettings, string url) + private async Task SendRequestAsync(IMqSettings mqSettings, string url) { SetAuthorizationHeaders(mqSettings); @@ -50,19 +50,19 @@ namespace PARR.BLL.Services.Implementations var content = await result.Content.ReadAsStringAsync(); var json = JsonSerializer.Deserialize(content); - return new MqApiResult { IsSuccess = true, Response = json }; + return new RabbitApiResult { IsSuccess = true, Response = json }; } else { logger.LogError($"Ошибка при запросе к RabbitMq, url: {url}, StatusCode: {result.StatusCode}"); - return new MqApiResult { IsSuccess = false }; + return new RabbitApiResult { IsSuccess = false }; } } catch (Exception ex) { logger.LogError(ex, $"Ошибка при запросе к RabbitMQ, url: {url}"); - return new MqApiResult { IsSuccess = false, Exception = ex }; + return new RabbitApiResult { IsSuccess = false, Exception = ex }; } } diff --git a/PARR.BLL/Services/Implementations/MqServiceV2.cs b/PARR.Infrastructure/Rabbit/RabbitService.cs similarity index 93% rename from PARR.BLL/Services/Implementations/MqServiceV2.cs rename to PARR.Infrastructure/Rabbit/RabbitService.cs index c56cd347..ec9d7c35 100644 --- a/PARR.BLL/Services/Implementations/MqServiceV2.cs +++ b/PARR.Infrastructure/Rabbit/RabbitService.cs @@ -1,18 +1,18 @@ using Microsoft.Extensions.Logging; -using PARR.BLL.Contracts.Interfaces; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.Common.Rabbit; +using PARR.Domain.Settings; using RabbitMQ.Client; using RabbitMQ.Client.Events; using System.Text; using System.Text.Encodings.Web; using System.Text.Json; -namespace PARR.BLL.Services.Implementations +namespace PARR.Infrastructure.Rabbit { - internal class MqServiceV2 : IMqService + internal class RabbitService : IRabbitService { - private readonly ILogger logger; + private readonly ILogger logger; private IConnection? consumerConnection; private IChannel? consumerChannel; @@ -24,7 +24,7 @@ namespace PARR.BLL.Services.Implementations Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, }; - public MqServiceV2(ILogger logger) + public RabbitService(ILogger logger) { this.logger = logger; } @@ -115,14 +115,14 @@ namespace PARR.BLL.Services.Implementations } } - public async Task SendAsync(IMqSettings mqSettings, List msgObjectList) + public async Task SendAsync(IMqSettings mqSettings, List msgObjectList) { var msgStringList = msgObjectList.Select(t => JsonSerializer.Serialize(t, jsonOptions)).ToArray(); return await SendAsync(mqSettings, msgStringList); } - public async Task SendAsync(IMqSettings mqSettings, string[] msgList) + public async Task SendAsync(IMqSettings mqSettings, string[] msgList) { var factory = new ConnectionFactory { @@ -175,7 +175,7 @@ namespace PARR.BLL.Services.Implementations } } - return new MqSendResult { IsSuccess = true }; + return new RabbitSendResult { IsSuccess = true }; } catch (Exception ex) { @@ -187,7 +187,7 @@ namespace PARR.BLL.Services.Implementations logger.LogError(ex, $"Ошибка при отправке сообщения в очередь {mqSettings.HostName} {mqSettings.QueueName}, {string.Join(',', notSendMsg)}"); - return new MqSendResult { IsSuccess = false, NotSendMessages = notSendMsg.ToArray() }; + return new RabbitSendResult { IsSuccess = false, NotSendMessages = notSendMsg.ToArray() }; } } diff --git a/PARR.JobAutoControl/JobAutoControlManager.cs b/PARR.JobAutoControl/JobAutoControlManager.cs index fd3ee0a6..5d840065 100644 --- a/PARR.JobAutoControl/JobAutoControlManager.cs +++ b/PARR.JobAutoControl/JobAutoControlManager.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; using PARR.JobAutoControl.Settings; -using System.Text.Json; namespace PARR.JobAutoControl { @@ -44,10 +44,10 @@ namespace PARR.JobAutoControl //using (var scope = serviceProvider.CreateScope()) { var jobAutoControlService = scope.ServiceProvider.GetService(); - var mqService = scope.ServiceProvider.GetService(); + var mqService = scope.ServiceProvider.GetService(); if (jobAutoControlService == null || mqService == null) - throw new Exception($"Не смог получить серивс {nameof(IJobAutoControlService)} или {nameof(IMqService)}"); + throw new Exception($"Не смог получить серивс {nameof(IJobAutoControlService)} или {nameof(IRabbitService)}"); await HandlerAsync(jobAutoControlService, mqService); } @@ -55,7 +55,7 @@ namespace PARR.JobAutoControl } - private async Task HandlerAsync(IJobAutoControlService jobAutoControlService, IMqService mqService) + private async Task HandlerAsync(IJobAutoControlService jobAutoControlService, IRabbitService mqService) { var jobsWithAutoControl = await jobAutoControlService.Get().Where(t => t.IsEnable).ToListAsync(); @@ -68,8 +68,8 @@ namespace PARR.JobAutoControl // формируем сообщения var msgList = jobsWithAutoControl.Select(t => new TemplateMatcherMq { - Action = Constants.TemplateMatcherActionEnum.Sync, - EntityType = Constants.SyncTaskEntityTypeEnum.Job, + Action = TemplateMatcherActionEnum.Sync, + EntityType = SyncTaskEntityTypeEnum.Job, Id = t.JobId, Initiator = new HistoryInitiator { diff --git a/PARR.JobAutoControl/PARR.JobAutoControl.csproj b/PARR.JobAutoControl/PARR.JobAutoControl.csproj index 4d002e29..21190861 100644 --- a/PARR.JobAutoControl/PARR.JobAutoControl.csproj +++ b/PARR.JobAutoControl/PARR.JobAutoControl.csproj @@ -8,7 +8,6 @@ - diff --git a/PARR.JobAutoControl/Settings/MqSettings.cs b/PARR.JobAutoControl/Settings/MqSettings.cs index 34202d71..e85cc3f5 100644 --- a/PARR.JobAutoControl/Settings/MqSettings.cs +++ b/PARR.JobAutoControl/Settings/MqSettings.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.JobAutoControl.Settings { @@ -9,11 +9,11 @@ namespace PARR.JobAutoControl.Settings internal class TemplateMatcher : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } diff --git a/PARR.Master/PARR.Master.csproj b/PARR.Master/PARR.Master.csproj index 4d002e29..21190861 100644 --- a/PARR.Master/PARR.Master.csproj +++ b/PARR.Master/PARR.Master.csproj @@ -8,7 +8,6 @@ - diff --git a/PARR.Master/Services/OrderMasterService.cs b/PARR.Master/Services/OrderMasterService.cs index 6a1963fc..9d62e2a1 100644 --- a/PARR.Master/Services/OrderMasterService.cs +++ b/PARR.Master/Services/OrderMasterService.cs @@ -1,10 +1,9 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Enums; using PARR.Master.Settings; using System.Text.Encodings.Web; @@ -19,7 +18,7 @@ namespace PARR.Master.Services private readonly IAgentHistoryService agentHistoryService; private readonly OrderManageSettings orderManageSettings; private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private static readonly JsonSerializerOptions jsonOptions = new JsonSerializerOptions { @@ -32,7 +31,7 @@ namespace PARR.Master.Services IAgentHistoryService agentHistoryService, OrderManageSettings orderManageSettings, MqSettings mqSettings, - IMqService mqService + IRabbitService mqService ) { diff --git a/PARR.Master/Settings/MqSettings.cs b/PARR.Master/Settings/MqSettings.cs index 826593e4..477e8abe 100644 --- a/PARR.Master/Settings/MqSettings.cs +++ b/PARR.Master/Settings/MqSettings.cs @@ -1,13 +1,13 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.Master.Settings { internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.NextRun/NextRunRabbitService.cs b/PARR.NextRun/NextRunRabbitService.cs index e5b9264c..7de0d813 100644 --- a/PARR.NextRun/NextRunRabbitService.cs +++ b/PARR.NextRun/NextRunRabbitService.cs @@ -1,9 +1,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Common.Rabbit.Messages; using PARR.NextRun.Services; using PARR.NextRun.Settings; @@ -15,14 +16,14 @@ namespace PARR.NextRun internal class NextRunRabbitService : INextRunRabbitService { private readonly ILogger logger; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly WorkerSettings workerSettings; private readonly ITransformService transformService; private readonly IServiceProvider serviceProvider; public NextRunRabbitService( ILogger logger, - IMqService mqService, + IRabbitService mqService, WorkerSettings workerSettings, ITransformService transformService, IServiceProvider serviceProvider diff --git a/PARR.NextRun/Services/NextRunUpdateService.cs b/PARR.NextRun/Services/NextRunUpdateService.cs index c050bb8c..38223fcb 100644 --- a/PARR.NextRun/Services/NextRunUpdateService.cs +++ b/PARR.NextRun/Services/NextRunUpdateService.cs @@ -1,10 +1,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; using PARR.Domain.Entities.Base.History; +using PARR.Domain.Enums; namespace PARR.NextRun.Services { diff --git a/PARR.NextRun/Settings/WorkerSettings.cs b/PARR.NextRun/Settings/WorkerSettings.cs index b39478c0..593a2648 100644 --- a/PARR.NextRun/Settings/WorkerSettings.cs +++ b/PARR.NextRun/Settings/WorkerSettings.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.NextRun.Settings { @@ -11,11 +11,11 @@ namespace PARR.NextRun.Settings internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.TemplateActivator/ITemplateActivator.cs b/PARR.TemplateActivator/ITemplateActivator.cs index aa262e9a..82a8517d 100644 --- a/PARR.TemplateActivator/ITemplateActivator.cs +++ b/PARR.TemplateActivator/ITemplateActivator.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; namespace PARR.TemplateActivator; diff --git a/PARR.TemplateActivator/MqTemplateActivator.cs b/PARR.TemplateActivator/MqTemplateActivator.cs index da35a79a..d515a131 100644 --- a/PARR.TemplateActivator/MqTemplateActivator.cs +++ b/PARR.TemplateActivator/MqTemplateActivator.cs @@ -1,14 +1,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.Common.Rabbit.Messages; namespace PARR.TemplateActivator; internal class MqTemplateActivator : IMqTemplateActivator { private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly ILogger logger; private readonly ITransformService transformService; private readonly IValidatorService validatorService; @@ -16,7 +17,7 @@ internal class MqTemplateActivator : IMqTemplateActivator public MqTemplateActivator( MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, ILogger logger, ITransformService transformService, IValidatorService validatorService, diff --git a/PARR.TemplateActivator/PARR.TemplateActivator.csproj b/PARR.TemplateActivator/PARR.TemplateActivator.csproj index 4d002e29..21190861 100644 --- a/PARR.TemplateActivator/PARR.TemplateActivator.csproj +++ b/PARR.TemplateActivator/PARR.TemplateActivator.csproj @@ -8,7 +8,6 @@ - diff --git a/PARR.TemplateActivator/Services/IValidatorService.cs b/PARR.TemplateActivator/Services/IValidatorService.cs index ef165142..53f56663 100644 --- a/PARR.TemplateActivator/Services/IValidatorService.cs +++ b/PARR.TemplateActivator/Services/IValidatorService.cs @@ -1,4 +1,4 @@ -using PARR.Constants; +using PARR.Domain.Enums; namespace PARR.TemplateActivator; diff --git a/PARR.TemplateActivator/Services/ValidatorService.cs b/PARR.TemplateActivator/Services/ValidatorService.cs index ed8622fc..a7025397 100644 --- a/PARR.TemplateActivator/Services/ValidatorService.cs +++ b/PARR.TemplateActivator/Services/ValidatorService.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Models.Job; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Base; using PARR.DAL.Services.Interfaces.Job; using PARR.Domain.Entities.Base; +using PARR.Domain.Enums; namespace PARR.TemplateActivator; diff --git a/PARR.TemplateActivator/Settings/MqSettings.cs b/PARR.TemplateActivator/Settings/MqSettings.cs index 0183195e..522e3ea9 100644 --- a/PARR.TemplateActivator/Settings/MqSettings.cs +++ b/PARR.TemplateActivator/Settings/MqSettings.cs @@ -1,13 +1,13 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.TemplateActivator; internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } diff --git a/PARR.TemplateActivator/TemplateActivator.cs b/PARR.TemplateActivator/TemplateActivator.cs index 92158251..23e5d10e 100644 --- a/PARR.TemplateActivator/TemplateActivator.cs +++ b/PARR.TemplateActivator/TemplateActivator.cs @@ -1,9 +1,9 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; -using PARR.Constants; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Rabbit.Messages; +using PARR.Domain.Enums; namespace PARR.TemplateActivator; diff --git a/PARR.TemplateDistributor/ITemplateDistributor.cs b/PARR.TemplateDistributor/ITemplateDistributor.cs index e4842544..2fc8862a 100644 --- a/PARR.TemplateDistributor/ITemplateDistributor.cs +++ b/PARR.TemplateDistributor/ITemplateDistributor.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; namespace PARR.TemplateDistributor { diff --git a/PARR.TemplateDistributor/MqTemplateDistributor.cs b/PARR.TemplateDistributor/MqTemplateDistributor.cs index bf0c9211..ed7242ce 100644 --- a/PARR.TemplateDistributor/MqTemplateDistributor.cs +++ b/PARR.TemplateDistributor/MqTemplateDistributor.cs @@ -1,7 +1,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.Common.Rabbit.Messages; using PARR.TemplateDistributor.Services; using PARR.TemplateDistributor.Settings; @@ -10,14 +11,14 @@ namespace PARR.TemplateDistributor internal class MqTemplateDistributor : IMqTemplateDistributor { private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly ILogger logger; private readonly ITransformService transformService; private readonly IValidatorService validatorService; private readonly IServiceProvider serviceProvider; public MqTemplateDistributor(MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, ILogger logger, ITransformService transformService, IValidatorService validatorService, diff --git a/PARR.TemplateDistributor/PARR.TemplateDistributor.csproj b/PARR.TemplateDistributor/PARR.TemplateDistributor.csproj index 4d002e29..21190861 100644 --- a/PARR.TemplateDistributor/PARR.TemplateDistributor.csproj +++ b/PARR.TemplateDistributor/PARR.TemplateDistributor.csproj @@ -8,7 +8,6 @@ - diff --git a/PARR.TemplateDistributor/Settings/MqSettings.cs b/PARR.TemplateDistributor/Settings/MqSettings.cs index 6ae427c7..ec601ac5 100644 --- a/PARR.TemplateDistributor/Settings/MqSettings.cs +++ b/PARR.TemplateDistributor/Settings/MqSettings.cs @@ -1,13 +1,13 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.TemplateDistributor.Settings { internal class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.TemplateDistributor/TemplateDistributor.cs b/PARR.TemplateDistributor/TemplateDistributor.cs index bb947e4e..3f75a4d0 100644 --- a/PARR.TemplateDistributor/TemplateDistributor.cs +++ b/PARR.TemplateDistributor/TemplateDistributor.cs @@ -1,9 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; -using PARR.Constants; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Enums; namespace PARR.TemplateDistributor diff --git a/PARR.TemplateGeneratorWorker/Settings/MqSettings.cs b/PARR.TemplateGeneratorWorker/Settings/MqSettings.cs index 4125436a..1831d15a 100644 --- a/PARR.TemplateGeneratorWorker/Settings/MqSettings.cs +++ b/PARR.TemplateGeneratorWorker/Settings/MqSettings.cs @@ -1,13 +1,13 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.TemplateGeneratorWorker.Settings { public class MqSettings : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs index 0c08c45c..b582d05d 100644 --- a/PARR.TemplateGeneratorWorker/TemplateGenerator.cs +++ b/PARR.TemplateGeneratorWorker/TemplateGenerator.cs @@ -1,12 +1,11 @@ using Microsoft.EntityFrameworkCore; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; -using PARR.Constants; using PARR.DAL.DomainServices.Shortcodes; using PARR.DAL.Models; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities.Base.History; using PARR.Domain.Enums; using PARR.TemplateGeneratorWorker.Services; diff --git a/PARR.TemplateGeneratorWorker/Worker.cs b/PARR.TemplateGeneratorWorker/Worker.cs index e1d40441..06106b21 100644 --- a/PARR.TemplateGeneratorWorker/Worker.cs +++ b/PARR.TemplateGeneratorWorker/Worker.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; using PARR.TemplateGeneratorWorker.Settings; namespace PARR.TemplateGeneratorWorker @@ -7,12 +7,12 @@ namespace PARR.TemplateGeneratorWorker { private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly IServiceProvider serviceProvider; public Worker( MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, IServiceProvider serviceProvider ) { diff --git a/PARR.TemplateMatcher/MqTemplateMatcher.cs b/PARR.TemplateMatcher/MqTemplateMatcher.cs index e1369be5..52333ccb 100644 --- a/PARR.TemplateMatcher/MqTemplateMatcher.cs +++ b/PARR.TemplateMatcher/MqTemplateMatcher.cs @@ -1,8 +1,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.Common.Rabbit.Messages; +using PARR.Domain.Enums; using PARR.TemplateMatcher.Services.Interfaces; using PARR.TemplateMatcher.Settings; @@ -12,14 +13,14 @@ namespace PARR.TemplateMatcher { private readonly ILogger logger; private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly ITransformService transformService; private readonly IServiceProvider serviceProvider; public MqTemplateMatcher( ILogger logger, MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, ITransformService transformService, IServiceProvider serviceProvider ) diff --git a/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs b/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs index 5db25285..d387762d 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/GroupedTemplateSynchronizer.cs @@ -1,8 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Cache.Models; using PARR.DAL.DomainServices.Interfaces; using PARR.DAL.DomainServices.Shortcodes; @@ -12,7 +10,9 @@ using PARR.DAL.Models.Job; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities.Base.History; +using PARR.Domain.Enums; using PARR.TemplateMatcher.Services.Interfaces; using PARR.TemplateMatcher.Settings; @@ -28,7 +28,7 @@ internal class GroupedTemplateSynchronizer : ITemplateSynchronizer private readonly IUnitInValueService unitInValueService; private readonly IUnitService unitService; private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly ITemplateService templateService; private readonly IJobGroupService jobGroupService; private readonly ITemplateReuser templateReuser; @@ -48,7 +48,7 @@ internal class GroupedTemplateSynchronizer : ITemplateSynchronizer IUnitInValueService unitInValueService, IUnitService unitService, MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, ITemplateService templateService, IJobGroupService jobGroupService, ITemplateReuser templateReuser, diff --git a/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs b/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs index 299aafd1..c37fe5d6 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/SimpleTemplateSynchronizer.cs @@ -1,9 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; -using PARR.Constants; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Cache.Models; using PARR.DAL.Contracts; using PARR.DAL.DomainServices.Interfaces; @@ -14,7 +12,9 @@ using PARR.DAL.Models.Job; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities.Base.History; +using PARR.Domain.Enums; using PARR.TemplateMatcher.Services.Interfaces; using PARR.TemplateMatcher.Settings; @@ -32,7 +32,7 @@ internal class SimpleTemplateSynchronizer : ITemplateSynchronizer private readonly ILogger logger; private readonly IUnitFilterService unitFilterService; private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly ITemplateService templateService; private readonly IJobService jobService; private readonly ITemplateReuser templateReuser; @@ -51,7 +51,7 @@ internal class SimpleTemplateSynchronizer : ITemplateSynchronizer IUnitInValueService unitInValueService, IUnitService unitService, MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, ITemplateService templateService, IJobService jobService, ITemplateReuser templateReuser, diff --git a/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs b/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs index e6fd62f7..ef3c33ca 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/TemplateDeactivator.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using PARR.BLL.Domain.Mq; -using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Entities.Base.History; +using PARR.Domain.Enums; using PARR.TemplateMatcher.Services.Interfaces; using PARR.TemplateMatcher.Settings; diff --git a/PARR.TemplateMatcher/Services/Implemetaions/TemplateUpdaterMqSender.cs b/PARR.TemplateMatcher/Services/Implemetaions/TemplateUpdaterMqSender.cs index 04c741bf..54132f12 100644 --- a/PARR.TemplateMatcher/Services/Implemetaions/TemplateUpdaterMqSender.cs +++ b/PARR.TemplateMatcher/Services/Implemetaions/TemplateUpdaterMqSender.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; -using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Common.Rabbit.Messages; using PARR.TemplateMatcher.Services.Interfaces; using PARR.TemplateMatcher.Settings; @@ -11,13 +11,13 @@ namespace PARR.TemplateMatcher.Services.Implementations; internal class TemplateUpdaterMqSender : ITemplateUpdaterMqSender { private readonly ILogger logger; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly MqSettings mqSettings; private readonly ITemplateService templateService; public TemplateUpdaterMqSender( ILogger logger, - IMqService mqService, + IRabbitService mqService, MqSettings mqSettings, ITemplateService templateService ) diff --git a/PARR.TemplateMatcher/Services/Interfaces/ITemplateUpdaterMqSender.cs b/PARR.TemplateMatcher/Services/Interfaces/ITemplateUpdaterMqSender.cs index 98546970..45756145 100644 --- a/PARR.TemplateMatcher/Services/Interfaces/ITemplateUpdaterMqSender.cs +++ b/PARR.TemplateMatcher/Services/Interfaces/ITemplateUpdaterMqSender.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; namespace PARR.TemplateMatcher.Services.Interfaces { diff --git a/PARR.TemplateMatcher/Settings/MqSettings.cs b/PARR.TemplateMatcher/Settings/MqSettings.cs index e6b6422c..5c9729eb 100644 --- a/PARR.TemplateMatcher/Settings/MqSettings.cs +++ b/PARR.TemplateMatcher/Settings/MqSettings.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.TemplateMatcher.Settings { @@ -11,28 +11,28 @@ namespace PARR.TemplateMatcher.Settings internal class TemplateMatcher : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } internal class TemplateGenerator : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } internal class TemplateUpdater : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.TemplateUpdater/Services/ITemplateUpdaterService.cs b/PARR.TemplateUpdater/Services/ITemplateUpdaterService.cs index e06e34bf..554c9a7c 100644 --- a/PARR.TemplateUpdater/Services/ITemplateUpdaterService.cs +++ b/PARR.TemplateUpdater/Services/ITemplateUpdaterService.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Domain.Mq; +using PARR.Domain.Common.Rabbit.Messages; namespace PARR.TemplateUpdater.Services { diff --git a/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs b/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs index c324f324..f6be17c8 100644 --- a/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs +++ b/PARR.TemplateUpdater/Services/TemplateUpdaterService.cs @@ -1,13 +1,12 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; -using PARR.Constants; using PARR.DAL.Extensions; using PARR.DAL.Models; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Job; using PARR.DAL.Services.Interfaces.Unit; +using PARR.Domain.Common.Rabbit.Messages; using PARR.Domain.Enums; namespace PARR.TemplateUpdater.Services diff --git a/PARR.TemplateUpdater/Settings/MqSettings.cs b/PARR.TemplateUpdater/Settings/MqSettings.cs index f611d854..9f3c1603 100644 --- a/PARR.TemplateUpdater/Settings/MqSettings.cs +++ b/PARR.TemplateUpdater/Settings/MqSettings.cs @@ -1,4 +1,4 @@ -using PARR.BLL.Contracts.Interfaces; +using PARR.Domain.Settings; namespace PARR.TemplateUpdater.Settings { @@ -9,10 +9,10 @@ namespace PARR.TemplateUpdater.Settings internal class TemplatesUpdaterMq : IMqSettings { - public string HostName { get; set; } = string.Empty; - public string QueueName { get; set; } = string.Empty; - public string User { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ushort? PrefetchCount { get; set; } = 0; + public string HostName { get; init; } = string.Empty; + public string QueueName { get; init; } = string.Empty; + public string User { get; init; } = string.Empty; + public string Password { get; init; } = string.Empty; + public ushort? PrefetchCount { get; init; } = 0; } } diff --git a/PARR.TemplateUpdater/TemplateUpdater.cs b/PARR.TemplateUpdater/TemplateUpdater.cs index 2f09e9da..08cf7a1e 100644 --- a/PARR.TemplateUpdater/TemplateUpdater.cs +++ b/PARR.TemplateUpdater/TemplateUpdater.cs @@ -1,7 +1,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using PARR.BLL.Domain.Mq; using PARR.BLL.Services.Interfaces; +using PARR.Core.Common.RabbitServices; +using PARR.Domain.Common.Rabbit.Messages; using PARR.TemplateUpdater.Services; using PARR.TemplateUpdater.Settings; @@ -10,14 +11,14 @@ namespace PARR.TemplateUpdater internal class TemplateUpdater : ITemplateUpdater { private readonly MqSettings mqSettings; - private readonly IMqService mqService; + private readonly IRabbitService mqService; private readonly ILogger logger; private readonly IServiceProvider serviceProvider; private readonly ITransformService transformService; public TemplateUpdater( MqSettings mqSettings, - IMqService mqService, + IRabbitService mqService, ILogger logger, IServiceProvider serviceProvider, ITransformService transformService diff --git a/PARR.Test/Worker.cs b/PARR.Test/Worker.cs index b10ef5c2..feaa09c8 100644 --- a/PARR.Test/Worker.cs +++ b/PARR.Test/Worker.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using PARR.BLL.Services.Interfaces; -using PARR.Constants; using PARR.DAL.DomainServices.Interfaces; using PARR.DAL.Services.Interfaces; +using PARR.Domain.Enums; using PARR.EsppApi; using PARR.EsppApi.Constants; using PARR.EsppApi.Models.Query;