fix(api): заполнение данных о пользователе в кэше
This commit is contained in:
@@ -66,11 +66,19 @@ namespace PARR.API.Services.Implementations
|
|||||||
var cacheData = new UserCache
|
var cacheData = new UserCache
|
||||||
{
|
{
|
||||||
UserIp = ipAddress,
|
UserIp = ipAddress,
|
||||||
Roles = roles,
|
Roles = roles
|
||||||
Name = user!.Name,
|
|
||||||
Description = user.Description ?? string.Empty
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (host != null)
|
||||||
|
cacheData.Name = host.Ek;
|
||||||
|
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
|
cacheData.Name = user.Name + host != null ? $", {host!.Ek}" : string.Empty;
|
||||||
|
cacheData.Description = user.Description ?? string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await cacheService.SetCachedDataAsync(GetAllowKey(ipAddress), cacheData, userCacheSettings.UserCacheTtl);
|
await cacheService.SetCachedDataAsync(GetAllowKey(ipAddress), cacheData, userCacheSettings.UserCacheTtl);
|
||||||
|
|
||||||
return cacheData;
|
return cacheData;
|
||||||
|
|||||||
Reference in New Issue
Block a user