From c18cbeff51cdceab0277e1aa4ffbf0abedc40703 Mon Sep 17 00:00:00 2001 From: Maximilian Leopold Date: Tue, 14 May 2019 12:14:31 +0200 Subject: [PATCH] Fehlermeldungen --- .../bugageocaching/controller/Controller.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java b/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java index 4bbd3cf..67dd857 100644 --- a/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java +++ b/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java @@ -236,11 +236,11 @@ public class Controller { System.out.println(durchgefuehrterCache.getName()); if (!cacheID.equals(durchgefuehrterCacheID)) { - return ResponseEntity.status(400).body("The scanned station isn´t the correct following station (Name)"); + return ResponseEntity.status(400).body("Die gescannte Station ist nicht die korrekte nachfolge Station"); } if (!cache.getStationen().contains(station)) { - return ResponseEntity.status(400).body("The scanned station isnt a part of the cache"); + return ResponseEntity.status(400).body("Die gescannte Station gehört nicht zu dem gerade bearbeiteten Cache"); } //---------------------- @@ -281,13 +281,13 @@ public class Controller { Station aktuelleStation = bearbeitet.getAktuelleStation(); if (aktuelleStation == null) { - return ResponseEntity.status(400).body("Database Error"); + return ResponseEntity.status(400).body("Es gab einen Fehler. Bitte versuche es erneut oder kontaktiere einen Admin"); } int i = cache.getStationen().indexOf(station); if (i == 0) { - return ResponseEntity.status(400).body("The scanned station isn´t the correct following station (i==0)"); + return ResponseEntity.status(400).body("Die gescannte Station ist nicht die korrekte nachfolge Station"); } if (cache.getStationen().get(i - 1).equals(aktuelleStation)) { @@ -314,7 +314,7 @@ public class Controller { bearbeitetRepository.save(bearbeitet); return ResponseEntity.status(200).body(new Gson().toJson(bearbeitet)); } else { - return ResponseEntity.status(400).body("The scanned station isn´t the correct following station(nicht letzte)"); + return ResponseEntity.status(400).body("Die gescannte Station ist nicht die korrekte nachfolge Station"); } } @@ -451,7 +451,7 @@ public class Controller { logger.debug("/api/getMyCaches Got all bearbeitet entreis of user: " +user.getEmail()); return ResponseEntity.status(200).body(new Gson().toJson(bearbeitetList)); } else { - return ResponseEntity.status(404).body("User was not found in the database"); + return ResponseEntity.status(404).body("Es gab einen Fehler. Bitte versuche es erneut oder kontaktiere einen Admin!"); } } @@ -530,7 +530,7 @@ public class Controller { if (user != null) { return ResponseEntity.status(200).body(new Gson().toJson(user)); } else { - return ResponseEntity.status(404).body("User was not found in the database"); + return ResponseEntity.status(404).body("Es gab einen Fehler. Bitte versuche es erneut oder kontaktiere einen Admin!e"); } } @@ -567,13 +567,13 @@ public class Controller { User_Info user_info = user_infoRepository.findUser_InfoByUser(user); //---------------------- if (user_info.getTeam() != null) { - return ResponseEntity.status(400).body("You already have a team"); + return ResponseEntity.status(400).body("Du bist bereits in einem Team. Bitte verlasse dieses Team um ein neues Team zu erstellen!"); } // checkt, ob der name bereits vorhanden ist for (Team team : teamRepository.findAll()) { if (team.getName().equals(name)) { - return ResponseEntity.status(400).body("The teamname is already taken"); + return ResponseEntity.status(400).body("Der Teamname ist bereits vergeben. Bitte wähle einen anderen name"); } } @@ -622,7 +622,7 @@ public class Controller { User_Info user_info = user_infoRepository.findUser_InfoByUser(user); //---------------------- if (user_info.getTeam() != null) { - return ResponseEntity.status(400).body("You already have a team"); + return ResponseEntity.status(400).body("Du bist bereits in einem Team. Bitte verlasse dieses Team um einem neuen Team beizutreten"); } //Get team @@ -647,7 +647,7 @@ public class Controller { // wenn maximalanzahl der teammitglieder erreicht... if (user_infos.size() >= 10) { - return ResponseEntity.status(400).body("The team already has 10 members"); + return ResponseEntity.status(400).body("Das Team hat die Mitgliederanzahlgrenze von 10 Mitgliedern erreicht. Du kannst zurzeit nicht beitreten!"); } // tritt dem team bei @@ -693,7 +693,7 @@ public class Controller { User_Info user_info = user_infoRepository.findUser_InfoByUser(user); //---------------------- if (user_info.getTeam() == null) { - return ResponseEntity.status(400).body("You aren´t in any team"); + return ResponseEntity.status(400).body("Du bist bereits in keinem Team, welches du verlassen könntest."); } //Get team