feat(api,core,domain): Ключи для редис

This commit is contained in:
Mikhail Trubnikov
2026-05-28 15:50:14 +10:00
parent 04237cc826
commit 613d4cb4f4
12 changed files with 251 additions and 149 deletions

View File

@@ -6,6 +6,7 @@ using PARR.API.Settings;
using PARR.Core.Common.Interfaces;
using PARR.Core.Repositories.Interfaces;
using PARR.Core.Repositories.Interfaces.Unit;
using PARR.Domain.Cache;
using PARR.Domain.Common.Roles;
using PARR.Domain.Settings;
@@ -162,13 +163,15 @@ namespace PARR.API.Services.Implementations
private string GetBlockKey(string ipAddress)
{
// d - deny
return $"d_{ipAddress}";
//return $"d_{ipAddress}";
return cacheService.GetKey(CacheKeys.UserAuth.Banned(ipAddress));
}
private string GetAllowKey(string ipAddress)
{
// a - allow
return $"a_{ipAddress}";
//return $"a_{ipAddress}";
return cacheService.GetKey(CacheKeys.UserAuth.Session(ipAddress));
}