modified checkStation
This commit is contained in:
parent
ff7ddde5ee
commit
d14a4b5d86
@ -232,6 +232,16 @@ public class Controller {
|
||||
|
||||
if (cache.getStationen().get(i - 1).equals(aktuelleStation)) {
|
||||
bearbeitet.setAktuelleStation(station);
|
||||
if (i == cache.getStationen().size() - 1) { // letze Station erreicht
|
||||
Optional<CacheAccesDefinition> cacheAccesDefinitionOptional =
|
||||
cacheAccesDefinitionRepository.findById(1); // abgeschlossen
|
||||
if (cacheAccesDefinitionOptional.isPresent()) {
|
||||
CacheAccesDefinition cacheAccesDefinition = cacheAccesDefinitionOptional.get();
|
||||
bearbeitet.setCacheAccesDefinition(cacheAccesDefinition);
|
||||
} else {
|
||||
return ResponseEntity.status(404).body("There is no cacheAccesDefinition with the ID " + 1);
|
||||
}
|
||||
}
|
||||
return ResponseEntity.status(200).body(new Gson().toJson(station));
|
||||
} else {
|
||||
return ResponseEntity.status(400).body("The scanned station isn´t the correct following station");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user