Project Management
CRUD interfaces for managing projects.
Get Project List
Get project list for backend management (including drafts).
Interface Information
- Endpoint:
GET /api/admin/projects - Authentication: Required (admin permission)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | number | No | Page number, default 1 |
| limit | number | No | Items per page, default 10 |
| status | string | No | Status filter: published/draft |
| keyword | string | No | Keyword search |
Create Project
Create new project.
Interface Information
- Endpoint:
POST /api/admin/projects - Authentication: Required (admin permission)
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Project title |
| description | string | Yes | Project description |
| content | string | No | Project detailed content (Markdown) |
| coverImage | string | No | Cover image URL |
| demoUrl | string | No | Demo link |
| repoUrl | string | No | Code repository link |
| techStack | array | No | Technology stack tags |
| status | string | No | Status: published/draft, default draft |
Request Example
bash
curl -X POST http://localhost:3000/api/admin/projects \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"title": "My New Project",
"description": "Project description",
"techStack": ["Vue.js", "TypeScript"],
"status": "published"
}'Update Project
Update existing project.
Interface Information
- Endpoint:
PUT /api/admin/projects/:id - Authentication: Required (admin permission)
Request Parameters
Same as create project, all fields optional.
Request Example
bash
curl -X PUT http://localhost:3000/api/admin/projects/1 \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Title",
"status": "published"
}'Delete Project
Delete specified project.
Interface Information
- Endpoint:
DELETE /api/admin/projects/:id - Authentication: Required (admin permission)
Request Example
bash
curl -X DELETE http://localhost:3000/api/admin/projects/1 \
-H "Authorization: Bearer your-jwt-token"Error Responses
| HTTP Status Code | Description |
|---|---|
| 401 | Not logged in or token invalid |
| 403 | Insufficient permission (non-admin) |
| 404 | Project does not exist |
| 400 | Parameter error |
| 500 | Server error |