|
16 | 16 | - [ICS Files](#ics-files) |
17 | 17 | - [Get All Available ICS Files](#get-all-available-ics-files) |
18 | 18 | - [Get ICS File](#get-ics-file) |
| 19 | +- [Memes](#memes) |
| 20 | + - [Get Memes (Paginated)](#get-memes-paginated) |
19 | 21 |
|
20 | 22 | --- |
21 | 23 |
|
@@ -583,6 +585,58 @@ File does not exist |
583 | 585 |
|
584 | 586 | --- |
585 | 587 |
|
| 588 | +## Memes |
| 589 | + |
| 590 | +### Get Memes (Paginated) |
| 591 | + |
| 592 | +**Endpoint:** `GET /api/v1/memes/{page}` |
| 593 | + |
| 594 | +**Description:** Retrieves a paginated list of memes. |
| 595 | + |
| 596 | +**Authentication:** Required (via AuthMiddleware) |
| 597 | + |
| 598 | +**Path Parameters:** |
| 599 | +- `page` (integer, required): The page number to retrieve. |
| 600 | + |
| 601 | +**Request:** |
| 602 | +```http |
| 603 | +GET /api/v1/memes/1 |
| 604 | +``` |
| 605 | + |
| 606 | +**Response:** |
| 607 | + |
| 608 | +Success (200 OK): |
| 609 | +```json |
| 610 | +{ |
| 611 | + "totalPages": 10, |
| 612 | + "hasNext": true, |
| 613 | + "hasPrev": false, |
| 614 | + "memeList": [ |
| 615 | + { |
| 616 | + "id": "meme-id-123", |
| 617 | + "imageUrl": "https://example.com/meme.jpg", |
| 618 | + "altText": "A funny meme", |
| 619 | + "imageB64": "base64_encoded_image_string", |
| 620 | + "title": "My Awesome Meme", |
| 621 | + "permalink": "https://example.com/meme-id-123", |
| 622 | + "likes": "100", |
| 623 | + "timeStamp": "2024-01-01T12:00:00Z", |
| 624 | + "user": "MemeLord", |
| 625 | + "tags": ["funny", "dev"], |
| 626 | + "comments": ["First comment", "lol"] |
| 627 | + } |
| 628 | + ] |
| 629 | +} |
| 630 | +``` |
| 631 | + |
| 632 | +Error (400 Bad Request): |
| 633 | +``` |
| 634 | +Internal Server Error |
| 635 | +``` |
| 636 | +(Note: The error message is generic, but it's returned for invalid page parameters) |
| 637 | + |
| 638 | +--- |
| 639 | + |
586 | 640 | ## Data Models |
587 | 641 |
|
588 | 642 | ### Post Object |
@@ -628,6 +682,33 @@ File does not exist |
628 | 682 | } |
629 | 683 | ``` |
630 | 684 |
|
| 685 | +### Meme Object |
| 686 | +```json |
| 687 | +{ |
| 688 | + "id": "string", |
| 689 | + "imageUrl": "string", |
| 690 | + "altText": "string", |
| 691 | + "imageB64": "string (Base64)", |
| 692 | + "title": "string", |
| 693 | + "permalink": "string", |
| 694 | + "likes": "string", |
| 695 | + "timeStamp": "string", |
| 696 | + "user": "string", |
| 697 | + "tags": ["string"], |
| 698 | + "comments": ["string"] |
| 699 | +} |
| 700 | +``` |
| 701 | + |
| 702 | +### MemeResponse Object |
| 703 | +```json |
| 704 | +{ |
| 705 | + "totalPages": "integer", |
| 706 | + "hasNext": "boolean", |
| 707 | + "hasPrev": "boolean", |
| 708 | + "memeList": [Meme] |
| 709 | +} |
| 710 | +``` |
| 711 | + |
631 | 712 | --- |
632 | 713 |
|
633 | 714 | ## Validation Rules |
@@ -711,5 +792,6 @@ For validation errors: |
711 | 792 | | GET | `/api/v1/users/{creatorId}/posts` | Get posts by creator | |
712 | 793 | | PATCH | `/api/v1/users/{creatorId}/{postId}` | Update post | |
713 | 794 | | DELETE | `/api/v1/users/{creatorId}/{postId}` | Delete post | |
| 795 | +| GET | `/api/v1/memes/{page}` | Get memes (paginated) | |
714 | 796 | | GET | `/api/v1/ics` | Get all available ICS file names | |
715 | 797 | | GET | `/api/v1/ics/{fileName}` | Download specific ICS file | |
0 commit comments