@RestController @RequestMapping("/api/loans") class LoanController { @PostMapping("/issue") @PreAuthorize("hasRole('ADMIN')") @Transactional ResponseEntity<Loan> issue(...) { // 14-day due • availability check } }
Library Management System
A secured REST API with stateless JWT authentication and BCrypt hashing. Role-based access for USER/ADMIN, normalized JPA relationships, and transactional issue/return logic with real-time availability tracking.