0% found this document useful (0 votes)
6 views2 pages

Library Management API with Spring Boot

The document outlines a Library Management REST API built with Spring Boot, featuring core functionalities for managing books, users, and book issue/return processes. It details the entities involved, including Book, User, and IssueRecord, along with their attributes. Additionally, it lists the REST endpoints for book, user, and issue/return operations, providing examples of how to implement these APIs.

Uploaded by

opkrchauhan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Library Management API with Spring Boot

The document outlines a Library Management REST API built with Spring Boot, featuring core functionalities for managing books, users, and book issue/return processes. It details the entities involved, including Book, User, and IssueRecord, along with their attributes. Additionally, it lists the REST endpoints for book, user, and issue/return operations, providing examples of how to implement these APIs.

Uploaded by

opkrchauhan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Library Management REST API

A clean, practical, and interview-friendly Spring Boot REST application.


🔹 Core Features
You build APIs to manage:
 Books
 Users (Students/Admin)
 Book Issue / Return
 Fine calculation

🧩 Entities (Simple & Realistic)


1️⃣ Book
 id
 title
 author
 isbn
 availableCopies
2️⃣ User
 id
 name
 email
 role (STUDENT / ADMIN)
3️⃣ IssueRecord
 id
 issueDate
 dueDate
 returnDate
 status (ISSUED / RETURNED)

🌐 REST Endpoints (Using ResponseEntity)


📘 Book APIs
POST /api/books
GET /api/books
GET /api/books/{id}
PUT /api/books/{id}
DELETE /api/books/{id}
Example:
@PostMapping
public ResponseEntity<Book> addBook(@RequestBody Book book) {
Book savedBook = [Link](book);
return new ResponseEntity<>(savedBook, [Link]);
}

👤 User APIs
POST /api/users
GET /api/users
GET /api/users/{id}

🔄 Issue / Return APIs


POST /api/issue/{bookId}/{userId}
PUT /api/return/{issueId}

You might also like