Here are all endpoints with examples;
To get book list (GET):
localhost:8080/books/list
====================================
To add book (POST):
localhost:8080/books/addBook
Example:
{
"author": "author",
"name": "name",
"barcode": "barcode",
"price": 10.25,
"quantity": 10
}
====================================
To add journal (POST):
localhost:8080/books/addJournal
Example:
{
"author": "author",
"name": "name",
"barcode": "barcode",
"price": 10.25,
"quantity": 10,
"scienceIndex": 5
}
====================================
To add antique book (POST):
localhost:8080/books/addAntiqueBook
Example:
{
"author": "author",
"name": "name",
"barcode": "barcode",
"price": 10.25,
"quantity": 10,
"year": 2000
}
====================================
Get book by barcode (GET):
localhost:8080/books/getBook?barcode=444
====================================
To update book (PUT):
localhost:8080/books/updateBook?barcode=111
Example:
{
"author": "newAuthor",
"name": "newName",
"price": 100,
"quantity": 100,
}
====================================
To get total prices (GET):
localhost:8080/books/getTotalPrice
Example: [ { "barcode": "barcode1" }, { "barcode": "barcode2" } ]