Skip to content

Commit

Permalink
fix: issue of abnormal sorting in the aggregation query interface (ha…
Browse files Browse the repository at this point in the history
…lo-dev#2623)

#### What type of PR is this?

/kind bug
/milestone 2.0

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

修复文章、自定义页面、评论聚合查询接口排序不固定的问题。

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

Fixes halo-dev#2622

#### Special notes for your reviewer:

测试方式:检查 Console 端的文章、自定义页面、评论、回复的排序是否正常,需要多次刷新检查。

```release-note
修复文章、自定义页面、评论聚合查询接口排序不固定的问题。
```
  • Loading branch information
ruibaby committed Oct 25, 2022
1 parent d2aa707 commit 95f0809
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public Mono<ListResult<ListedComment>> listComment(CommentQuery commentQuery) {
commentQuery.getPage(), commentQuery.getSize())
.flatMap(comments -> Flux.fromStream(comments.get()
.map(this::toListedComment))
.flatMap(Function.identity())
.concatMap(Function.identity())
.collectList()
.map(list -> new ListResult<>(comments.getPage(), comments.getSize(),
comments.getTotal(), list)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Mono<ListResult<ListedReply>> list(ReplyQuery query) {
query.getPage(), query.getSize())
.flatMap(list -> Flux.fromStream(list.get()
.map(this::toListedReply))
.flatMap(Function.identity())
.concatMap(Function.identity())
.collectList()
.map(listedReplies -> new ListResult<>(list.getPage(), list.getSize(),
list.getTotal(), listedReplies))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Mono<ListResult<ListedPost>> listPost(PostQuery query) {
.flatMap(listResult -> Flux.fromStream(
listResult.get().map(this::getListedPost)
)
.flatMap(Function.identity())
.concatMap(Function.identity())
.collectList()
.map(listedPosts -> new ListResult<>(listResult.getPage(), listResult.getSize(),
listResult.getTotal(), listedPosts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Mono<ListResult<ListedSinglePage>> list(SinglePageQuery query) {
.flatMap(listResult -> Flux.fromStream(
listResult.get().map(this::getListedSinglePage)
)
.flatMap(Function.identity())
.concatMap(Function.identity())
.collectList()
.map(listedSinglePages -> new ListResult<>(listResult.getPage(),
listResult.getSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ListResult<CommentVo> list(Ref ref, Integer page, Integer size) {
defaultComparator(),
pageNullSafe(page), sizeNullSafe(size))
.flatMap(list -> Flux.fromStream(list.get().map(this::toCommentVo))
.flatMap(Function.identity())
.concatMap(Function.identity())
.collectList()
.map(commentVos -> new ListResult<>(list.getPage(), list.getSize(), list.getTotal(),
commentVos)
Expand All @@ -68,7 +68,7 @@ public ListResult<ReplyVo> listReply(String commentName, Integer page, Integer s
&& Objects.equals(true, reply.getSpec().getApproved()),
comparator.reversed(), pageNullSafe(page), sizeNullSafe(size))
.flatMap(list -> Flux.fromStream(list.get().map(this::toReplyVo))
.flatMap(Function.identity())
.concatMap(Function.identity())
.collectList()
.map(replyVos -> new ListResult<>(list.getPage(), list.getSize(), list.getTotal(),
replyVos))
Expand Down

0 comments on commit 95f0809

Please sign in to comment.