Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

分页接口抛出异常时可能会影响正常接口的查询 #1

Cat7373 opened this issue Mar 21, 2019 · 0 comments


None yet
1 participant
Copy link

commented Mar 21, 2019


public Result<List<User>> list() {
    // 一些判断
    if (...) {
        // 抛出异常(或只是返回一个失败的结果)
        throw new RuntimeException("您无权进行查询");

    // 真实的查询,并将其包装成 Result 后返回
    return Result.success(this.userService.listAll());

在第一个 if 条件成立时,查询并不会真正的执行,分页设置自然也没有被消耗掉,而当这个线程下次处理其他接口时,这个接口没有被消耗的分页就会被应用到后续的查询当中,从而影响后续的查询


@Cat7373 Cat7373 closed this in 0150594 Mar 21, 2019

Cat7373 added a commit that referenced this issue Mar 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.