From 7cfae185523217a396b4c23a799c433d2d1198a4 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 23 Apr 2019 15:44:09 +0200 Subject: [PATCH] added another error message --- .../java/hhn/labsw/bugageocaching/controller/Controller.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java b/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java index 147aefa..6cbad26 100644 --- a/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java +++ b/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java @@ -231,6 +231,9 @@ public class Controller { int i = cache.getStationen().indexOf(station); + if (i == 0) { + return ResponseEntity.status(400).body("The scanned station isn“t the correct following station"); + } if (cache.getStationen().get(i - 1).equals(aktuelleStation)) { bearbeitet.setAktuelleStation(station); @@ -398,7 +401,7 @@ public class Controller { } @RequestMapping("/api/hello") - public ResponseEntity hello(@RequestParam String name){ + public ResponseEntity hello(@RequestParam String name) { return ResponseEntity.status(200).body(userRepository.getRankingPlaceFromUser(name)); } }