Это то, что я пытаюсь: < /p>
Код: Выделить всё
// Build the search text from parameters
String searchText = String.format("%s %s %s %s", name, addressLine1, city, state);
// Create search request
SearchPlaceIndexForTextRequest searchRequest = SearchPlaceIndexForTextRequest.builder()
.indexName(placesIndex)
.text(searchText)
.build();
// Execute search
SearchPlaceIndexForTextResponse searchResponse = locationClient.searchPlaceIndexForText(searchRequest);
if (searchResponse.hasResults() && !searchResponse.results().isEmpty()) {
// Get the first result's place ID
Optional results = searchResponse.results().stream().findFirst();
String placeId = results.get().placeId();
logger.debug("place id: {}", placeId);
// Create get place request
GetPlaceRequest placeRequest = GetPlaceRequest.builder()
.placeId(placeId)
.indexName(placesIndex)
.language("en") // Specify language for the response
.build();
}
< /code>
Однако я никогда не получаю несколько часов назад, например, на McDonalds я получаю следующее: < /p>
{"businessHours":"{\"addressNumber\":\"510\",\"categories\":[\"PointOfInterestType\"],\"country\":\"USA\",\"geometry\":{\"point\":[-116.2429,43.60939]},\"interpolated\":false,\"label\":\"McDonald\\u0027s, 510 N Orchard St, Boise, ID 83706-1979, United States\",\"municipality\":\"Boise\",\"neighborhood\":\"Morris Hill\",\"postalCode\":\"83706-1979\",\"region\":\"Idaho\",\"street\":\"N Orchard St\",\"subRegion\":\"Ada\",\"supplementalCategories\":[\"Fast Food\"],\"timeZone\":{\"name\":\"America/Boise\",\"offset\":-25200}}"}
< /p>
может ли этот API вернуть отмеченные часы? < /P>
Подробнее здесь: https://stackoverflow.com/questions/794 ... n-services