промежуточный коммит
Tests / frontend-test (pull_request) Successful in 47s
Tests / backend-test (pull_request) Successful in 1m34s

This commit is contained in:
gorbenko.pavel
2026-08-26 17:17:47 +05:00
parent 19a46b0df8
commit 874e41990c
12 changed files with 640 additions and 3 deletions
@@ -27,11 +27,21 @@ public sealed class CachingTnsuPortalClient(HttpTnsuPortalClient inner, IMemoryC
$"emp:position:{position.ToLowerInvariant()}|{company.ToLowerInvariant()}",
() => inner.GetEmployeeByPositionAsync(position, company, cancellationToken));
public Task<IReadOnlyList<EmployeeContactInfo>> GetAllEmployeesAsync(CancellationToken cancellationToken) =>
GetOrAddAsync("emp:all", () => inner.GetAllEmployeesAsync(cancellationToken));
public Task<string?> GetManagerAsync(string email, string managerType, CancellationToken cancellationToken) =>
GetOrAddAsync(
$"mgr:{email.ToLowerInvariant()}|{managerType.ToLowerInvariant()}",
() => inner.GetManagerAsync(email, managerType, cancellationToken));
// Базы целиком (/Employee/All выше и /Employee/FullBase ниже) кешируем по
// фиксированному ключу — это не запросы «по чему-то», а единственные на весь
// процесс снимки справочника; TTL тот же (5 минут), что и у остальных
// обращений к api.tnsu.kz.
public Task<IReadOnlyList<EmployeeFullBaseInfo>> GetFullBaseAsync(CancellationToken cancellationToken) =>
GetOrAddAsync("emp:fullbase", () => inner.GetFullBaseAsync(cancellationToken));
public Task<IReadOnlyList<ProjectExecutorInfo>> GetProjectExecutorsAsync(Guid projectId, CancellationToken cancellationToken) =>
GetOrAddAsync(
$"projexec:{projectId}",