Package com.hildeio.controller
Class IoKontaktController
java.lang.Object
com.hildeio.controller.IoKontaktController
REST-API zur Aenderung der Stati von Tuer- und Fensterkontakten.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Pruefen der aktuellen Stati und ggfs.createKontakt
(IoKontaktModel ioKontakteModel) Neuen Kontakt mit Status in Firestore-Collection ioKontakte anlegen.deleteKontakt
(String iseId) Kontakt {iseId} aus Firestore-Collection ioKontakte loeschen.getKontakt
(String iseId) Aktueller Status von Kontakt {iseId} aus Firestore-Collection ioKontakte.updateKontakt
(IoKontaktModel ioKontakteModel) Status von Kontakt in Firestore-Collection ioKontake aktualisieren.
-
Field Details
-
ioKontakteService
Instanzvariable für Service
-
-
Constructor Details
-
IoKontaktController
Konstruktor- Parameters:
ioKontakteService
- Logik-Instanz der API.
-
-
Method Details
-
getKontakt
@GetMapping("/get/{iseId}") public IoKontaktModel getKontakt(@PathVariable String iseId) throws InterruptedException, ExecutionException Aktueller Status von Kontakt {iseId} aus Firestore-Collection ioKontakte.- Parameters:
iseId
- Channel-ID des Tuer- bzw. Fensterkontakts.- Returns:
- Werte des aktullen Tuer- bzw. Fensterkontakts.
- Throws:
InterruptedException
- Erforderliche Exception.ExecutionException
- Erforderliche Exception.
-
createKontakt
@PostMapping("/create") public String createKontakt(@RequestBody IoKontaktModel ioKontakteModel) throws InterruptedException, ExecutionException Neuen Kontakt mit Status in Firestore-Collection ioKontakte anlegen.- Parameters:
ioKontakteModel
- Name, Channel-ID und Status des Kontakts.- Returns:
- Erfolgsmeldung / Fehlermeldung
- Throws:
InterruptedException
- Erforderliche Exception.ExecutionException
- Erforderliche Exception.
-
updateKontakt
@PutMapping("/update") public String updateKontakt(@RequestBody IoKontaktModel ioKontakteModel) throws InterruptedException, ExecutionException Status von Kontakt in Firestore-Collection ioKontake aktualisieren.- Parameters:
ioKontakteModel
- Name, Channel-ID und Status des Kontakts.- Returns:
- Erfolgsmeldung / Fehlermeldung
- Throws:
InterruptedException
- Erforderliche Exception.ExecutionException
- Erforderliche Exception.
-
deleteKontakt
@DeleteMapping("/delete/{iseId}") public String deleteKontakt(@PathVariable String iseId) throws InterruptedException, ExecutionException Kontakt {iseId} aus Firestore-Collection ioKontakte loeschen.- Parameters:
iseId
- Channel-ID des Tuer- bzw. Fensterkontakts.- Returns:
- Erfolgsmeldung / Fehlermeldung
- Throws:
InterruptedException
- Erforderliche Exception.ExecutionException
- Erforderliche Exception.
-
checkKontakteOffen
@GetMapping("/checkKontakteOffen") public void checkKontakteOffen() throws InterruptedException, ExecutionExceptionPruefen der aktuellen Stati und ggfs. Versenden einer Push-Nachricht.- Throws:
InterruptedException
- Erforderliche Exception.ExecutionException
- Erforderliche Exception.
-