test-support and temperature #2

Merged
adsu7578 merged 3 commits from test into develop 2022-05-13 13:43:41 +02:00
3 changed files with 19 additions and 6 deletions
Showing only changes of commit 9dc8b1adc5 - Show all commits

View File

@ -10,7 +10,7 @@
</parent> </parent>
<groupId>com.smhi</groupId> <groupId>com.smhi</groupId>
<artifactId>weather</artifactId> <artifactId>weather</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.2-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>weather</name> <name>weather</name>
<description>Collecting current weather data in Stockholm</description> <description>Collecting current weather data in Stockholm</description>

View File

@ -53,10 +53,13 @@ public class OpenWeatherService {
private OpenResponce buildResult(Root root) { private OpenResponce buildResult(Root root) {
OpenResponce responce = new OpenResponce(); OpenResponce responce = new OpenResponce();
DataVO dvo = new DataVO();
for (TimeSeries ts : root.timeSeries) { for (TimeSeries ts : root.timeSeries) {
for (Parameter p : ts.parameters) { for (Parameter p : ts.parameters) {
if (p.getName().equalsIgnoreCase("t")) {
dvo.setTemp(p.getValues().get(0));
}
if (p.getName().equalsIgnoreCase("Wsymb2")) { if (p.getName().equalsIgnoreCase("Wsymb2")) {
DataVO dvo = new DataVO();
dvo.setWsymb2(p.getValues().get(0).intValue()); dvo.setWsymb2(p.getValues().get(0).intValue());
responce.setDataVO(dvo); responce.setDataVO(dvo);
return responce; return responce;

View File

@ -4,22 +4,32 @@ import java.io.Serializable;
public class DataVO implements Serializable { public class DataVO implements Serializable {
int Wsymb2; int wsymb2;
double temp;
public DataVO() {} public DataVO() {}
public int getWsymb2() { public int getWsymb2() {
return Wsymb2; return wsymb2;
} }
public void setWsymb2(int 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 @Override
public String toString() { public String toString() {
return "DataVO{" + return "DataVO{" +
"Wsymb2=" + Wsymb2 + "wsymb2=" + wsymb2 +
", temp=" + temp +
'}'; '}';
} }
} }