added comments

This commit is contained in:
Michael 2019-04-05 15:45:53 +02:00
parent 5bf05616c8
commit 99d29ffdec

View File

@ -148,6 +148,7 @@ public class Controller {
@ResponseBody
public ResponseEntity createCache(@RequestBody Cache cache) {
// Stationen werden in die Datenbank eingetragen
for (Station station : cache.getStationen()) {
ResponseEntity response = createStation(station);
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) {
deleteStationen(cache);
return ResponseEntity.status(400).body("cache fields can´t be empty");