wiki.ziemers.de

ziemer's informatik Wiki

Benutzer-Werkzeuge

Webseiten-Werkzeuge


wiki:software:beuthbot:database

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
wiki:software:beuthbot:database [11.06.2020 13:55]
Lukas Danckwerth [Technologies]
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:software:beuthbot:database#database|database]]
 +     - [[[[wiki:software:beuthbot:database#Table of Content|Table of Content]]
 +     - [[[[wiki:software:beuthbot:database#Motivation|Motivation]]
 +     - [[[[wiki:software:beuthbot:database#Requirements|Requirements]]
 +       - [[[[wiki:software:beuthbot:database#Functional|Functional]]
 +       - [[[[wiki:software:beuthbot:database#Non Functional|Non Functional]]
 +     - [[[[wiki:software:beuthbot:database#User Stories|User Stories]] 
 +     - [[[[wiki:software:beuthbot:database#Use Cases|Use Cases]]
 +     - [[[[wiki:software:beuthbot:database#Klassendiagramm User|Klassendiagramm User]]
 +     - [[[[wiki:software:beuthbot:database#Technologies|Technologies]]
 +     - [[[[wiki:software:beuthbot:database#Integration|Integration]]
 +       - [[[[wiki:software:beuthbot:database#Sequenzdiagramm mit angesteuertem Service|Sequenzdiagramm mit angesteuertem Service]]
 +       - [[[[wiki:software:beuthbot:database#Sequenzdiagramm nur Datenbank betreffend|Sequenzdiagramm nur Datenbank betreffend]]
 +     - [[[[wiki:software:beuthbot:database#Getting Started|Getting Started]]
 +       - [[[[wiki:software:beuthbot:database#Windows|Windows]]
 +     - [[[[wiki:software:beuthbot:database#API|API]]
 +       - [[[[wiki:software:beuthbot:database#Request all Users|Request all Users]]
 +       - [[[[wiki:software:beuthbot:database#Request Users|Request Users]]
 +       - [[[[wiki:software:beuthbot:database#Add / Change Detail|Add / Change Detail]]
 +       - [[[[wiki:software:beuthbot:database#Delete all Details|Delete all Details]]
 +       - [[[[wiki:software:beuthbot:database#Delete Detail|Delete Detail]]
  
 ====Motivation==== ====Motivation====
Zeile 54: Zeile 77:
   * ''/DBUS103/'' Als Student möchte ich dem Bot sagen können, dass er meine ALLE meine Daten löschen soll.   * ''/DBUS103/'' Als Student möchte ich dem Bot sagen können, dass er meine ALLE meine Daten löschen soll.
   * ''/DBUS103/'' Als Student möchte ich dem Bot sagen können, dass er ein Detail über mich löschen soll.   * ''/DBUS103/'' Als Student möchte ich dem Bot sagen können, dass er ein Detail über mich löschen soll.
-  * ''/DBUS104/'' Als ... möchte ich ..., damit ich ... 
  
  
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 186: Zeile 208:
  
 GW -> DC: Request "Merke dir, dass ich vegetarisch esse." GW -> DC: Request "Merke dir, dass ich vegetarisch esse."
-DC -> GW: Response (Intent + [Args])+activate DC 
 +return Response (Intent + [Args])
  
 GW -> DBC: Add Detail "vegetarisch" GW -> DBC: Add Detail "vegetarisch"
 +activate DBC
 DBC -> DB: Store "vegetarisch" DBC -> DB: Store "vegetarisch"
-DB -> DBC: Result +activate DB 
-DBC -> GW: Result+return Result 
 +return GW: Result
 @enduml @enduml
 </uml> </uml>
Zeile 204: 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:
 +
 +<code>
 +# clone the repository
 +git clone https://github.com/beuthbot/database.git
 +
 +# go to the folder
 +cd database
 +
 +# start the docker container to run the mongodb and its corresponding database microservice
 +docker-compose up
 +</code>
 +
 +===Windows===
 +
 +Damit es auf Windows funktionieren kann müssen folgende Zeilen in der docker-compose.yml Datei geändert werden:
 +
 +<code>
 +...
 +    volumes:
 +      - mongodata:/data/db # needed for me to run container on Windows 10
 +      #- ./../.database:/data/db # For Mac/Linux
 +...
 +# needed for me to run container on Windows 10
 +volumes:
 +  mongodata:
 +</code>
 +
 +Außerdem muss ein shared Folder existieren, welcher beispielsweise 'mongodb' genannt werden muss, worin sich der Ordner 'data' mit den Unterordnern 'db' und 'configdb' befindet.
 +Die Ordnerstruktur sollte nun wie folgt aussehen:
 +<code>
 +E:\mongodb
 +    └───data
 +          ├───configdb
 +          └───db
 +</code>
 +
 +==== API ====
 +=== Request all Users ===
 +Requests all Users in the collection
 +<code>
 +GET http://localhost:27000/users
 +</code>
 +
 +== Response ==
 +<code>
 +{...},
 +{
 +  "id": 12345678,
 +  "nickname": "Alan",
 +  "details" : {
 +    "eating_habit" : "vegetarisch",
 +    "city" : "Berlin"
 +  }
 +},
 +{...}
 +</code>
 +
 +== Error ==
 +<code>
 +{
 +  "error": ...
 +}
 +</code>
 +=== Request User ===
 +
 +<code>
 +GET http://localhost:27000/users/<id>
 +</code>
 +
 +== Reponse ==
 +Request a single user with the given id.
 +<code>
 +{
 +  "id": 12345678,
 +  "nickname": "Alan",
 +  "details" : {
 +    "eating_habit" : "vegetarisch",
 +    "city" : "Berlin"
 +  }
 +}
 +</code>
 +
 +== Error ==
 +
 +<code>
 +{
 +  "error": ...
 +}
 +</code>
 +
 +=== Add / Change Detail ===
 +Add/Change a Detaile to/from the User with the given id.
 +<code>
 +POST http://localhost:27000/users/<id>/detail
 +</code>
 +
 +== Request Body ==
 +
 +<code>
 +{
 +  "detail": "eating_habit",
 +  "value": "vegetarisch"
 +}
 +</code>
 +
 +== 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.
 +<code>
 +{
 +  "error": null,
 +  "success": true | false
 +}
 +</code>
 +===  Delete all Details ===
 +Deletes all Details from the User with the given id
 +<code>
 +DELETE http://localhost:27000/user/<id>/detail?q=<value>
 +</code>
 +
 +== 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.
 +
 +<code>
 +{
 +  "error": null,
 +  "success": true | false
 +}
 +</code>
 +
 +===  Delete Detail ===
 +Deletes one Detail from the User with the given id.
 +
 +<code>
 +DELETE http://localhost:27000/user/<id>/detail?q=<value>
 +</code>
 +
 +== 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.
 +<code>
 +{
 +  "error": null,
 +  "success": true | false
 +}
 +</code>
 + 
wiki/software/beuthbot/database.1591876549.txt.gz · Zuletzt geändert: 11.06.2020 13:55 von Lukas Danckwerth