知识卡片
游标分页的输入输出
首请求省略 cursor,服务限制单页大小并返回 items 与下一页 cursor。下一次复用相同筛选和排序,把 cursor 原样传入。约定空页和终止信号,PetSitter 的方案用末页 cursor 为 null。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Scaling collection endpoints with filters and pagination 17.5 Pagination for PetSitter · 查看原书依据
Eventually, Nidhi and Max decide to use cursor-based pagination for PetSitter. To recap, for cursor-based pagination, we need at least the following:
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第17章《Scaling collection endpoints with filters and pagination》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch17.htm,阅读块 245)
- 结论依据:原文列默认页大小、返回值与下一次请求的对应关系。
- 原始内容:Eventually, Nidhi and Max decide to use cursor-based pagination for PetSitter. To recap, for cursor-based pagination, we need at least the following: