Skip to content

Instantly share code, notes, and snippets.

@fabito
Created November 11, 2012 01:29
Show Gist options
  • Save fabito/4053302 to your computer and use it in GitHub Desktop.
Save fabito/4053302 to your computer and use it in GitHub Desktop.
@Api(name = "buscacep", description = "Conjunto de serviços para consulta de CEP")
public class CepEndpoint {
private CEPService cepService = new MemcacheCepServiceDecorator(CEPServiceFactory.getCEPService());
@ApiMethod(httpMethod = "GET", name = "cep.get")
public CEP getCep(@Named("numeroCep") String numeroCep) {
return cepService.obtemPorNumeroCEP(numeroCep);
}
@ApiMethod(httpMethod = "GET", name = "cep.search")
public List<CEP> searchCep(@Named("term") String query) {
return cepService.obtemPorEndereco(query);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment