added ratings and updated ebook struct
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
meta {
|
||||
name: Create/Update Ebook Rating
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:8765/api/ebooks/{{ebookid}}/rating
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body: json {
|
||||
{
|
||||
"rating": 4
|
||||
}
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Create/Update Ebook Rating
|
||||
|
||||
Creates or updates the authenticated user's rating for a specific ebook.
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Ebook UUID
|
||||
|
||||
**Request Body:**
|
||||
- `rating` (number, required): Rating value (1-5)
|
||||
|
||||
**Response:**
|
||||
- `id` (string): Rating UUID
|
||||
- `ebook_id` (string): Ebook UUID
|
||||
- `user_id` (string): User UUID
|
||||
- `rating` (number): Rating value (1-5)
|
||||
- `created_at` (string): Creation timestamp
|
||||
- `updated_at` (string): Last update timestamp
|
||||
|
||||
**Error Responses:**
|
||||
- 400: Invalid rating value
|
||||
- 401: Invalid authentication
|
||||
- 404: Ebook not found
|
||||
}
|
||||
Reference in New Issue
Block a user