Skip to content

Instantly share code, notes, and snippets.

@altfatterz
Created June 28, 2014 21:15
Show Gist options
  • Save altfatterz/c77967b7d5b6460c897d to your computer and use it in GitHub Desktop.
Save altfatterz/c77967b7d5b6460c897d to your computer and use it in GitHub Desktop.
@Service
public class FacebookLookupService {
private static final Logger LOGGER = LoggerFactory.getLogger(FacebookLookupService.class);
private RestTemplate restTemplate;
@Autowired
public FacebookLookupService(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
@Cacheable("pages")
public Page findPage(String page) {
LOGGER.info("calling findPage with {}", page);
return restTemplate.getForObject("http://graph.facebook.com/" + page, Page.class);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment