Skip to content

Instantly share code, notes, and snippets.

@oofnivek
Created January 15, 2023 17:37
Show Gist options
  • Save oofnivek/b2d7191f5f77ef7cbef1d3807af04572 to your computer and use it in GitHub Desktop.
Save oofnivek/b2d7191f5f77ef7cbef1d3807af04572 to your computer and use it in GitHub Desktop.
package com.example.demo;
import org.springframework.stereotype.Service;
@Service
public class BookService {
public Book getBookById(String id){
try{
// simulate slow retrieval from DB
Thread.sleep(2000);
}catch(Exception e){
e.printStackTrace();
}
return new Book(id, "Book " + id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment