Fix the problem of listing users with unstable result (#3635)

#### What type of PR is this?

/kind bug
/area core

#### What this PR does / why we need it:

Use concatMap instead of flatMap to ensure stable result. 

Please see the differences between flatMap and concatMap from links below:

- https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#flatMap-java.util.function.Function-
- https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#concatMap-java.util.function.Function-

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/3555

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
修复用户列表排序不稳定问题
```
pull/3625/head^2
John Niang 2023-03-30 11:00:18 +08:00 committed by GitHub
parent af2b946a56
commit 29f3c25a44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -397,7 +397,7 @@ public class UserEndpoint implements CustomEndpoint {
private Mono<ListResult<ListedUser>> toListedUser(ListResult<User> listResult) {
return Flux.fromStream(listResult.get())
.flatMap(user -> {
.concatMap(user -> {
Set<String> roleNames = roleNames(user);
return roleService.list(roleNames)
.collectList()