Book microservice (2.0.3)

Download OpenAPI specification:Download

This microservice is used to access informations about books. In particular, this microservice expose API with functionality that let you add new books, add a personal library and let you register RFIDs associated to a defined book.

create

Let you create a specified object

Create a new book

Create a new book, using the values passed.

Request Body schema: application/protobuf.BookActions_WithPermission

Create a new book in the system

email_esecutore
string
Libro
object

Responses

Request samples

Content type
application/protobuf.BookActions_WithPermission
{
  "email_esecutore": "string",
  "Libro": {
    "ISBN": "string",
    "Titolo?": "string",
    "Autore?": "string",
    "Data_Pubblicazione?": {
      "Day": "integer",
      "Month": "integer",
      "Year": "integer"
    }
  }
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "Booked added successfully."
}

Create a new library

Create a library associated with an email of a user

Request Body schema: application/protobuf.BasicMessage

Create a new library in the system

message
string
message2
string

Responses

Request samples

Content type
application/protobuf.BasicMessage
{
  "message": "email."
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "Libreria created successfully."
}

Create a RFID

Create a RFID associated to an ISBN and the library of the user

Request Body schema: application/protobuf.BuyBook

Create a new RFID in the system

ISBN
string
RFID
string
emailCompratore
string

Responses

Request samples

Content type
application/protobuf.BuyBook
{
  "ISBN": "string",
  "RFID": "string",
  "emailCompratore": "string"
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "Cannot add the library."
}

utility

Let you get/change some informations

Get the informations of a book

Get the informations of a specified book with given ISBN

query Parameters
ISBN
required
string

ISBN of the book you are looking for

Responses

Response samples

Content type
application/protobuf.Book
{
  "ISBN": "string",
  "Titolo": "string",
  "Autore": "string",
  "Data_Pubblicazione": {
    "Day": "integer",
    "Month": "integer",
    "Year": "integer"
  }
}

Get the informations of a copy

Get the informations of a specified copy passed by RFID

query Parameters
RFID
required
string

RFID of the copy you are looking for

Responses

Response samples

Content type
application/protobuf.Copy
{
  "ISBN": "string",
  "RFID": "string",
  "ID_Libreria": "integer",
  "Email_Proprietario": "string"
}

Get the informations of all copies of an user passed by email

Get all the informations of copies owned by an user

query Parameters
email
required
string

email of the user

Responses

Response samples

Content type
application/protobuf.Library
{
  "copies": "Copy[]"
}

Change email in the library.

Change the email of a library.
IMPORTANT-> Never use this functionality for changing the email. Use the one from the Access microservice

Request Body schema: application/protobuf.BasicMessage

Change the email in the library

message
string
message2
string

Responses

Request samples

Content type
application/protobuf.BasicMessage
{
  "message": "email"
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "Email changed successfully."
}

remove

Let you delete data

Remove a library

Remove a specified library from the system

Request Body schema: application/protobuf.BasicMessage

Remove the library given a specified email

message
string
message2
string

Responses

Request samples

Content type
application/protobuf.BasicMessage
{
  "message": "email"
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "Library removed successfully."
}

Remove a RFID

Remove a specified RFID from the system

Request Body schema: application/protobuf.BasicMessage

Remove the RFID given

message
string
message2
string

Responses

Request samples

Content type
application/protobuf.BasicMessage
{
  "message": "RFID"
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "RFID removed successfully."
}

Remove all RFID of a library

Remove all the registered RFID associated with a given email

Request Body schema: application/protobuf.BasicMessage

Remove all RFID of an email

message
string
message2
string

Responses

Request samples

Content type
application/protobuf.BasicMessage
{
  "message": "email"
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "RFIDs removed successfully."
}

Remove a book from the system

Remove a book, specified by ISBN, from the system

Request Body schema: application/protobuf.BookActions_WithPermission

Remove a book

message
string
message2
string

Responses

Request samples

Content type
application/protobuf.BookActions_WithPermission
{
  "email_esecutore": "string",
  "Libro": {
    "ISBN": "string",
    "Titolo?": "string",
    "Autore?": "string",
    "Data_Pubblicazione?": {
      "Day": "integer",
      "Month": "integer",
      "Year": "integer"
    }
  }
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "Book removed successfully."
}

Remove all books of an author

Remove all books, specified by author parameter, from the system

Request Body schema: application/protobuf.BasicMessage

Remove all books of an author

message
string
message2
string

Responses

Request samples

Content type
application/protobuf.BasicMessage
{
  "message": "email"
}

Response samples

Content type
application/protobuf.BasicMessage
{
  "message": "Books removed successfully."
}