Skip to content

[Feature] Add pagination to list endpoints #9

Description

@lechan775

Problem

以下端点一次性返回全部数据,数据量大时性能堪忧:

  • GET /api/notebook-words
  • GET /api/wrong-words
  • GET /api/study-records
  • GET /api/words

Proposed Solution

添加分页参数并返回标准化分页响应:

GET /api/notebook-words?userId=1&page=1&size=20

Response:
{
  "code": 200,
  "data": {
    "content": [...],
    "page": 1,
    "size": 20,
    "totalElements": 156,
    "totalPages": 8
  }
}

后端 MyBatis 使用 LIMIT #{offset}, #{size} + COUNT(*) 实现。
前端列表添加下拉加载更多。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions