|
| 1 | +## 🌐 API Description |
| 2 | + |
| 3 | +#### `GET /communities` |
| 4 | + |
| 5 | +Retrieves a list of communities. Supports optional filtering and pagination. |
| 6 | + |
| 7 | +**Query Parameters**: |
| 8 | +- `name` (string, optional): Filter communities by name. |
| 9 | +- `offset` (int32, optional): Number of items to skip (for pagination). |
| 10 | +- `limit` (int32, optional): Maximum number of communities to return. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +#### `POST /communities` |
| 15 | + |
| 16 | +Creates a new community with the given name. |
| 17 | + |
| 18 | +**Request Body** (JSON): |
| 19 | +- `name` (string): Name of the new community. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +#### `GET /communities/{id}` |
| 24 | + |
| 25 | +Retrieves details of a specific community by ID. |
| 26 | + |
| 27 | +**Path Parameters**: |
| 28 | +- `id` (string, required): ID of the community. |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +#### `DELETE /communities/{id}` |
| 33 | + |
| 34 | +Deletes a community by ID. |
| 35 | + |
| 36 | +**Path Parameters**: |
| 37 | +- `id` (string, required): ID of the community. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +#### `PATCH /communities/{id}` |
| 42 | + |
| 43 | +Updates a community's name or thread count offset. |
| 44 | + |
| 45 | +**Path Parameters**: |
| 46 | +- `id` (string, required): ID of the community. |
| 47 | + |
| 48 | +**Request Body** (JSON): |
| 49 | +- `name` (string, optional): New name of the community. |
| 50 | +- `numThreadsOffset` (int32, optional): Change in number of threads. |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +#### `GET /threads` |
| 55 | + |
| 56 | +Retrieves a list of threads. Supports filtering and pagination. |
| 57 | + |
| 58 | +**Query Parameters**: |
| 59 | +- `communityId` (string, optional): Filter threads by community ID. |
| 60 | +- `title` (string, optional): Filter threads by title. |
| 61 | +- `offset` (int32, optional): Number of items to skip. |
| 62 | +- `limit` (int32, optional): Maximum number of threads to return. |
| 63 | +- `sortBy` (string, optional): Sorting criteria. |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +#### `POST /threads` |
| 68 | + |
| 69 | +Creates a new thread. |
| 70 | + |
| 71 | +**Request Body** (JSON): |
| 72 | +- `communityId` (string): ID of the community the thread belongs to. |
| 73 | +- `title` (string): Title of the thread. |
| 74 | +- `content` (string): Content of the thread. |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +#### `GET /threads/{id}` |
| 79 | + |
| 80 | +Retrieves details of a specific thread by ID. |
| 81 | + |
| 82 | +**Path Parameters**: |
| 83 | +- `id` (string, required): ID of the thread. |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +#### `DELETE /threads/{id}` |
| 88 | + |
| 89 | +Deletes a thread by ID. |
| 90 | + |
| 91 | +**Path Parameters**: |
| 92 | +- `id` (string, required): ID of the thread. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +#### `PATCH /threads/{id}` |
| 97 | + |
| 98 | +Updates fields of a thread. |
| 99 | + |
| 100 | +**Path Parameters**: |
| 101 | +- `id` (string, required): ID of the thread. |
| 102 | + |
| 103 | +**Request Body** (JSON): |
| 104 | +- `title` (string, optional): New title. |
| 105 | +- `content` (string, optional): New content. |
| 106 | +- `voteOffset` (int32, optional): Change in up/down votes. |
| 107 | +- `numCommentsOffset` (int32, optional): Change in number of comments. |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +#### `GET /comments` |
| 112 | + |
| 113 | +Retrieve a list of comments filtered by optional query parameters. |
| 114 | + |
| 115 | +**Query Parameters:** |
| 116 | + |
| 117 | +- `threadId` (string, optional): Filter comments by thread ID. |
| 118 | +- `offset` (integer, optional): Pagination offset. |
| 119 | +- `limit` (integer, optional): Pagination limit. |
| 120 | +- `sortBy` (string, optional): Sort order or field. |
| 121 | + |
| 122 | +--- |
| 123 | + |
| 124 | +#### `POST /comments` |
| 125 | + |
| 126 | +Create a new comment. |
| 127 | + |
| 128 | +**Request Body** (JSON): |
| 129 | + |
| 130 | +- `content` (string): The text content of the comment. |
| 131 | +- `parentId` (string, optional): The ID of the parent comment or thread. |
| 132 | +- `parentType` (enum: `THREAD`, `COMMENT`): Type of the parent entity. |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +#### `GET /comments/{id}` |
| 137 | + |
| 138 | +Retrieve a specific comment by its ID. |
| 139 | + |
| 140 | +**Path Parameters:** |
| 141 | + |
| 142 | +- `id` (string, required): The comment ID. |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +#### `DELETE /comments/{id}` |
| 147 | + |
| 148 | +Delete a specific comment by its ID. |
| 149 | + |
| 150 | +**Path Parameters:** |
| 151 | + |
| 152 | +- `id` (string, required): The comment ID. |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +#### `PATCH /comments/{id}` |
| 157 | + |
| 158 | +Update fields of a specific comment. |
| 159 | + |
| 160 | +**Path Parameters:** |
| 161 | + |
| 162 | +- `id` (string, required): The comment ID. |
| 163 | + |
| 164 | +**Request Body:** |
| 165 | + |
| 166 | +- `content` (string, optional): New content for the comment. |
| 167 | +- `voteOffset` (integer, optional): Change in up/down votes. |
| 168 | +- `numCommentsOffset` (integer, optional): Change in number of comments. |
| 169 | + |
| 170 | +--- |
| 171 | + |
| 172 | +#### `POST /votes/comment/{commentId}/down` |
| 173 | + |
| 174 | +Downvote a comment by its ID. |
| 175 | + |
| 176 | +**Path Parameters:** |
| 177 | + |
| 178 | +- `commentId` (string, required): The ID of the comment to downvote. |
| 179 | + |
| 180 | +**Request Body** (JSON): |
| 181 | + |
| 182 | +- Empty object (no fields required). |
| 183 | + |
| 184 | +--- |
| 185 | + |
| 186 | +#### `POST /votes/comment/{commentId}/up` |
| 187 | + |
| 188 | +Upvote a comment by its ID. |
| 189 | + |
| 190 | +**Path Parameters:** |
| 191 | + |
| 192 | +- `commentId` (string, required): The ID of the comment to upvote. |
| 193 | + |
| 194 | +**Request Body** (JSON): |
| 195 | + |
| 196 | +- Empty object (no fields required). |
| 197 | + |
| 198 | +--- |
| 199 | + |
| 200 | +#### `POST /votes/thread/{threadId}/down` |
| 201 | + |
| 202 | +Downvote a thread by its ID. |
| 203 | + |
| 204 | +**Path Parameters:** |
| 205 | + |
| 206 | +- `threadId` (string, required): The ID of the thread to downvote. |
| 207 | + |
| 208 | +**Request Body** (JSON): |
| 209 | + |
| 210 | +- Empty object (no fields required). |
| 211 | + |
| 212 | +--- |
| 213 | + |
| 214 | +#### `POST /votes/thread/{threadId}/up` |
| 215 | + |
| 216 | +Upvote a thread by its ID. |
| 217 | + |
| 218 | +**Path Parameters:** |
| 219 | + |
| 220 | +- `threadId` (string, required): The ID of the thread to upvote. |
| 221 | + |
| 222 | +**Request Body** (JSON): |
| 223 | + |
| 224 | +- Empty object (no fields required). |
| 225 | + |
| 226 | +--- |
| 227 | + |
| 228 | +#### `GET /search` |
| 229 | + |
| 230 | +Search across threads and communities globally. |
| 231 | + |
| 232 | +**Query Parameters:** |
| 233 | + |
| 234 | +- `query` (string, optional): Search keyword or phrase. |
| 235 | +- `offset` (integer, optional): Pagination offset. |
| 236 | +- `limit` (integer, optional): Maximum number of results to return. |
| 237 | + |
| 238 | +--- |
| 239 | + |
| 240 | +#### `GET /search/community` |
| 241 | + |
| 242 | +Search for communities matching the query. |
| 243 | + |
| 244 | +**Query Parameters:** |
| 245 | + |
| 246 | +- `query` (string, optional): Search keyword or phrase for communities. |
| 247 | +- `offset` (integer, optional): Pagination offset. |
| 248 | +- `limit` (integer, optional): Maximum number of results to return. |
| 249 | + |
| 250 | +--- |
| 251 | + |
| 252 | +#### `GET /search/thread` |
| 253 | + |
| 254 | +Search for threads matching the query. |
| 255 | + |
| 256 | +**Query Parameters:** |
| 257 | + |
| 258 | +- `query` (string, optional): Search keyword or phrase for threads. |
| 259 | +- `offset` (integer, optional): Pagination offset. |
| 260 | +- `limit` (integer, optional): Maximum number of results to return. |
| 261 | + |
| 262 | +--- |
| 263 | + |
| 264 | +#### `GET /popular/comments` |
| 265 | + |
| 266 | +Retrieve a list of popular comments. |
| 267 | + |
| 268 | +**Query Parameters:** |
| 269 | + |
| 270 | +- `offset` (integer, optional): Pagination offset for the results. |
| 271 | +- `limit` (integer, optional): Maximum number of comments to return. |
| 272 | + |
| 273 | +--- |
| 274 | + |
| 275 | +#### `GET /popular/threads` |
| 276 | + |
| 277 | +Retrieve a list of popular threads. |
| 278 | + |
| 279 | +**Query Parameters:** |
| 280 | + |
| 281 | +- `offset` (integer, optional): Pagination offset for the results. |
| 282 | +- `limit` (integer, optional): Maximum number of threads to return. |
0 commit comments