?page=2&limit=2)API trả dữ liệu theo trang: GET /items?page=<p>&limit=<l>. Trang đánh số từ 1. Bỏ qua (p-1)*l bản ghi đầu, lấy tối đa l bản ghi tiếp theo (theo id tăng dần).
Lệnh: CREATE <name>, PAGE <p> <l>.
Input:
CREATE a
CREATE b
CREATE c
PAGE 2 2
Output:
{"status":200,"page":2,"limit":2,"items":[{"id":3,"name":"c"}]}
Mỗi dòng CREATE <name> hoặc PAGE <p> <l>.
1 ≤ p, l. Số lệnh ≤ 300.
Với PAGE in {"status":200,"page":<p>,"limit":<l>,"items":[...]}.
Ví dụ:
Đầu vào:
CREATE a
CREATE b
CREATE c
PAGE 2 2
Đầu ra:
{"status":200,"page":2,"limit":2,"items":[{"id":3,"name":"c"}]}Giải thích:
Đang tải editor...