Project Like
Like a specific project.
Interface Information
- Endpoint:
POST /api/projects/:id/like - Authentication: Required
- Content-Type:
application/json
Request Headers
| Parameter | Description |
|---|---|
| Authorization | Bearer Token |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | number | Yes | Project ID |
Request Example
bash
curl -X POST http://localhost:3000/api/projects/1/like \
-H "Authorization: Bearer your-jwt-token"Response Example
json
{
"success": true,
"message": "Like successful",
"data": {
"likeCount": 46
}
}Error Responses
| HTTP Status Code | Description |
|---|---|
| 401 | Not logged in or token invalid |
| 404 | Project does not exist |
| 400 | Already liked |
| 500 | Server error |
Limitations
- Each user can only like the same project once
- Likes cannot be canceled (contact administrator if needed)