Resource Management
Interfaces for managing resource downloads.
Get Resource List
Get all resources.
Interface Information
- Endpoint:
GET /api/admin/resources - Authentication: Required (admin permission)
Create Resource
Create new resource.
Interface Information
- Endpoint:
POST /api/admin/resources - Authentication: Required (admin permission)
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Resource title |
| description | string | No | Resource description |
| fileUrl | string | Yes | File download link |
| fileSize | string | No | File size |
| downloadCount | number | No | Download count, default 0 |
| status | string | No | Status: active/inactive, default active |
Request Example
bash
curl -X POST http://localhost:3000/api/admin/resources \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"title": "Project Template",
"description": "Quick start template",
"fileUrl": "https://example.com/template.zip",
"fileSize": "5.2MB"
}'Update Resource
Update existing resource.
Interface Information
- Endpoint:
PUT /api/admin/resources/:id - Authentication: Required (admin permission)
Delete Resource
Delete specified resource.
Interface Information
- Endpoint:
DELETE /api/admin/resources/:id - Authentication: Required (admin permission)
Error Responses
| HTTP Status Code | Description |
|---|---|
| 401 | Not logged in or token invalid |
| 403 | Insufficient permission (non-admin) |
| 404 | Resource does not exist |
| 400 | Parameter error |
| 500 | Server error |