perf: 优化等级处理

This commit is contained in:
橙子
2024-12-08 03:43:04 +08:00
parent 3932b24fda
commit 6be5398114
4 changed files with 20 additions and 8 deletions

View File

@@ -110,7 +110,9 @@ namespace Yi.Framework.Bbs.Application.Services.Analyses
)
.ToPageListAsync(pageIndex, input.MaxResultCount, total);
output.ForEach(x => { x.LevelName = _bbsUserManager._levelCacheDic[x.Level].Name; });
var levelCache = await _bbsUserManager.GetLevelCacheMapAsync();
output.ForEach(x => { x.LevelName = levelCache[x.Level].Name; });
return new PagedResultDto<MoneyTopUserDto>
{
Items = output,