mirror of https://github.com/halo-dev/halo
fix: paginated data queries by expand (#5746)
#### What type of PR is this? /kind bug /area core /milestone 2.15.x #### What this PR does / why we need it: 修复分页遍历数据的查询参数 此问题由 #5504 和 #5656 重构导致,如果数据超过分页限制会导致无法结束的致命问题 #### Does this PR introduce a user-facing change? ```release-note None ```pull/5755/head
parent
571df5f865
commit
36b63d6b3c
|
@ -152,7 +152,7 @@ public class CommentServiceImpl implements CommentService {
|
|||
Sort.by("metadata.creationTimestamp", "metadata.name"));
|
||||
return Flux.defer(() -> listCommentsByRef(subjectRef, pageRequest))
|
||||
.expand(page -> page.hasNext()
|
||||
? listCommentsByRef(subjectRef, pageRequest)
|
||||
? listCommentsByRef(subjectRef, pageRequest.next())
|
||||
: Mono.empty()
|
||||
)
|
||||
.flatMap(page -> Flux.fromIterable(page.getItems()))
|
||||
|
|
|
@ -123,7 +123,7 @@ public class ReplyServiceImpl implements ReplyService {
|
|||
Sort.by("metadata.creationTimestamp", "metadata.name"));
|
||||
return Flux.defer(() -> listRepliesByComment(commentName, pageRequest))
|
||||
.expand(page -> page.hasNext()
|
||||
? listRepliesByComment(commentName, pageRequest)
|
||||
? listRepliesByComment(commentName, pageRequest.next())
|
||||
: Mono.empty()
|
||||
)
|
||||
.flatMap(page -> Flux.fromIterable(page.getItems()))
|
||||
|
|
|
@ -98,7 +98,7 @@ public class DefaultNotificationCenter implements NotificationCenter {
|
|||
Sort.by("metadata.creationTimestamp", "metadata.name"));
|
||||
return Flux.defer(() -> pageSubscriptionBy(subscriber, pageRequest))
|
||||
.expand(page -> page.hasNext()
|
||||
? pageSubscriptionBy(subscriber, pageRequest)
|
||||
? pageSubscriptionBy(subscriber, pageRequest.next())
|
||||
: Mono.empty()
|
||||
)
|
||||
.flatMap(page -> Flux.fromIterable(page.getItems()))
|
||||
|
|
Loading…
Reference in New Issue