test-support and temperature #2
2
pom.xml
2
pom.xml
@ -10,7 +10,7 @@
|
||||
</parent>
|
||||
<groupId>com.smhi</groupId>
|
||||
<artifactId>weather</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<version>0.0.2-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>weather</name>
|
||||
<description>Collecting current weather data in Stockholm</description>
|
||||
|
@ -53,10 +53,13 @@ public class OpenWeatherService {
|
||||
|
||||
private OpenResponce buildResult(Root root) {
|
||||
OpenResponce responce = new OpenResponce();
|
||||
DataVO dvo = new DataVO();
|
||||
for (TimeSeries ts : root.timeSeries) {
|
||||
for (Parameter p : ts.parameters) {
|
||||
if (p.getName().equalsIgnoreCase("t")) {
|
||||
dvo.setTemp(p.getValues().get(0));
|
||||
}
|
||||
if (p.getName().equalsIgnoreCase("Wsymb2")) {
|
||||
DataVO dvo = new DataVO();
|
||||
dvo.setWsymb2(p.getValues().get(0).intValue());
|
||||
responce.setDataVO(dvo);
|
||||
return responce;
|
||||
|
@ -4,22 +4,32 @@ import java.io.Serializable;
|
||||
|
||||
public class DataVO implements Serializable {
|
||||
|
||||
int Wsymb2;
|
||||
int wsymb2;
|
||||
double temp;
|
||||
|
||||
public DataVO() {}
|
||||
|
||||
public int getWsymb2() {
|
||||
return Wsymb2;
|
||||
return wsymb2;
|
||||
}
|
||||
|
||||
public void setWsymb2(int wsymb2) {
|
||||
Wsymb2 = wsymb2;
|
||||
this.wsymb2 = wsymb2;
|
||||
}
|
||||
|
||||
public double getTemp() {
|
||||
return temp;
|
||||
}
|
||||
|
||||
public void setTemp(double temp) {
|
||||
this.temp = temp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DataVO{" +
|
||||
"Wsymb2=" + Wsymb2 +
|
||||
"wsymb2=" + wsymb2 +
|
||||
", temp=" + temp +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user