added some TODO comments/thoughts to methods

This commit is contained in:
Michael 2019-04-17 07:54:56 +02:00
parent ca61861961
commit 3d10c6a906

View File

@ -60,6 +60,8 @@ public class Controller {
return ResponseEntity.status(200).body(new Gson().toJson(cacheRepository.findAll())); return ResponseEntity.status(200).body(new Gson().toJson(cacheRepository.findAll()));
} }
// TODO user muss jetzt anders aus dem token geholt werden, da kein subject mehr gesetzt wird und username nichtmehr unique ist
// TODO (über der checkAdmin methode steht ein möglicher lösungsvorschlag dafür)
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose @CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
@RequestMapping("/api/startCache") @RequestMapping("/api/startCache")
@ResponseBody @ResponseBody
@ -142,10 +144,7 @@ public class Controller {
} }
} }
/** // TODO user muss jetzt anders aus dem token geholt werden, da kein subject mehr gesetzt wird und username nichtmehr unique ist
* Checkt, ob die eingescannte Station die Nachfolgestation der zuletzt
* besuchten Stationen des aktuell durchgeführten Caches ist
*/
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose @CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
@RequestMapping("/api/checkStation") @RequestMapping("/api/checkStation")
@ResponseBody @ResponseBody
@ -281,7 +280,8 @@ public class Controller {
return createCacheUtil(cache); return createCacheUtil(cache);
} }
// TODO claims.get funktioniert denk ich jetzt nurnoch mit claims.get("user") und liefert glaub ein userEntity objekt als JSON zurück
// TODO wir könnten doch dann die email aus dem JSON auslesen und mit Hilfe einer findByEmail methode dann den user aus unserer DB finden oder?
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose @CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
@RequestMapping("/api/checkAdmin") @RequestMapping("/api/checkAdmin")
@ResponseBody @ResponseBody
@ -298,7 +298,6 @@ public class Controller {
return ResponseEntity.status(200).body(claims.get("admin")); return ResponseEntity.status(200).body(claims.get("admin"));
} }
//Bis hier
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose @CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
@RequestMapping("/api/getAllStations") @RequestMapping("/api/getAllStations")
@ResponseBody @ResponseBody
@ -313,6 +312,7 @@ public class Controller {
return deleteCacheUtil(cacheID); return deleteCacheUtil(cacheID);
} }
// TODO
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose @CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
@RequestMapping("/api/getMyCaches") @RequestMapping("/api/getMyCaches")
@ResponseBody @ResponseBody
@ -349,6 +349,9 @@ public class Controller {
} }
} }
// TODO SQL-Anfrage geschrieben, müssen uns nurnoch überlegen wie wir das ganze zurückgeben.
// TODO Da die Daten jetzt über mehrere Klassen verteilt sind, können wir nicht nur ein einzelnes Objekt zurückliefern.
// TODO Wäre eigentlich am Besten, wenn wir einfach das array zurückgeben, das frontend sollte ja ohne probleme daraus dann die Daten rausholen können.
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose @CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
@RequestMapping("/api/getRankingList") @RequestMapping("/api/getRankingList")
@ResponseBody @ResponseBody
@ -364,9 +367,13 @@ public class Controller {
sendBackUsers.add(u); sendBackUsers.add(u);
} }
/**
* return ResponseEntity.status(200).body(new Gson().toJson(userRepository.getRankingList()));
*/
return ResponseEntity.status(200).body(new Gson().toJson(sendBackUsers)); return ResponseEntity.status(200).body(new Gson().toJson(sendBackUsers));
} }
// TODO ebenfalls userfindung ändern
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose @CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
@RequestMapping("/api/getUser") @RequestMapping("/api/getUser")
@ResponseBody @ResponseBody