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:56] Tobias Belkner [Integration] |
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: | ||
* ''/ | * ''/ | ||
* ''/ | * ''/ | ||
- | * ''/ | ||
Zeile 110: | Zeile 132: | ||
<uml> | <uml> | ||
@startuml | @startuml | ||
- | package "Dockerfile" { | + | package "docker-compose.yml" { |
[MongoDB (Container)] | [MongoDB (Container)] | ||
[DB Controller (Container)] | [DB Controller (Container)] | ||
Zeile 207: | 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. | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ |