Fehlermeldungen

This commit is contained in:
Maximilian Leopold 2019-05-14 12:14:31 +02:00
parent 2343b74796
commit c18cbeff51

View File

@ -236,11 +236,11 @@ public class Controller {
System.out.println(durchgefuehrterCache.getName()); System.out.println(durchgefuehrterCache.getName());
if (!cacheID.equals(durchgefuehrterCacheID)) { 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)) { 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(); Station aktuelleStation = bearbeitet.getAktuelleStation();
if (aktuelleStation == null) { 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); int i = cache.getStationen().indexOf(station);
if (i == 0) { 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)) { if (cache.getStationen().get(i - 1).equals(aktuelleStation)) {
@ -314,7 +314,7 @@ public class Controller {
bearbeitetRepository.save(bearbeitet); bearbeitetRepository.save(bearbeitet);
return ResponseEntity.status(200).body(new Gson().toJson(bearbeitet)); return ResponseEntity.status(200).body(new Gson().toJson(bearbeitet));
} else { } 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()); logger.debug("/api/getMyCaches Got all bearbeitet entreis of user: " +user.getEmail());
return ResponseEntity.status(200).body(new Gson().toJson(bearbeitetList)); return ResponseEntity.status(200).body(new Gson().toJson(bearbeitetList));
} else { } 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) { if (user != null) {
return ResponseEntity.status(200).body(new Gson().toJson(user)); return ResponseEntity.status(200).body(new Gson().toJson(user));
} else { } 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); User_Info user_info = user_infoRepository.findUser_InfoByUser(user);
//---------------------- //----------------------
if (user_info.getTeam() != null) { 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 // checkt, ob der name bereits vorhanden ist
for (Team team : teamRepository.findAll()) { for (Team team : teamRepository.findAll()) {
if (team.getName().equals(name)) { 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); User_Info user_info = user_infoRepository.findUser_InfoByUser(user);
//---------------------- //----------------------
if (user_info.getTeam() != null) { 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 //Get team
@ -647,7 +647,7 @@ public class Controller {
// wenn maximalanzahl der teammitglieder erreicht... // wenn maximalanzahl der teammitglieder erreicht...
if (user_infos.size() >= 10) { 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 // tritt dem team bei
@ -693,7 +693,7 @@ public class Controller {
User_Info user_info = user_infoRepository.findUser_InfoByUser(user); User_Info user_info = user_infoRepository.findUser_InfoByUser(user);
//---------------------- //----------------------
if (user_info.getTeam() == null) { 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 //Get team