moreirathomas/golastic

Connect repository methods to http handlers

Closed this issue · 0 comments

Description

We need to correctly call the methods exported from repository inside http.

Tasks

Full text search

Request:

GET /books?query=<keywords>

Response:
200 array of matching books

Get one book

Request:

GET /books/<id>

Response:
200 the book

Post one book

Request:

POST /books
{
  "title": "string",
  "abstract": "string"
}

Response:
201

Update one book

Request:

PUT /books
{
  "title": "string",
  "abstract": "string"
}

Response:
204

Delete one book

Request:

DELETE /books/<id>

Response:
204

Notes

Implement and test:

  • repository.Get(id)
  • repository.Update(book)
  • repository.Delete(id)

Estimated time

5h