Repository navigation
WebLibrary - 1.0
WebLibrary API Documentation
Overview
The WebLibrary application provides RESTful APIs for managing books, authors, and publishers. The application is dockerized and follows standard REST principles.
Base URL
All endpoints are prefixed with /api/v1.
Publisher Controller
Endpoints
Get Publishers by Name
- URL:
/api/v1/publisher/name/{name} - Method:
GET - Description: Retrieves a set of publishers based on the given name.
- Response:
200 OKwith a set ofPublisherDTO.
Get Publishers by Address
- URL:
/api/v1/publisher/address/{address} - Method:
GET - Description: Retrieves a list of publishers based on the given address.
- Response:
200 OKwith a list ofPublisherDTO.
Create New Publisher
- URL:
/api/v1/publisher - Method:
POST - Description: Creates a new publisher.
- Request Body:
PublisherDTO - Response:
201 Created
Update Publisher by ID
- URL:
/api/v1/publisher/{id} - Method:
PUT - Description: Updates an existing publisher by ID.
- Request Body:
PublisherDTO - Response:
200 OK
Update Publisher by Name
- URL:
/api/v1/publisher/name/{name} - Method:
PUT - Description: Updates an existing publisher by name.
- Request Body:
PublisherDTO - Response:
200 OK
Delete Publisher by ID
- URL:
/api/v1/publisher/{id} - Method:
DELETE - Description: Deletes a publisher by ID.
- Response:
204 No Content
Delete Publisher by Name
- URL:
/api/v1/publisher/name/{name} - Method:
DELETE - Description: Deletes a publisher by name.
- Response:
204 No Content
Author Controller
Endpoints
Get Authors by Name
- URL:
/api/v1/author/name/{name} - Method:
GET - Description: Retrieves a list of authors based on the given name.
- Response:
200 OKwith a list ofAuthorDTO.
Get Authors by Email
- URL:
/api/v1/author/email/{email} - Method:
GET - Description: Retrieves a set of authors based on the given email.
- Response:
200 OKwith a set ofAuthorDTO.
Create New Author
- URL:
/api/v1/author - Method:
POST - Description: Creates a new author.
- Request Body:
AuthorDTO - Response:
201 Created
Update Author by ID
- URL:
/api/v1/author/{id} - Method:
PUT - Description: Updates an existing author by ID.
- Request Body:
AuthorDTO - Response:
200 OK
Update Author by Email
- URL:
/api/v1/author/email/{email} - Method:
PUT - Description: Updates an existing author by email.
- Request Body:
AuthorDTO - Response:
200 OK
Delete Author by ID
- URL:
/api/v1/author/{id} - Method:
DELETE - Description: Deletes an author by ID.
- Response:
204 No Content
Delete Author by Email
- URL:
/api/v1/author/email/{email} - Method:
DELETE - Description: Deletes an author by email.
- Response:
204 No Content
Book Controller
Endpoints
Get Books by Title
- URL:
/api/v1/book/title/{title} - Method:
GET - Description: Retrieves a list of books based on the given title.
- Response:
200 OKwith a list ofBookDTO.
Get Books by ISBN
- URL:
/api/v1/book/isbn/{isbn} - Method:
GET - Description: Retrieves a set of books based on the given ISBN.
- Response:
200 OKwith a set ofBookDTO.
Find Books by Authors
- URL:
/api/v1/book/authors - Method:
POST - Description: Retrieves books based on the given set of authors.
- Request Body: Set of
AuthorDTO - Response:
200 OKwith a list ofBookDTO.
Find Books by Publisher
- URL:
/api/v1/book/publisher - Method:
POST - Description: Retrieves books based on the given publisher.
- Request Body:
PublisherDTO - Response:
200 OKwith a list ofBookDTO.
Get Authors by Book ISBN
- URL:
/api/v1/book/{isbn}/authors - Method:
GET - Description: Retrieves a list of authors for a given book ISBN.
- Response:
200 OKwith a list ofAuthorDTO.
Get Publisher by Book ISBN
- URL:
/api/v1/book/{isbn}/publisher - Method:
GET - Description: Retrieves the publisher for a given book ISBN.
- Response:
200 OKwithPublisherDTO.
Create Book
- URL:
/api/v1/book - Method:
POST - Description: Creates a new book.
- Request Body:
BookDTO - Response:
201 Created
Update Book by ID
- URL:
/api/v1/book/{id} - Method:
PUT - Description: Updates an existing book by ID.
- Request Body:
BookDTO - Response:
200 OK
Update Book by ISBN
- URL:
/api/v1/book/isbn/{isbn} - Method:
PUT - Description: Updates an existing book by ISBN.
- Request Body:
BookDTO - Response:
200 OK
Delete Book by ID
- URL:
/api/v1/book/{id} - Method:
DELETE - Description: Deletes a book by ID.
- Response:
204 No Content
Delete Book by ISBN
- URL:
/api/v1/book/isbn/{isbn} - Method:
DELETE - Description: Deletes a book by ISBN.
- Response:
204 No Content
Docker Setup
The application is dockerized for easy deployment. Ensure that Docker is installed and application build with compose.yaml file.