Gallery Management
Interfaces for managing image galleries.
Get Gallery List
Get all galleries.
Interface Information
- Endpoint:
GET /api/admin/galleries - Authentication: Required (admin permission)
Create Gallery
Create new gallery.
Interface Information
- Endpoint:
POST /api/admin/galleries - Authentication: Required (admin permission)
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Gallery name |
| description | string | No | Description |
| coverImage | string | No | Cover image URL |
| order | number | No | Sort order, default 0 |
Request Example
bash
curl -X POST http://localhost:3000/api/admin/galleries \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"title": "Photography Works",
"description": "My photography portfolio"
}'Upload Images to Gallery
Upload images to specified gallery.
Interface Information
- Endpoint:
POST /api/admin/galleries/:id/images - Authentication: Required (admin permission)
Request Parameters
Use multipart/form-data format.
| Parameter | Type | Required | Description |
|---|---|---|---|
| images | file | Yes | Image files (supports multiple) |
Request Example
bash
curl -X POST http://localhost:3000/api/admin/galleries/1/images \
-H "Authorization: Bearer your-jwt-token" \
-F "images=@photo1.jpg" \
-F "images=@photo2.jpg"Update Gallery
Update existing gallery.
Interface Information
- Endpoint:
PUT /api/admin/galleries/:id - Authentication: Required (admin permission)
Delete Gallery
Delete specified gallery.
Interface Information
- Endpoint:
DELETE /api/admin/galleries/:id - Authentication: Required (admin permission)
Error Responses
| HTTP Status Code | Description |
|---|---|
| 401 | Not logged in or token invalid |
| 403 | Insufficient permission (non-admin) |
| 404 | Gallery does not exist |
| 400 | Parameter error |
| 500 | Server error |