chore: 🔨 用户管理-角色排序 (#212)

[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
2024-11-22 12:11:10 +08:00
committed by GitHub
parent 69dc407002
commit 6d87d8e9cd
2 changed files with 18 additions and 16 deletions

View File

@ -240,7 +240,9 @@ public sealed class UserService(
.Count(out var total)
.ToListAsync(listUserExp)
.ConfigureAwait(false);
return new PagedQueryRsp<QueryUserRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryUserRsp>>());
return new PagedQueryRsp<QueryUserRsp>(req.Page, req.PageSize, total
, list.Select(x => x with { Roles = x.Roles.OrderBy(y => y.Sort).ThenBy(y => y.Id).ToList() })
.Adapt<IEnumerable<QueryUserRsp>>());
}
/// <inheritdoc />