- Update rating examples to use 1-10 scale - Document half-star precision in API collections - Add rating conversion examples for testing - Update Get Ebook Rating docs with scale explanation - Update Create/Update Rating with new validation rules
44 lines
989 B
Plaintext
44 lines
989 B
Plaintext
meta {
|
|
name: Get Ebook Ratings
|
|
type: http
|
|
seq: 9
|
|
}
|
|
|
|
get {
|
|
url: http://localhost:8765/api/ebooks/{{ebookid}}/ratings
|
|
body: none
|
|
auth: inherit
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Get Ebook Ratings
|
|
|
|
Retrieves all ratings for a specific ebook, including usernames.
|
|
|
|
**Authentication:** Required (Bearer token)
|
|
|
|
**Path Parameters:**
|
|
- `id` (string): Ebook UUID
|
|
|
|
**Response:** Array of rating objects
|
|
- `id` (string): Rating UUID
|
|
- `ebook_id` (string): Ebook UUID
|
|
- `user_id` (string): User UUID
|
|
- `rating` (number): Rating value (1-10, where odd numbers = half-stars)
|
|
- `created_at` (string): Creation timestamp
|
|
- `updated_at` (string): Last update timestamp
|
|
- `username` (string): Username of the rating user
|
|
|
|
**Rating Conversion:**
|
|
- Frontend displays: 1-5 stars with half-star precision
|
|
- Backend stores: 1-10 (where 1,3,5,7,9 = half-stars)
|
|
|
|
**Error Responses:**
|
|
- 401: Invalid authentication
|
|
- 404: Ebook not found
|
|
} |