Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
wiki:software:beuthbot:database [11.06.2020 13:25] Lukas Danckwerth |
wiki:software:beuthbot:database [29.06.2020 14:01] (aktuell) Tobias Belkner [Table of Content] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
=====database===== | =====database===== | ||
+ | |||
+ | ==== Table of Content ==== | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
====Motivation==== | ====Motivation==== | ||
Zeile 54: | Zeile 77: | ||
* ''/ | * ''/ | ||
* ''/ | * ''/ | ||
- | * ''/ | ||
- | ====Use Cases (?)==== | + | ====Use Cases==== |
+ | <uml> | ||
+ | @startuml | ||
+ | left to right direction | ||
+ | |||
+ | actor " | ||
+ | |||
+ | package BeuthBot { | ||
+ | actor " | ||
+ | usecase " | ||
+ | usecase " | ||
+ | usecase " | ||
+ | usecase " | ||
+ | usecase " | ||
+ | } | ||
+ | |||
+ | ST --> UC1 | ||
+ | ST --> UC2 | ||
+ | ST --> UC3 | ||
+ | ST --> UC4 | ||
+ | ST --> UC5 | ||
+ | |||
+ | UC1 --> DBC | ||
+ | UC2 --> DBC | ||
+ | UC3 --> DBC | ||
+ | UC4 --> DBC | ||
+ | UC5 --> DBC | ||
+ | @enduml | ||
+ | </ | ||
====Klassendiagramm User==== | ====Klassendiagramm User==== | ||
Zeile 75: | Zeile 125: | ||
====Technologies==== | ====Technologies==== | ||
- | Durch die Anforderung, | + | Durch die Anforderung, |
* MongoDB [[https:// | * MongoDB [[https:// | ||
* MongoDB Docker Image [[https:// | * MongoDB Docker Image [[https:// | ||
- | ====Function==== | + | <uml> |
- | + | @startuml | |
+ | package " | ||
+ | [MongoDB (Container)] | ||
+ | [DB Controller (Container)] | ||
+ | } | ||
+ | @enduml | ||
+ | </ | ||
====Integration==== | ====Integration==== | ||
- | |||
- | // # An welcher Stelle wird die DB in das System eingebaut?// | ||
- | |||
- | // # Wie wird sie eingebaut?// | ||
- | |||
- | // # Wie sieht das Endprodukt aus?// | ||
<uml> | <uml> | ||
Zeile 131: | Zeile 180: | ||
GW -> DC: Request | GW -> DC: Request | ||
- | DC -> GW: Response (Intent + [Args]) | + | activate |
+ | return | ||
GW -> DBC: Request User | GW -> DBC: Request User | ||
+ | activate DBC | ||
DBC -> DB: Get User | DBC -> DB: Get User | ||
- | DB -> DBC: Return User | + | activate |
- | DBC -> GW: Respones | + | return |
+ | return Responses | ||
GW -> SE: Request (User + [Args]) | GW -> SE: Request (User + [Args]) | ||
- | SE -> GW: Answere | + | activate |
+ | return Answer | ||
@enduml | @enduml | ||
</ | </ | ||
Zeile 154: | Zeile 207: | ||
endbox | endbox | ||
- | GW -> DC: Request "Merke dir, dass ich vegetarich | + | GW -> DC: Request "Merke dir, dass ich vegetarisch |
- | DC -> GW: Response (Intent + [Args]) | + | activate |
+ | return | ||
GW -> DBC: Add Detail " | GW -> DBC: Add Detail " | ||
+ | activate DBC | ||
DBC -> DB: Store " | DBC -> DB: Store " | ||
- | DB -> DBC: Result | + | activate |
- | DBC -> GW: Result | + | return |
+ | return | ||
@enduml | @enduml | ||
</ | </ | ||
Zeile 173: | Zeile 229: | ||
* Erste versuche mit dem Trainingsmodell von RASA | * Erste versuche mit dem Trainingsmodell von RASA | ||
+ | ====Getting Started==== | ||
+ | |||
+ | Die Datenbank wurde mit Docker erstellt. Um diese zum laufen zu bringen müssen folgende Befehle ausgeführt werden: | ||
+ | |||
+ | < | ||
+ | # clone the repository | ||
+ | git clone https:// | ||
+ | |||
+ | # go to the folder | ||
+ | cd database | ||
+ | |||
+ | # start the docker container to run the mongodb and its corresponding database microservice | ||
+ | docker-compose up | ||
+ | </ | ||
+ | |||
+ | ===Windows=== | ||
+ | |||
+ | Damit es auf Windows funktionieren kann müssen folgende Zeilen in der docker-compose.yml Datei geändert werden: | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | volumes: | ||
+ | - mongodata:/ | ||
+ | #- ./ | ||
+ | ... | ||
+ | # needed for me to run container on Windows 10 | ||
+ | volumes: | ||
+ | mongodata: | ||
+ | </ | ||
+ | |||
+ | Außerdem muss ein shared Folder existieren, welcher beispielsweise ' | ||
+ | Die Ordnerstruktur sollte nun wie folgt aussehen: | ||
+ | < | ||
+ | E:\mongodb | ||
+ | └───data | ||
+ | ├───configdb | ||
+ | └───db | ||
+ | </ | ||
+ | |||
+ | ==== API ==== | ||
+ | === Request all Users === | ||
+ | Requests all Users in the collection | ||
+ | < | ||
+ | GET http:// | ||
+ | </ | ||
+ | |||
+ | == Response == | ||
+ | < | ||
+ | {...}, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | {...} | ||
+ | </ | ||
+ | |||
+ | == Error == | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | === Request User === | ||
+ | |||
+ | < | ||
+ | GET http:// | ||
+ | </ | ||
+ | |||
+ | == Reponse == | ||
+ | Request a single user with the given id. | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Error == | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Add / Change Detail === | ||
+ | Add/Change a Detaile to/from the User with the given id. | ||
+ | < | ||
+ | POST http:// | ||
+ | </ | ||
+ | |||
+ | == Request Body == | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Reponse == | ||
+ | If the operation was successful the error will be set to null and the success will be set to true. If the operation failed an error message will be set and the success will be set to false. | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | === Delete all Details === | ||
+ | Deletes all Details from the User with the given id | ||
+ | < | ||
+ | DELETE http:// | ||
+ | </ | ||
+ | |||
+ | == Reponse == | ||
+ | If the operation was successful the error will be set to null and the success will be set to true. If the operation failed an error message will be set and the success will be set to false. | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Delete Detail === | ||
+ | Deletes one Detail from the User with the given id. | ||
+ | |||
+ | < | ||
+ | DELETE http:// | ||
+ | </ | ||
+ | |||
+ | == Reponse == | ||
+ | If the operation was successful the error will be set to null and the success will be set to true. If the operation failed an error message will be set and the success will be set to false. | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ |