From 7ddc8b1bed1c8452efac72e1f0ea1b2b85f24780 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Wed, 29 Apr 2026 14:27:02 +1000 Subject: [PATCH] =?UTF-8?q?feat(core):=20=D0=97=D0=B0=D0=B3=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=B0=20WorkloadCacheService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implementations/WorkloadCacheService.cs | 53 +++++++++++++++++++ .../IWorkloadCacheBuilderService.cs | 3 ++ 2 files changed, 56 insertions(+) create mode 100644 PARR.Core/Services/Workload/Implementations/WorkloadCacheService.cs diff --git a/PARR.Core/Services/Workload/Implementations/WorkloadCacheService.cs b/PARR.Core/Services/Workload/Implementations/WorkloadCacheService.cs new file mode 100644 index 00000000..61d7dc95 --- /dev/null +++ b/PARR.Core/Services/Workload/Implementations/WorkloadCacheService.cs @@ -0,0 +1,53 @@ +using Microsoft.Extensions.Logging; +using PARR.Core.Common.Interfaces; + +namespace PARR.Core.Services.Workload.Implementations +{ + /// + /// Класс управления КЭШем для workload + /// + internal class WorkloadCacheService + { + private readonly ILogger logger; + private readonly IRedisCacheService redisCacheService; + + public WorkloadCacheService( + ILogger logger, + IRedisCacheService redisCacheService + //IShortcodeService + ) + { + this.logger = logger; + this.redisCacheService = redisCacheService; + } + + + /// + /// Создать КЭШ шаблонов. + /// КЭШ рабочих групп и зон ответственности + /// + /// + public async System.Threading.Tasks.Task CreateTemplateCacheAsync() + { + await DeleteTemplateCacheAsync(); + + //1. Получить из БД все шаблоны - НЕТ РЕПЫ + //2. Получить по каждому шаблону ЗО и РГ + //3. Сохранить в Redis + + //redisCacheService + } + + /// + /// Удалить КЭШ шаблонов. + /// + /// + private async System.Threading.Tasks.Task DeleteTemplateCacheAsync() + { + + } + + + + } +} diff --git a/PARR.Core/Services/Workload/Interfaces/IWorkloadCacheBuilderService.cs b/PARR.Core/Services/Workload/Interfaces/IWorkloadCacheBuilderService.cs index 0d658045..5b0e2e02 100644 --- a/PARR.Core/Services/Workload/Interfaces/IWorkloadCacheBuilderService.cs +++ b/PARR.Core/Services/Workload/Interfaces/IWorkloadCacheBuilderService.cs @@ -2,6 +2,9 @@ namespace PARR.Core.Services.Workload.Interfaces { + /// + /// Вызывается в воркере, формирование КЭШ для workload + /// public interface IWorkloadCacheBuilderService : IMessageConsumer {