key | type | default | required | description |
---|---|---|---|---|
item_total | int | 총 data 개수 (모든 페이지) | ||
page_total | int | 총 page 수 | ||
current_page | int | 현재 page | ||
next_link | URL | 다음 page를 불러올 수 있는 API link | ||
prev_link | URL | 이전 page를 불러올 수 있는 API link | ||
first_link | URL | 첫 page를 불러올 수 있는 API link |
key | type | default | required | description |
---|---|---|---|---|
page_size | int | 20 | data를 몇 개씩 나눠서 pagination 할 지 정함 all 을 넣으면 한 page에 모든 데이터를 보내줌 | |
page | int | 1 | 몇 번째 page를 불러올지 정함 | |
q | char | 검색어 필터 (어떤 값을 검색할지는 API 별로 다를 수 있음 |
sort
input sample
output sample
{
"pagination": {
"item_total": 10,
"page_total": 5,
"current_page": 1,
"next_link": "<http://localhost:8000/api/things/files/?page=2&page_size=2&q=shield&sort=earliest>",
"prev_link": null,
"first_link": null
},
"data": [
{
"id": 10,
"file": "<http://localhost:8000/upload/files/shield_nlMSPfQ.png>",
"filename": "shield.png",
"content_type": "image/png",
"size": 48248,
"created_at": "2023-09-13T09:13:29+0900"
},
{
"id": 9,
"file": "<http://localhost:8000/upload/files/shield_rm2k1jP.png>",
"filename": "shield.png",
"content_type": "image/png",
"size": 48248,
"created_at": "2023-09-13T09:13:28+0900"
}
]
}
{
"pagination": {
"item_total": 10,
"page_total": 5,
"current_page": 1,
"next_link": "<http://localhost:8000/api/things/files/?page=2&page_size=2&sort=earliest>",
"prev_link": null,
"first_link": null
},
"filter": {
"content_type": [
"image/png",
"image/gif"
]
},
"data": [
{
"id": 10,
"file": "<http://localhost:8000/upload/files/shield_nlMSPfQ.png>",
"filename": "shield.png",
"content_type": "image/png",
"size": 48248,
"created_at": "2023-09-13T09:13:29+0900"
},
{
"id": 9,
"file": "<http://localhost:8000/upload/files/shield_rm2k1jP.gif>",
"filename": "shield.gif",
"content_type": "image/gif",
"size": 48248,
"created_at": "2023-09-13T09:13:28+0900"
}
]
}