Instead of Entity[] use EntityState

This commit is contained in:
aditya.chandel
2024-12-28 23:06:54 -07:00
parent da153d6c04
commit a5e321319a
17 changed files with 398 additions and 251 deletions
@@ -13,6 +13,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.time.Duration;
import java.util.List;
@RequestMapping("/v1/book")
@@ -28,8 +29,9 @@ public class BookController {
}
@GetMapping
public ResponseEntity<List<BookDTO>> getBooks() {
return ResponseEntity.ok( booksService.getBooks());
public ResponseEntity<List<BookDTO>> getBooks() throws InterruptedException {
Thread.sleep(Duration.ofSeconds(3));
return ResponseEntity.ok(booksService.getBooks());
}
@GetMapping("/search")