From fd65b0333e4e8a8df7b46bff64eaa8e9089ae6fe Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Sat, 18 Feb 2012 22:10:40 +0100 Subject: [PATCH] more parameters for connection --- .../schildbach/pte/service/LocationController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/schildbach/pte/service/LocationController.java b/src/main/java/de/schildbach/pte/service/LocationController.java index 7f9b2c85..3cedb302 100644 --- a/src/main/java/de/schildbach/pte/service/LocationController.java +++ b/src/main/java/de/schildbach/pte/service/LocationController.java @@ -60,11 +60,15 @@ public class LocationController @RequestMapping(value = "/connection", method = RequestMethod.GET) @ResponseBody - public QueryConnectionsResult connection(@RequestParam("from") final String from, @RequestParam("fromId") final int fromId, - @RequestParam("to") final String to, @RequestParam("toId") final int toId) throws IOException + public QueryConnectionsResult connection(@RequestParam(value = "fromType", required = false, defaultValue = "ANY") final LocationType fromType, + @RequestParam(value = "from", required = false) final String from, + @RequestParam(value = "fromId", required = false, defaultValue = "0") final int fromId, + @RequestParam(value = "toType", required = false, defaultValue = "ANY") final LocationType toType, + @RequestParam(value = "to", required = false) final String to, + @RequestParam(value = "toId", required = false, defaultValue = "0") final int toId) throws IOException { - final Location fromLocation = new Location(LocationType.ANY, fromId, null, from); - final Location toLocation = new Location(LocationType.ANY, toId, null, to); + final Location fromLocation = new Location(fromType, fromId, null, from); + final Location toLocation = new Location(toType, toId, null, to); final String products = "IRSUTBFC"; return provider.queryConnections(fromLocation, null, toLocation, new Date(), true, products, WalkSpeed.NORMAL, Accessibility.NEUTRAL); }