Skip to content

Commit

Permalink
add radius (km) parameter if reverse=true
Browse files Browse the repository at this point in the history
  • Loading branch information
karussell committed Sep 4, 2023
1 parent cd9d36a commit a03ff10
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public ConverterResourcePhoton(String photonUrl, String photonReverseUrl, Set<St
@Timed
public Response handle(@QueryParam("q") @DefaultValue("") String query,
@QueryParam("limit") @DefaultValue("5") int limit,
@QueryParam("radius") @DefaultValue("1.0") double radius,
@QueryParam("locale") @DefaultValue("default") String locale,
@QueryParam("bbox") @DefaultValue("") String bbox,
@QueryParam("location_bias_scale") @DefaultValue("") String locationBiasScale,
Expand All @@ -47,7 +48,8 @@ public Response handle(@QueryParam("q") @DefaultValue("") String query,

WebTarget target;
if (reverse) {
target = buildReverseTarget(point);
target = buildReverseTarget();
target.queryParam("radius", radius);
} else {
target = buildForwardTarget(query);
}
Expand Down Expand Up @@ -104,7 +106,7 @@ private WebTarget buildForwardTarget(String query) {
queryParam("q", query);
}

private WebTarget buildReverseTarget(String point) {
private WebTarget buildReverseTarget() {
return jerseyClient.
target(photonReverseUrl);
}
Expand Down

0 comments on commit a03ff10

Please sign in to comment.