Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5d455c6291 | ||
93512fa4fa | |||
|
1d9070551e | ||
|
cf9ba3d3f9 | ||
8ed1085e40 | |||
72412b3b47 | |||
|
fd36d1ab97 |
@ -1 +1 @@
|
|||||||
HelloController.java
|
Essensverwaltung.java
|
20
pom.xml
20
pom.xml
@ -76,6 +76,26 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<transformers>
|
||||||
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
|
<mainClass>de.subway_surfers.vpr_app.Main</mainClass>
|
||||||
|
</transformer>
|
||||||
|
</transformers>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
@ -5,6 +5,10 @@ package Logik;
|
|||||||
|
|
||||||
import RestAPISchnittstelle.RestApiClient;
|
import RestAPISchnittstelle.RestApiClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sven Alteköster und Samuel Wolff
|
||||||
|
*/
|
||||||
|
|
||||||
public class Account {
|
public class Account {
|
||||||
|
|
||||||
// region Felder
|
// region Felder
|
||||||
|
@ -9,6 +9,9 @@ package Logik;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Samuel Wolff
|
||||||
|
*/
|
||||||
public class ElternAccount extends Account {
|
public class ElternAccount extends Account {
|
||||||
|
|
||||||
// region Felder
|
// region Felder
|
||||||
@ -37,6 +40,7 @@ public class ElternAccount extends Account {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Lädt eine Rechnung herunter
|
* Lädt eine Rechnung herunter
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void rechnungHerunterladen() {
|
public void rechnungHerunterladen() {
|
||||||
|
|
||||||
@ -44,6 +48,7 @@ public class ElternAccount extends Account {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Bestellt eine Mahlzeit
|
* Bestellt eine Mahlzeit
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void mahlzeitBestellen() {
|
public void mahlzeitBestellen() {
|
||||||
|
|
||||||
@ -52,6 +57,7 @@ public class ElternAccount extends Account {
|
|||||||
/**
|
/**
|
||||||
* Zeigt Rechnungen gefiltert an
|
* Zeigt Rechnungen gefiltert an
|
||||||
* @param params Die Filter Argumente
|
* @param params Die Filter Argumente
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void rechnungAnzeigen(String params) {
|
public void rechnungAnzeigen(String params) {
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@ package Logik;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Samuel Wolff und Sven Alteköster
|
||||||
|
*/
|
||||||
public class Kind {
|
public class Kind {
|
||||||
|
|
||||||
// region Felder
|
// region Felder
|
||||||
|
@ -2,6 +2,9 @@ package Logik;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sven Alteköster
|
||||||
|
*/
|
||||||
public class Mahlzeit {
|
public class Mahlzeit {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
|
@ -9,6 +9,9 @@ package Logik;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Samuel Wolff
|
||||||
|
*/
|
||||||
public class MitarbeiterAccount extends Account {
|
public class MitarbeiterAccount extends Account {
|
||||||
|
|
||||||
// region Konstrukoren
|
// region Konstrukoren
|
||||||
@ -25,12 +28,12 @@ public class MitarbeiterAccount extends Account {
|
|||||||
* @param passwort Das neue Passwort
|
* @param passwort Das neue Passwort
|
||||||
*/
|
*/
|
||||||
public void passwortZurzecksetzen(Account other, String passwort) {
|
public void passwortZurzecksetzen(Account other, String passwort) {
|
||||||
// Soll das so?
|
|
||||||
other.setPasswort(passwort);
|
other.setPasswort(passwort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bestellt eine Mahlzeit
|
* Bestellt eine Mahlzeit
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void mahlzeitBestellen() {
|
public void mahlzeitBestellen() {
|
||||||
|
|
||||||
@ -38,6 +41,7 @@ public class MitarbeiterAccount extends Account {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Ändert einen Tagesplan
|
* Ändert einen Tagesplan
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void tagesplanAendern() {
|
public void tagesplanAendern() {
|
||||||
|
|
||||||
@ -59,25 +63,24 @@ public class MitarbeiterAccount extends Account {
|
|||||||
/**
|
/**
|
||||||
* Zeigt Rechnungen gefilter nach params an
|
* Zeigt Rechnungen gefilter nach params an
|
||||||
* @param params Die Filter Arguemente
|
* @param params Die Filter Arguemente
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void rechnungAnzeigen(String[] params) {
|
public void rechnungAnzeigen(String[] params) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO sollte hier nicht noch ein User mitgegeben werden?
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weist ein Kind einem Account zu
|
* Weist ein Kind einem Account zu
|
||||||
* @param kind Das zuzuweisende Kind
|
* @param kind Das zuzuweisende Kind
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void kinderZuweisen(Kind kind) {
|
public void kinderZuweisen(Kind kind) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO hier auch?
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Zeigt einen Benutzer an
|
* Zeigt einen Benutzer an
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void zeigeBenutzer() {
|
public void zeigeBenutzer() {
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@ package Logik;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sven Alteköster
|
||||||
|
*/
|
||||||
public class Tagesplan {
|
public class Tagesplan {
|
||||||
|
|
||||||
private ArrayList<Mahlzeit> gerichte;
|
private ArrayList<Mahlzeit> gerichte;
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package Logik;
|
package Logik;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sven Alteköster
|
||||||
|
*/
|
||||||
public class Zutat {
|
public class Zutat {
|
||||||
private String name;
|
private String name;
|
||||||
public Zutat (String name) {
|
public Zutat (String name) {
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
|
|
||||||
package RestAPISchnittstelle;
|
package RestAPISchnittstelle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Samuel Wolff
|
||||||
|
*/
|
||||||
public interface IRestAPI {
|
public interface IRestAPI {
|
||||||
|
|
||||||
// region Get
|
// region Get
|
||||||
|
@ -34,19 +34,6 @@ public class RestApiClient implements IRestAPI{
|
|||||||
gson = new Gson();
|
gson = new Gson();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args){
|
|
||||||
|
|
||||||
RestApiClient client1 = new RestApiClient();
|
|
||||||
|
|
||||||
client1.delete("Kind", 15);
|
|
||||||
|
|
||||||
|
|
||||||
Tagesplan t = client1.getGerichteOnTag("2023-12-17");
|
|
||||||
|
|
||||||
for(Mahlzeit m : t.getGerichte())
|
|
||||||
System.out.println(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Methode für einen Get-Aufruf. Ruft alle Elemente einer Tabelle auf.
|
* Methode für einen Get-Aufruf. Ruft alle Elemente einer Tabelle auf.
|
||||||
*
|
*
|
||||||
@ -68,8 +55,8 @@ public class RestApiClient implements IRestAPI{
|
|||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
return httpResponse.body();
|
return httpResponse.body();
|
||||||
}
|
}
|
||||||
catch(ConnectException conex){
|
catch(ConnectException conex){
|
||||||
@ -106,7 +93,7 @@ public class RestApiClient implements IRestAPI{
|
|||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode() + httpResponse.body());
|
// System.out.println("Status Code: " + httpResponse.statusCode() + httpResponse.body());
|
||||||
|
|
||||||
return httpResponse.body();
|
return httpResponse.body();
|
||||||
|
|
||||||
@ -149,8 +136,8 @@ public class RestApiClient implements IRestAPI{
|
|||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
return httpResponse.body();
|
return httpResponse.body();
|
||||||
}
|
}
|
||||||
catch(ConnectException conex){
|
catch(ConnectException conex){
|
||||||
@ -191,8 +178,8 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode() + httpResponse.body());
|
// System.out.println("Status Code: " + httpResponse.statusCode() + httpResponse.body());
|
||||||
|
|
||||||
return httpResponse.body();
|
return httpResponse.body();
|
||||||
|
|
||||||
@ -234,9 +221,9 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
}
|
}
|
||||||
catch(ConnectException conex){
|
catch(ConnectException conex){
|
||||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||||
@ -259,7 +246,7 @@ public class RestApiClient implements IRestAPI{
|
|||||||
public void post(String controllerName, String jsonData) {
|
public void post(String controllerName, String jsonData) {
|
||||||
URI apiUri = URI.create(String.format("%s/%s", urlBase,controllerName));
|
URI apiUri = URI.create(String.format("%s/%s", urlBase,controllerName));
|
||||||
|
|
||||||
System.out.println(apiUri);
|
//System.out.println(apiUri);
|
||||||
|
|
||||||
HttpRequest httpRequest = HttpRequest.newBuilder()
|
HttpRequest httpRequest = HttpRequest.newBuilder()
|
||||||
.timeout(Duration.ofSeconds(timeout))
|
.timeout(Duration.ofSeconds(timeout))
|
||||||
@ -272,9 +259,9 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
}
|
}
|
||||||
catch(ConnectException conex){
|
catch(ConnectException conex){
|
||||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||||
@ -297,7 +284,7 @@ public class RestApiClient implements IRestAPI{
|
|||||||
public void delete(String controllerName, int id) {
|
public void delete(String controllerName, int id) {
|
||||||
URI apiUri = URI.create(String.format("%s/%s/%d", urlBase,controllerName, id));
|
URI apiUri = URI.create(String.format("%s/%s/%d", urlBase,controllerName, id));
|
||||||
|
|
||||||
System.out.println(apiUri);
|
//System.out.println(apiUri);
|
||||||
|
|
||||||
HttpRequest httpRequest = HttpRequest.newBuilder()
|
HttpRequest httpRequest = HttpRequest.newBuilder()
|
||||||
.timeout(Duration.ofSeconds(timeout))
|
.timeout(Duration.ofSeconds(timeout))
|
||||||
@ -310,9 +297,9 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
}
|
}
|
||||||
catch(ConnectException conex){
|
catch(ConnectException conex){
|
||||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||||
@ -343,9 +330,9 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
|
|
||||||
JsonElement jsonElement = JsonParser.parseString(httpResponse.body());
|
JsonElement jsonElement = JsonParser.parseString(httpResponse.body());
|
||||||
JsonArray jsonArray = jsonElement.getAsJsonArray();
|
JsonArray jsonArray = jsonElement.getAsJsonArray();
|
||||||
@ -384,7 +371,7 @@ public class RestApiClient implements IRestAPI{
|
|||||||
passwort = passwort.substring(1, passwort.length()-1);
|
passwort = passwort.substring(1, passwort.length()-1);
|
||||||
|
|
||||||
URI apiUri = URI.create(String.format("%s/Benutzer/anmeldeVersuch?Benutzername=%s&passwort=%s", urlBase, benutzer, passwort));
|
URI apiUri = URI.create(String.format("%s/Benutzer/anmeldeVersuch?Benutzername=%s&passwort=%s", urlBase, benutzer, passwort));
|
||||||
System.out.println(apiUri);
|
//System.out.println(apiUri);
|
||||||
HttpRequest httpRequest = HttpRequest.newBuilder()
|
HttpRequest httpRequest = HttpRequest.newBuilder()
|
||||||
.timeout(Duration.ofSeconds(timeout))
|
.timeout(Duration.ofSeconds(timeout))
|
||||||
.uri(apiUri)
|
.uri(apiUri)
|
||||||
@ -396,9 +383,9 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
if(httpResponse.body().equals("true"))
|
if(httpResponse.body().equals("true"))
|
||||||
return true;
|
return true;
|
||||||
else{
|
else{
|
||||||
@ -434,7 +421,7 @@ public class RestApiClient implements IRestAPI{
|
|||||||
public Tagesplan getGerichteOnTag(String datum){
|
public Tagesplan getGerichteOnTag(String datum){
|
||||||
|
|
||||||
URI apiUri = URI.create(String.format("%s/Tagesplan/getGerichteOnTag?datum=%s", urlBase, datum));
|
URI apiUri = URI.create(String.format("%s/Tagesplan/getGerichteOnTag?datum=%s", urlBase, datum));
|
||||||
System.out.println(apiUri);
|
//System.out.println(apiUri);
|
||||||
HttpRequest httpRequest = HttpRequest.newBuilder()
|
HttpRequest httpRequest = HttpRequest.newBuilder()
|
||||||
.timeout(Duration.ofSeconds(timeout))
|
.timeout(Duration.ofSeconds(timeout))
|
||||||
.uri(apiUri)
|
.uri(apiUri)
|
||||||
@ -446,9 +433,9 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
|
|
||||||
Tagesplan t = new Tagesplan(datum);
|
Tagesplan t = new Tagesplan(datum);
|
||||||
|
|
||||||
@ -492,7 +479,7 @@ public class RestApiClient implements IRestAPI{
|
|||||||
public int getGerichtIdOnTag(String name, String datum){
|
public int getGerichtIdOnTag(String name, String datum){
|
||||||
|
|
||||||
URI apiUri = URI.create(String.format("%s/Tagesplan/getGerichtIdOnTag?name=%s&datum=%s", urlBase, name, datum));
|
URI apiUri = URI.create(String.format("%s/Tagesplan/getGerichtIdOnTag?name=%s&datum=%s", urlBase, name, datum));
|
||||||
System.out.println(apiUri);
|
//System.out.println(apiUri);
|
||||||
HttpRequest httpRequest = HttpRequest.newBuilder()
|
HttpRequest httpRequest = HttpRequest.newBuilder()
|
||||||
.uri(apiUri)
|
.uri(apiUri)
|
||||||
.header("Content-Type", "application/json")
|
.header("Content-Type", "application/json")
|
||||||
@ -503,9 +490,9 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Response Body: " + httpResponse.body());
|
// System.out.println("Response Body: " + httpResponse.body());
|
||||||
|
|
||||||
JsonElement jsonElement = JsonParser.parseString(httpResponse.body());
|
JsonElement jsonElement = JsonParser.parseString(httpResponse.body());
|
||||||
|
|
||||||
@ -528,7 +515,7 @@ public class RestApiClient implements IRestAPI{
|
|||||||
*/
|
*/
|
||||||
public void deleteGericht(int id){
|
public void deleteGericht(int id){
|
||||||
URI apiUri = URI.create(String.format("%s/Tagesplan/%d", urlBase, id));
|
URI apiUri = URI.create(String.format("%s/Tagesplan/%d", urlBase, id));
|
||||||
System.out.println(apiUri);
|
//System.out.println(apiUri);
|
||||||
HttpRequest httpRequest = HttpRequest.newBuilder()
|
HttpRequest httpRequest = HttpRequest.newBuilder()
|
||||||
.uri(apiUri)
|
.uri(apiUri)
|
||||||
.header("Content-Type", "application/json")
|
.header("Content-Type", "application/json")
|
||||||
@ -539,9 +526,9 @@ public class RestApiClient implements IRestAPI{
|
|||||||
// Send the request and get the response
|
// Send the request and get the response
|
||||||
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
// Print the response status code and body
|
// // Print the response status code and body
|
||||||
System.out.println("Status Code: " + httpResponse.statusCode());
|
// System.out.println("Status Code: " + httpResponse.statusCode());
|
||||||
System.out.println("Delete Gericht: Response Body: " + httpResponse.body());
|
// System.out.println("Delete Gericht: Response Body: " + httpResponse.body());
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -195,7 +195,6 @@ public class AccounterstellungMitarbeiter {
|
|||||||
*/
|
*/
|
||||||
public void onSpeichern(ActionEvent actionEvent) {
|
public void onSpeichern(ActionEvent actionEvent) {
|
||||||
if (eingabenGueltig()) {
|
if (eingabenGueltig()) {
|
||||||
|
|
||||||
//speichert das aktuelle Passwort zwischen
|
//speichert das aktuelle Passwort zwischen
|
||||||
String passwort = einmalpw.getText();
|
String passwort = einmalpw.getText();
|
||||||
|
|
||||||
@ -236,9 +235,6 @@ public class AccounterstellungMitarbeiter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Die Liste, zum Speichern der gespeicherten Liste wird zurückgesetzt, da die Kinder jetzt im Elternobjekt gespeichert werden
|
|
||||||
kinder.clear();
|
|
||||||
|
|
||||||
//Das Elternelement wird in der DB gespeichert, wenn es keinen gleichnamigen Account gibt.
|
//Das Elternelement wird in der DB gespeichert, wenn es keinen gleichnamigen Account gibt.
|
||||||
if (!kontoVorhanden) {
|
if (!kontoVorhanden) {
|
||||||
api.post("Benutzer", gson.toJson(neuer));
|
api.post("Benutzer", gson.toJson(neuer));
|
||||||
@ -250,7 +246,19 @@ public class AccounterstellungMitarbeiter {
|
|||||||
for (Kind k : ((ElternAccount)neuer).getKinder()) {
|
for (Kind k : ((ElternAccount)neuer).getKinder()) {
|
||||||
//setzen des Fremdschlüssels bid
|
//setzen des Fremdschlüssels bid
|
||||||
k.setBid(id);
|
k.setBid(id);
|
||||||
api.post("Kind", gson.toJson(k));
|
String neues = gson.toJson(k);
|
||||||
|
|
||||||
|
//region hässlich
|
||||||
|
neues = neues.replaceAll("ä", "ae");
|
||||||
|
neues = neues.replaceAll("ö", "oe");
|
||||||
|
neues = neues.replaceAll("ü", "ue");
|
||||||
|
neues = neues.replaceAll("Ä", "Ae");
|
||||||
|
neues = neues.replaceAll("Ö", "Oe");
|
||||||
|
neues = neues.replaceAll("Ü", "Ue");
|
||||||
|
neues = neues.replaceAll("ß", "ss");
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
api.post("Kind", neues);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
status.setText("Daten Erfolgreich gespeichert");
|
status.setText("Daten Erfolgreich gespeichert");
|
||||||
|
@ -92,10 +92,10 @@ public class EssensverwaltungMitarbeiterView {
|
|||||||
//solange das neu geöffnete Fenster offen ist, wird das Hauptfenster gesperrt
|
//solange das neu geöffnete Fenster offen ist, wird das Hauptfenster gesperrt
|
||||||
gerichterstellung.initModality(Modality.APPLICATION_MODAL);
|
gerichterstellung.initModality(Modality.APPLICATION_MODAL);
|
||||||
|
|
||||||
VerwaltungApplication.sceneWechseln(gerichterstellung, 450, 600, "gerichterstellung_mitarbeiter-view.fxml");
|
VerwaltungApplication.sceneWechseln(gerichterstellung, 500, 700, "gerichterstellung_mitarbeiter-view.fxml");
|
||||||
|
|
||||||
gerichterstellung.minWidthProperty().set(450);
|
gerichterstellung.minWidthProperty().set(500);
|
||||||
gerichterstellung.minHeightProperty().set(600);
|
gerichterstellung.minHeightProperty().set(700);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -231,7 +231,7 @@ public class EssensverwaltungMitarbeiterView {
|
|||||||
|
|
||||||
t.getGerichte().remove(col);
|
t.getGerichte().remove(col);
|
||||||
|
|
||||||
System.out.println("Die Id lautet: " + id + col);
|
//System.out.println("Die Id lautet: " + id + col);
|
||||||
|
|
||||||
cl.delete("GibtsAm", id);
|
cl.delete("GibtsAm", id);
|
||||||
initGerichte();
|
initGerichte();
|
||||||
|
@ -36,7 +36,7 @@ public class GerichterstellungMitarbeiterView {
|
|||||||
public void initialize() {
|
public void initialize() {
|
||||||
zutaten = new ArrayList<>();
|
zutaten = new ArrayList<>();
|
||||||
mahlzeiten = new ArrayList<>();
|
mahlzeiten = new ArrayList<>();
|
||||||
|
datePicker.setEditable(false);
|
||||||
//Liste mit Daten füllen
|
//Liste mit Daten füllen
|
||||||
mahlzeiten = getMahlzeiten();
|
mahlzeiten = getMahlzeiten();
|
||||||
for (Mahlzeit m : mahlzeiten) {
|
for (Mahlzeit m : mahlzeiten) {
|
||||||
@ -200,13 +200,15 @@ public class GerichterstellungMitarbeiterView {
|
|||||||
Mahlzeit mahlzeit = new Mahlzeit(eingabe, preis, beschreibung);
|
Mahlzeit mahlzeit = new Mahlzeit(eingabe, preis, beschreibung);
|
||||||
mahlzeiten.add(mahlzeit);
|
mahlzeiten.add(mahlzeit);
|
||||||
status.setText("Mahlzeit hinzugefügt");
|
status.setText("Mahlzeit hinzugefügt");
|
||||||
resetEingabeFelder();
|
|
||||||
|
|
||||||
int datumId = datumBearbeiten(datum);
|
int datumId = datumBearbeiten(datum);
|
||||||
int gerichtId = gerichteAbfragen(mahlzeit);
|
int gerichtId = gerichteAbfragen(mahlzeit);
|
||||||
|
|
||||||
inhaltsstoff(gerichtId);
|
inhaltsstoff(gerichtId);
|
||||||
gibtsAm(gerichtId, datumId);
|
gibtsAm(gerichtId, datumId);
|
||||||
|
mahlzeiten.clear();
|
||||||
|
mahlzeiten = getMahlzeiten();
|
||||||
|
aktualisiereListView("");
|
||||||
|
resetEingabeFelder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -233,6 +235,8 @@ public class GerichterstellungMitarbeiterView {
|
|||||||
eingabeBeschreibung.setText("");
|
eingabeBeschreibung.setText("");
|
||||||
eingabePreis.setText("");
|
eingabePreis.setText("");
|
||||||
eingabeInhaltsstoffe.setText("");
|
eingabeInhaltsstoffe.setText("");
|
||||||
|
zutaten.clear();
|
||||||
|
anzeigeInhaltsstoffe.getChildren().clear();
|
||||||
datePicker.setValue(null);
|
datePicker.setValue(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
src/main/java/de/subway_surfers/vpr_app/Main.java
Normal file
8
src/main/java/de/subway_surfers/vpr_app/Main.java
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package de.subway_surfers.vpr_app;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
VerwaltungApplication.main(args);
|
||||||
|
}
|
||||||
|
}
|
@ -1,44 +0,0 @@
|
|||||||
package de.subway_surfers.vpr_app.logik;
|
|
||||||
|
|
||||||
import Logik.Zutat;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class Kind {
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
private String vorname;
|
|
||||||
private int id;
|
|
||||||
private ArrayList<Zutat> filter;
|
|
||||||
|
|
||||||
public Kind(String name, String vorname, int id) {
|
|
||||||
ArrayList<Zutat> filter = new ArrayList<>();
|
|
||||||
this.name = name;
|
|
||||||
this.vorname = vorname;
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVorname() {
|
|
||||||
return vorname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVorname(String vorname) {
|
|
||||||
this.vorname = vorname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Zutat> getFilter() {
|
|
||||||
return filter;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user