Leohylee / bookstore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Book Store REST API Application

Book (/book):

  • GET (/all): to get all the books from table
  • GET (/isbn/{isbn}): to get book by isbn
  • GET (/title/{title}): to get book by title
  • GET (/author): to get book by author (RequestParam: firstName=John&lastName=Doe)
  • GET (/publisher/{publisher}): to get book by publisher
  • PUT (/authorId/{authorId}/publlisherId/{publisherId}): to create book with book information + author + publisher (RequestBody: {"title": "ABC", "isbn": "1234567898765", "publishDate": "2000/01/23"})
  • POST (/{id}): to update information of book (RequestBody: {"title": "ABC", "isbn": "1234567898765", "publishDate": "2000/01/23"})
  • DELETE (/{id}): to delete a book record

Author (/author):

  • GET (/all): to get all the authors from table
  • GET (/{id}): to get author by id
  • GET (/name): to get author by firstName + lastName (RequestParam: firstName=John&lastName=Doe)
  • PUT: to create new Author record: (RequestBody: {"firstName": "John", "lastName": "Doe"})
  • POST (/{id}): to update Author information: (RequestBody: {"firstName": "John", "lastName": "Doe"})
  • DELETE (/{id}): to delete an author record

Publisher (/publisher):

  • GET (/all): to get all publishers
  • GET (/{id}): to get publisher by id
  • PUT: to create a new publisher (RequestBody: {"name": "Penguin"})
  • POST (/{id}): to update publisher information (RequestBody: {"name": "Penguin"})
  • DELETE (/{id}): to delete a publisher record

StockLevel (/stocklevel):

  • GET (/all): to get all stock level status (RequestParam: qty=100)
  • GET (/{bookId}): to get stock level status by book id
  • POST (/{id}): to update stock level status by stock id

Transaction (/transaction):

  • GET: to get all transaction record
  • PUT: to make a purchase action, it can be a book or a group of books (RequestBody: [{"customerName": "John Doe", "bookId": 4, "qty": 10}, {"customerName": "John Doe", "bookId": 2, "qty": 5}])

Test Demonstration

Author

  • PUT: img.png img_1.png
  • GET (/all): img_1.png
  • GET (/{id}): img.png
  • GET (/name): img_1.png
  • POST (/{id}): img.png img_1.png
  • DELETE (/{id}): img.png

Book

  • GET (/all): img.png
  • GET (/isbn/{isbn}): img.png
  • GET (/title/{title}): img.png
  • GET (/author): img.png
  • GET (/publisher/{publisher}): img.png
  • PUT (/authorId/{authorId}/publlisherId/{publisherId}):img.png img.png
  • POST (/{id}): img.png
  • DELETE (/{id}): img.png img.png

Publisher:

  • GET (/all): img.png
  • GET (/{id}): img.png
  • PUT: img.png
  • POST (/{id}): img.png img.png
  • DELETE (/{id}): img.png

StockLevel:

  • POST (/{id}): img.png
  • GET (/all): img.png
  • GET (/{bookId}): img.png

Transaction (/transaction):

  • PUT: img.png

  • GET: img.png

  • Stock level changed after transaction:

  • img.png

Error Message

  • Missing Request Body Property: img.png
  • Missing Request Param: img.png
  • Required Entity Cannot be Found: img.png
  • Calling Non-existent Methods: img.png

About


Languages

Language:Java 100.0%