Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
wiki:software:beuthbot:database-microservice [22.07.2020 18:20] Tobias Belkner [Motivation] |
wiki:software:beuthbot:database-microservice [23.07.2020 12:40] (aktuell) Tobias Belkner |
||
---|---|---|---|
Zeile 6: | Zeile 6: | ||
- [[[[wiki: | - [[[[wiki: | ||
- [[[[wiki: | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
Zeile 15: | Zeile 16: | ||
===== Technologien ===== | ===== Technologien ===== | ||
+ | Aufgebaut wurde dieser Microservice als REST-Server mit JavaScript. Die verwendeten Technologien dafür sind: | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
===== Funktionsweise ===== | ===== Funktionsweise ===== | ||
+ | <uml> | ||
+ | @startuml | ||
+ | participant Registy as R | ||
+ | participant DatabaseMicroservice as DBM | ||
+ | participant DatabaseController as DBC | ||
+ | participant MongoDB as MDB | ||
+ | R -> DBM: Send Intent | ||
+ | activate DBM | ||
+ | DBM -> DBC: DatabaseOperation | ||
+ | activate DBC | ||
+ | DBC -> MDB: DatabaseOperation | ||
+ | activate MDB | ||
+ | return Response | ||
+ | return Response | ||
+ | return Response | ||
+ | @enduml | ||
+ | </ | ||
+ | Da dieser Microservice nur eine Route besitzt, über welche der Intent gesendet wird, muss der Microservice dazu in der Lage sein, diesen Intent aufzulösen, | ||
+ | |||
+ | <code name=" | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ... | ||
+ | } | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | ..., | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | ... | ||
+ | ], | ||
+ | " | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Durch den Intent, erfährt man, welche Operation ausgeführt werden soll und in den Entities steht drin, was hinzugefügt/ | ||
+ | |||
+ | ==== API ==== | ||
+ | |||
+ | === Request === | ||
+ | < | ||
+ | POST https:// | ||
+ | </ | ||
+ | oder | ||
+ | < | ||
+ | POST https:// | ||
+ | </ | ||
+ | |||
+ | === Response === | ||
+ | |||
+ | < | ||
+ | { | ||
+ | answer: { | ||
+ | content: 'Deine Daten: | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | 'home: **köln**\n', | ||
+ | history: [ ' | ||
+ | } | ||
+ | } | ||
+ | </ | ||