JavaBookService is a microservice for managing books in library projects. The service provides a REST API for performing CRUD operations (Create, Read, Update, Delete) on books.
| Service | Port |
|---|---|
| Books Service API | 8090 |
| PostgreSQL Database | 5432 |
Base URL: http://localhost:8090/api/books/
GET /getAllReturns a list of all books in the library.
GET /getById/{id}Path Parameters:
id— unique book identifier
GET /search?title=value&author=value&genre=valueQuery Parameters:
title— search by title (partial match)author— search by author (partial match)genre— search by genre (partial match)minReleaseDate— minimum publication date (format: YYYY-MM-DD)maxReleaseDate— maximum publication date (format: YYYY-MM-DD)
Example:
GET /search?author=Tolkien&minReleaseDate=1950-01-01&maxReleaseDate=1960-12-31
POST /create
Content-Type: application/jsonRequest Body:
{
"fileLink": "https://example.com/book.pdf",
"author": "J.R.R. Tolkien",
"date": "1954-07-29",
"title": "The Lord of the Rings",
"description": "An epic high-fantasy novel",
"genre": "Fantasy"
}PUT /update/{id}
Content-Type: application/jsonPath Parameters:
id— identifier of the book to update
Request Body:
{
"fileLink": "https://example.com/book-updated.pdf",
"author": "J.R.R. Tolkien",
"date": "1954-07-29",
"title": "The Lord of the Rings (Revised Edition)",
"description": "Updated version of the novel",
"genre": "Fantasy"
}DELETE /delete/{id}Path Parameters:
id— identifier of the book to delete
| Field | Type | Description |
|---|---|---|
fileLink |
String | URL link to the book file |
author |
String | Book author |
date |
Date | Publication date (format: YYYY-MM-DD) |
title |
String | Book title |
description |
String | Content description |
genre |
String | Book genre |
- All dates must be in ISO 8601 format:
YYYY-MM-DD - Search fields support partial matching (case-insensitive)
- When updating a book, all fields must be provided, even if unchanged