Skip to content

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

ParameterTypeRequiredDescription
titlestringYesResource title
descriptionstringNoResource description
fileUrlstringYesFile download link
fileSizestringNoFile size
downloadCountnumberNoDownload count, default 0
statusstringNoStatus: 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 CodeDescription
401Not logged in or token invalid
403Insufficient permission (non-admin)
404Resource does not exist
400Parameter error
500Server error