Created
June 28, 2014 21:15
-
-
Save altfatterz/c77967b7d5b6460c897d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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