feat: Сервисы и модели RabbitMq разнесены согласно архитектуры

This commit is contained in:
Mikhail Trubnikov
2026-04-14 12:01:49 +10:00
parent 734c2e3c99
commit e892aa12d3
196 changed files with 589 additions and 1232 deletions

View File

@@ -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<IJobAutoControlService>();
var mqService = scope.ServiceProvider.GetService<IMqService>();
var mqService = scope.ServiceProvider.GetService<IRabbitService>();
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
{