added comments
This commit is contained in:
parent
5bf05616c8
commit
99d29ffdec
@ -148,6 +148,7 @@ public class Controller {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity createCache(@RequestBody Cache cache) {
|
public ResponseEntity createCache(@RequestBody Cache cache) {
|
||||||
|
|
||||||
|
// Stationen werden in die Datenbank eingetragen
|
||||||
for (Station station : cache.getStationen()) {
|
for (Station station : cache.getStationen()) {
|
||||||
ResponseEntity response = createStation(station);
|
ResponseEntity response = createStation(station);
|
||||||
if (response.getStatusCodeValue() == 400) {
|
if (response.getStatusCodeValue() == 400) {
|
||||||
@ -156,6 +157,7 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Caches werden in die Datenbank eingetragen
|
||||||
if (cache.getDescription().length() == 0 || cache.getName().length() == 0 || cache.getRankingPoints() == 0.0 || cache.getStationen().size() == 0) {
|
if (cache.getDescription().length() == 0 || cache.getName().length() == 0 || cache.getRankingPoints() == 0.0 || cache.getStationen().size() == 0) {
|
||||||
deleteStationen(cache);
|
deleteStationen(cache);
|
||||||
return ResponseEntity.status(400).body("cache fields can´t be empty");
|
return ResponseEntity.status(400).body("cache fields can´t be empty");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user