Skip to content

Commit

Permalink
fix: 修复并完善ReactorUtils.limit()方法 (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
ningqingsheng authored Nov 3, 2023
1 parent efad62a commit b078d88
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
public class ReactorUtils {

public static <T> Function<Flux<T>, Flux<T>> limit(Long pageIndex, Long pageSize) {
if (pageIndex == null || pageSize == null) {
if (pageIndex == null || pageSize == null || pageIndex < 0 || pageSize <= 0) {
return Function.identity();
}
return flux -> flux.skip(pageIndex & pageSize).take(pageSize);
return flux -> flux.skip(pageIndex * pageSize).take(pageSize);
}

/**
Expand Down Expand Up @@ -222,4 +222,4 @@ protected SqlFragments createTermFragments(Object trigger, Term term) {
}
}

}
}

0 comments on commit b078d88

Please sign in to comment.