Skip to content

Commit

Permalink
Merge pull request #1 from TheECanyon/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
A7exSchin authored May 27, 2019
2 parents e8c98d6 + e459886 commit c4bd819
Show file tree
Hide file tree
Showing 17 changed files with 376 additions and 83 deletions.
6 changes: 3 additions & 3 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
Expand Down
Binary file modified bin/main/klib/trackr/GetRest.class
Binary file not shown.
Binary file added bin/main/klib/trackr/Leg.class
Binary file not shown.
Binary file added bin/main/klib/trackr/Maneuver.class
Binary file not shown.
Binary file added bin/main/klib/trackr/Position.class
Binary file not shown.
Binary file modified bin/main/klib/trackr/Response.class
Binary file not shown.
Binary file added bin/main/klib/trackr/Response_.class
Binary file not shown.
Binary file modified bin/main/klib/trackr/Route.class
Binary file not shown.
Binary file removed bin/main/klib/trackr/Waypoint.class
Binary file not shown.
16 changes: 8 additions & 8 deletions src/main/java/klib/trackr/GetRest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
public class GetRest {

private static final Logger log = LoggerFactory.getLogger(GetRest.class);
private static String start = "48.9621219,9.0710486";
private static String end = "48.7389943,9.1017945";

public static void main(String args[]) {
SpringApplication.run(GetRest.class);
}

@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
Expand All @@ -27,12 +29,10 @@ public RestTemplate restTemplate(RestTemplateBuilder builder) {
public CommandLineRunner run(RestTemplate restTemplate) throws Exception {
return args -> {
Response response = restTemplate.getForObject(
"https://route.api.here.com/routing/7.2/calculateroute.json?app_id=xjipTEag66SG6fNwgEQm&app_code=0eiHle7fs2IZsXChP2sWKQ&waypoint0=geo!52.5,13.4&waypoint1=geo!52.5,13.45&mode=fastest;car;traffic:disabled", Response.class);
log.info(response.toString());
"https://route.api.here.com/routing/7.2/calculateroute.json?app_id=xjipTEag66SG6fNwgEQm&app_code=0eiHle7fs2IZsXChP2sWKQ&waypoint0=geo!"
+ start + "&waypoint1=geo!" + end + "&mode=fastest;car;traffic:disabled",
Response.class);
response.getResponse().getRoute().get(0).getLeg().get(0).getManeuver().forEach(u -> log.info(u.toString()));
};
}
}
/*
https://gturnquist-quoters.cfapps.io/api/random
https://route.api.here.com/routing/7.2/calculateroute.json?app_id=xjipTEag66SG6fNwgEQm&app_code=0eiHle7fs2IZsXChP2sWKQ&waypoint0=geo!52.5,13.4&waypoint1=geo!52.5,13.45&mode=fastest;car;traffic:disabled
*/
}
72 changes: 72 additions & 0 deletions src/main/java/klib/trackr/Leg.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package klib.trackr;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ "start", "end", "length", "travelTime", "maneuver" })
public class Leg {

@JsonProperty("length")
private Integer length;
@JsonProperty("travelTime")
private Integer travelTime;
@JsonProperty("maneuver")
private List<Maneuver> maneuver = null;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();


@JsonProperty("length")
public Integer getLength() {
return length;
}

@JsonProperty("length")
public void setLength(Integer length) {
this.length = length;
}

@JsonProperty("travelTime")
public Integer getTravelTime() {
return travelTime;
}

@JsonProperty("travelTime")
public void setTravelTime(Integer travelTime) {
this.travelTime = travelTime;
}

@JsonProperty("maneuver")
public List<Maneuver> getManeuver() {
return maneuver;
}

@JsonProperty("maneuver")
public void setManeuver(List<Maneuver> maneuver) {
this.maneuver = maneuver;
}

@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}

@Override
public String toString() {
return maneuver.toString();
}
}
106 changes: 106 additions & 0 deletions src/main/java/klib/trackr/Maneuver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package klib.trackr;

import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ "position", "instruction", "travelTime", "length", "id", "_type" })
public class Maneuver {

@JsonProperty("position")
private Position position;
@JsonProperty("instruction")
private String instruction;
@JsonProperty("travelTime")
private Integer travelTime;
@JsonProperty("length")
private Integer length;
@JsonProperty("id")
private String id;
@JsonProperty("_type")
private String type;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();

@JsonProperty("position")
public Position getPosition() {
return position;
}

@JsonProperty("position")
public void setPosition(Position position) {
this.position = position;
}

@JsonProperty("instruction")
public String getInstruction() {
return instruction;
}

@JsonProperty("instruction")
public void setInstruction(String instruction) {
this.instruction = instruction;
}

@JsonProperty("travelTime")
public Integer getTravelTime() {
return travelTime;
}

@JsonProperty("travelTime")
public void setTravelTime(Integer travelTime) {
this.travelTime = travelTime;
}

@JsonProperty("length")
public Integer getLength() {
return length;
}

@JsonProperty("length")
public void setLength(Integer length) {
this.length = length;
}

@JsonProperty("id")
public String getId() {
return id;
}

@JsonProperty("id")
public void setId(String id) {
this.id = id;
}

@JsonProperty("_type")
public String getType() {
return type;
}

@JsonProperty("_type")
public void setType(String type) {
this.type = type;
}

@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}

@Override
public String toString() {
return id.toString() + " " + length.toString();
}
}
54 changes: 54 additions & 0 deletions src/main/java/klib/trackr/Position.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package klib.trackr;

import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ "latitude", "longitude" })
public class Position {

@JsonProperty("latitude")
private Double latitude;
@JsonProperty("longitude")
private Double longitude;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();

@JsonProperty("latitude")
public Double getLatitude() {
return latitude;
}

@JsonProperty("latitude")
public void setLatitude(Double latitude) {
this.latitude = latitude;
}

@JsonProperty("longitude")
public Double getLongitude() {
return longitude;
}

@JsonProperty("longitude")
public void setLongitude(Double longitude) {
this.longitude = longitude;
}

@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}

}
54 changes: 36 additions & 18 deletions src/main/java/klib/trackr/Response.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
package klib.trackr;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.HashMap;
import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ "response" })
public class Response {


private Route route;
@JsonProperty("response")
private Response_ response;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();

@JsonProperty("response")
public Response_ getResponse() {
return response;
}

public Response() {
}
@JsonProperty("response")
public void setResponse(Response_ response) {
this.response = response;
}

public Route getRoute() {
return route;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}

public void setRoute(Route route) {
this.route = route;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}

@Override
public String toString() {
return "Response:{" +
route +
'}';
}
@Override
public String toString() {
return response.toString();
}
}
Loading

0 comments on commit c4bd819

Please sign in to comment.