Skip to content

Conversation

@hyotatoFrappuccino
Copy link
Collaborator

@hyotatoFrappuccino hyotatoFrappuccino commented Aug 28, 2025

Resolved Issue

PR Description

  • API 조회 시 페이징 기능을 추가하였습니다.
  • 목적 : 다건 조회 시 서버 부하 방지
  • 기본 페이지 사이즈 : 20 (spring.data.web.pageable.default-page-size 기본값)
  • 최대 페이지 사이즈 : 2000 (spring.data.web.pageable.max-page-size 기본값) -> 일단 기본값으로 두었습니다.

적용 API

  • /api/v1/application-forms
  • /api/v1/documents
  • /api/v1/documents/{documentId}
  • /api/v1/schedules

요청 파라미터 추가

  • page(조회할 페이지 번호), size(한 페이지에 포함될 항목 수), sort(정렬 기준 (property,(asc|desc)). 기본은 오름차순. 여러 기준 가능.)
  • ex. /api/v1/application-forms?page=1&size=10&sort=name,desc

기존 응답

{
  "code": "2000",
  "message": "요청이 성공적으로 처리되었습니다.",
  "data": {
    "applicationForms": [
      {
        "id": 0,
        "companyName": "네이버",
        "...": "...",
        "status": "PLANNED",
      }
    ]
  }
}

페이징 기능 도입 후 응답

{
  "code": "2000",
  "message": "요청이 성공적으로 처리되었습니다.",
  "data": {
    "totalElements": 0,
    "totalPages": 0,
    "size": 0,
    "content": [
      {
        "id": 0,
        "companyName": "네이버",
        "...": "...",
        "status": "PLANNED"
      }
    ],
    "number": 0,
    "sort": {
      "empty": true,
      "sorted": true,
      "unsorted": true
    },
    "first": true,
    "last": true,
    "numberOfElements": 0,
    "pageable": {
      "offset": 0,
      "sort": {
        "empty": true,
        "sorted": true,
        "unsorted": true
      },
      "paged": true,
      "pageNumber": 0,
      "pageSize": 0,
      "unpaged": true
    },
    "empty": true
  }
}

Copy link
Collaborator

@gnsdp99 gnsdp99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

@hyotatoFrappuccino hyotatoFrappuccino merged commit 31bc15d into dev Aug 29, 2025
3 checks passed
@hyotatoFrappuccino hyotatoFrappuccino deleted the feat/#65 branch August 29, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 페이징 기능 추가

3 participants