From 8540dc08e8e5b8134077431c88bef88e374de6e5 Mon Sep 17 00:00:00 2001 From: danai Date: Sat, 15 Jun 2024 17:34:22 +0200 Subject: [PATCH] Nicht ganze Implementierung --- TravelBuddyApp/dependency-reduced-pom.xml | 124 ++++++++++++++++++ TravelBuddyApp/src/main/java/domain/Auto.java | 30 +++-- TravelBuddyApp/src/main/java/domain/Ort.java | 53 ++++++-- TravelBuddyApp/users.txt | 0 4 files changed, 189 insertions(+), 18 deletions(-) create mode 100644 TravelBuddyApp/dependency-reduced-pom.xml create mode 100644 TravelBuddyApp/users.txt diff --git a/TravelBuddyApp/dependency-reduced-pom.xml b/TravelBuddyApp/dependency-reduced-pom.xml new file mode 100644 index 0000000..75cd7d4 --- /dev/null +++ b/TravelBuddyApp/dependency-reduced-pom.xml @@ -0,0 +1,124 @@ + + + 4.0.0 + hs-mannheim.de + TravelBuddyApp + 0.0.1-SNAPSHOT + + + + maven-compiler-plugin + 3.8.1 + + ${maven.compiler.source} + ${maven.compiler.target} + + + + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + de.hs_mannheim.informatik.mvn.Main + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + + prepare-agent + + + + report + test + + report + + + + + + maven-pmd-plugin + 3.22.0 + + + verify + + check + + + + + + org.owasp + dependency-check-maven + 9.2.0 + + + + check + + + + + + + + + org.junit.jupiter + junit-jupiter-api + 5.8.1 + test + + + opentest4j + org.opentest4j + + + junit-platform-commons + org.junit.platform + + + apiguardian-api + org.apiguardian + + + + + org.junit.jupiter + junit-jupiter-engine + 5.8.1 + test + + + junit-platform-engine + org.junit.platform + + + apiguardian-api + org.apiguardian + + + + + + 21 + 21 + UTF-8 + + diff --git a/TravelBuddyApp/src/main/java/domain/Auto.java b/TravelBuddyApp/src/main/java/domain/Auto.java index df73876..819ef57 100644 --- a/TravelBuddyApp/src/main/java/domain/Auto.java +++ b/TravelBuddyApp/src/main/java/domain/Auto.java @@ -3,13 +3,27 @@ package domain; public class Auto { private String name; - private double co2AusstossProKm; + private double co2AusstossProKm; + + public Auto(String name, double co2AusstossProKm) { + this.name = name; + this.co2AusstossProKm = co2AusstossProKm; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public double getCO2AusstossProKm() { + return co2AusstossProKm; + } + + public void setCO2AusstossProKm(double co2AusstossProKm) { + this.co2AusstossProKm = co2AusstossProKm; + } - - public Auto(String name, double co2AusstossProKm) { - this.name = name; - this.co2AusstossProKm = co2AusstossProKm; - } - - } diff --git a/TravelBuddyApp/src/main/java/domain/Ort.java b/TravelBuddyApp/src/main/java/domain/Ort.java index f04877a..75b13a1 100644 --- a/TravelBuddyApp/src/main/java/domain/Ort.java +++ b/TravelBuddyApp/src/main/java/domain/Ort.java @@ -1,20 +1,53 @@ package domain; +import java.io.IOException; + public class Ort { private String plz; - private String name; - - + private String OrtName; + public Ort(String plz, String name) { - this.plz = plz; - this.name = name; - } - + this.plz = plz; + this.OrtName = name; + } + + public String getPLZ() { + return plz; + } + + public void setPLZ(String plz) { + this.plz = plz; + } + + public String getOrtName() { + return OrtName; + } + + public void setName(String name) { + this.OrtName = name; + } + + @Override + public String toString() { + return OrtName + " (" + plz + ")"; + } + + public String getAktuellesWetter() { + try { + return WetterService.getAktuellesWetter(OrtName); + } catch (IOException | InterruptedException e) { + e.printStackTrace(); + return "Fehler beim Abrufen des aktuellen Wetters"; + } + } public String getWettervorhersage() { - - - return "Wettervorhersage"; + try { + return WetterService.getWettervorhersage(OrtName); + } catch (IOException | InterruptedException e) { + e.printStackTrace(); + return "Fehler beim Abrufen der Wettervorhersage"; + } } } diff --git a/TravelBuddyApp/users.txt b/TravelBuddyApp/users.txt new file mode 100644 index 0000000..e69de29