book

Book pets proj.

#Book REST service.

mvn clean package

Use: http://localhost:8080/books/readers/{reader_id}/books/{book_id}
Methods:
- GET - book_id not use, list of book for reader
Url http://localhost:8080/books/readers/1/books - PUT - add book to reader
Url http://localhost:8080/books/readers/1/books/2 - DELETE - ‘back’ book from reader
Url http://localhost:8080/books/readers/1/books/2

Bonus: Add book:
Method: PUT
Url: http://localhost:8080/books/books/
Body: {"book":{"title":"title 1", "author":"Author 100"}}


Tasks list:

  1. MyBatis query for get Reader`s by Book, get Book`s by Reader.
  2. Create 3 Book, 2 Reader, 1 Reader read 0 Book, 1 Reader read 2 Book. Test 1 query.
  3. Run tomcat.
  4. Create servlet.
  5. War. In pom file:
    <!--<packaging>jar</packaging>-->
    <packaging>war</packaging>
  6. Test injection mappers into Servlet throught Services.
  7. Parse url.
  8. Dispatch url`s
  9. Controllers. Link url with Controllers throught reflection. Controller interface.
  10. Select JSON lib.
  11. Http methods parse.
  12. End interface, Controllers.
  13. Decorate myBatis mappers, entities.
  14. Entity to JSON decore.
  15. REST pribciples.
  16. URL:
    Example: /books/v1.0/books/10
    ../books/search/Title
    Add parsing !!!
  17. Params:
    URL - only query, JSON - all data.
  18. Methods:
    • GET - list, concrete
      /books/v1.0/books/10
      /books/v1.0/books
      Search: ?title=book1
    • DELETE - удаление
      /books/v1.0/books/10
    • PUT - idempotent - add, update
      ???
    • POST - ???
  19. Errors:
    • 200 OK
    • 201 Created (Запись создана)
    • 400 Bad Request (некорректный запрос)
    • 404 Not Found (Данные не найдены)
    • 500 Internal server error (внутренняя ошибка сервера) return text
      error JSON format
  20. Methods:
  21. выдать книгу абоненту; readers/{id}/books/{id} put
  22. принять книгу у абонента; readers/{id}/books/{id} delete?
  23. получить список книг, выданных заданному абоненту readers/{id}/books get

TODO:

  1. Test REST.

  2. End all domain REST.

  3. Rest:

  4. Version:
    v1.0

  5. Validation?

Related Repositories

python-machine-learning-book

python-machine-learning-book

The "Python Machine Learning" book code repository and info resource ...

objc-zen-book-cn

objc-zen-book-cn

ObjC Zen Book 中文翻译 ...

book-of-modern-frontend-tooling

book-of-modern-frontend-tooling

The Front-end Tooling Book ...

book

book

Crypto 101, the introductory book on cryptography. ...

angularjs-book

angularjs-book

Examples and Code snippets from the AngularJS O'Reilly book ...