API — Avaliacoes
Documentacao tecnica gerada automaticamente a partir da especificacao OpenAPI.
GET /api/products/{product_id}/reviews
List Product Reviews
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| product_id | integer | Sim | — |
| page | integer | Nao | — |
| page_size | integer | Nao | — |
| sort_by | string | Nao | — |
Exemplo resposta (200):
{
"items": [
"..."
],
"total": 0,
"average_rating": null,
"rating_distribution": {}
}
Erros possiveis: 422 Validation Error
POST /api/products/{product_id}/reviews
Create Review
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| product_id | integer | Sim | — |
Corpo do pedido:
| Campo | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| rating | integer | Sim | Rating de 1 a 5 |
| title | object | Nao | Title |
| content | object | Nao | Content |
Exemplo pedido:
{
"rating": 0,
"title": null,
"content": null
}
Exemplo resposta (201):
{
"id": 0,
"product_id": 0,
"rating": 0,
"title": null,
"content": null,
"is_verified_purchase": true,
"author": null,
"created_at": "string"
}
Erros possiveis: 422 Validation Error
GET /api/products/{product_id}/rating
Get Product Rating
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| product_id | integer | Sim | — |
Exemplo resposta (200):
{
"average_rating": null,
"review_count": 0
}
Erros possiveis: 422 Validation Error
GET /api/admin/reviews
Admin List Reviews
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| page | integer | Nao | — |
| page_size | integer | Nao | — |
| status | string | Nao | — |
| product_id | string | Nao | — |
Exemplo resposta (200):
{
"items": [
"..."
],
"total": 0,
"page": 0,
"page_size": 0,
"total_pages": 0
}
Erros possiveis: 422 Validation Error
PATCH /api/admin/reviews/{review_id}/approve
Approve Review
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| review_id | integer | Sim | — |
Exemplo resposta (200):
{
"id": 0,
"product_id": 0,
"product_name": null,
"user_id": 0,
"author": null,
"rating": 0,
"title": null,
"content": null,
"is_verified_purchase": true,
"is_approved": true,
"created_at": "string",
"updated_at": null
}
Erros possiveis: 422 Validation Error
DELETE /api/admin/reviews/{review_id}
Delete Review
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| review_id | integer | Sim | — |
Resposta (204): Successful Response
Erros possiveis: 422 Validation Error
Documentacao gerada automaticamente.