Skip to content

Commit

Permalink
Uncommenting @Cacheables
Browse files Browse the repository at this point in the history
  • Loading branch information
dadepo committed Dec 2, 2017
1 parent 81fd76e commit 56ace7c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.oruko.dictionary.model.NameEntry;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

Expand Down Expand Up @@ -31,12 +32,12 @@ public List<Map<String, Object>> getAllNames() {
return Arrays.asList(restTemplate.getForObject(APIPATH + "/names", Map[].class));
}

//@Cacheable("querySearchResult")
@Cacheable("querySearchResult")
public NameEntry getName(String nameQuery) {
return restTemplate.getForObject(APIPATH + "/search/" + nameQuery, NameEntry.class);
}

//@Cacheable("names")
@Cacheable("names")
public List<Map<String, Object>> searchName(String nameQuery) {
return Arrays.asList(restTemplate.getForObject(APIPATH + "/search/?q=" + nameQuery, Map[].class));
}
Expand Down

0 comments on commit 56ace7c

Please sign in to comment.