Fix perf with cache

This commit is contained in:
2025-10-10 03:42:57 +07:00
parent bdda24cb60
commit b6b11be33a
13 changed files with 1646 additions and 32 deletions

View File

@@ -129,7 +129,27 @@ public static class PostgreSqlMappers
AgentName = entity.AgentName,
AvatarUrl = entity.AvatarUrl,
TelegramChannel = entity.TelegramChannel,
Id = entity.Id // Assuming Id is the primary key for UserEntity
Id = entity.Id, // Assuming Id is the primary key for UserEntity
Accounts = entity.Accounts?.Select(MapAccountWithoutUser).ToList() ?? new List<Account>()
};
}
// Helper method to map AccountEntity without User to avoid circular reference
private static Account MapAccountWithoutUser(AccountEntity entity)
{
if (entity == null) return null;
return new Account
{
Id = entity.Id,
Name = entity.Name,
Exchange = entity.Exchange,
Type = entity.Type,
Key = entity.Key,
Secret = entity.Secret,
User = null, // Don't map User to avoid circular reference
Balances = new List<Balance>(), // Empty list for now, balances handled separately if needed
IsGmxInitialized = entity.IsGmxInitialized
};
}