zwischenschritt

This commit is contained in:
Sven Alteköster 2024-01-11 12:10:07 +01:00
parent 2a3ac1498b
commit 042c78e0d4
5 changed files with 17 additions and 3 deletions

View File

@ -38,6 +38,11 @@
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -6,6 +6,8 @@
package RestAPISchnittstelle; package RestAPISchnittstelle;
import com.google.gson.Gson;
import java.net.URI; import java.net.URI;
import java.net.http.HttpClient; import java.net.http.HttpClient;
import java.net.http.HttpRequest; import java.net.http.HttpRequest;
@ -25,8 +27,7 @@ public class RestApiClient implements IRestAPI{
public static void main(String[] args){ public static void main(String[] args){
new RestApiClient().post("Benutzerkonto", "{\"name\":\"Sven\", \"email\":\"svenmail\", \"passwort\":\"5678765\", \"rid\":\"0\"}");
new RestApiClient().get("Kind", 2);
} }

View File

@ -9,6 +9,7 @@ import javafx.scene.layout.Background;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import com.google.gson.Gson;
import java.util.Random; import java.util.Random;
@ -127,6 +128,10 @@ public class AccounterstellungMitarbeiter {
String json = String.format("{\"name\":\"%s\", \"email\":\"%s\", \"passwort\":\"%d\", \"rid\":\"%d\"}", String json = String.format("{\"name\":\"%s\", \"email\":\"%s\", \"passwort\":\"%d\", \"rid\":\"%d\"}",
accountname.getText(), email.getText(), einmalpw.getText().hashCode(), (typMitarbeiter.isSelected() ? 0:1)); accountname.getText(), email.getText(), einmalpw.getText().hashCode(), (typMitarbeiter.isSelected() ? 0:1));
//Gson gson = new Gson();
//String jay = gson.toJson(this);
System.out.println(json); System.out.println(json);
RestApiClient api = new RestApiClient(); RestApiClient api = new RestApiClient();
api.post("Benutzerkonto", json); api.post("Benutzerkonto", json);

View File

@ -41,7 +41,9 @@ public class EssensverwaltungMitarbeiterView {
} }
public void onFilter(ActionEvent actionEvent) { public void onFilter(ActionEvent actionEvent) {
VerwaltungApplication.sceneWechseln(new Stage(), 600, 400, "inhaltsstoffe_filtern-view.fxml"); Stage stage = new Stage();
VerwaltungApplication.sceneWechseln(stage, 450, 400, "inhaltsstoffe_filtern-view.fxml");
} }
public void onHinzufuegen(ActionEvent actionEvent) { public void onHinzufuegen(ActionEvent actionEvent) {

View File

@ -2,6 +2,7 @@ module de.subway_surfers.vpr_app {
requires javafx.controls; requires javafx.controls;
requires javafx.fxml; requires javafx.fxml;
requires java.net.http; requires java.net.http;
requires com.google.gson;
opens de.subway_surfers.vpr_app to javafx.fxml; opens de.subway_surfers.vpr_app to javafx.fxml;