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 [16.06.2020 15:51]
Tobias Belkner
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 226: Zeile 249:
  
 <code> <code>
-version: '3.0' +...
-services: +
-  mongo: +
-    image: mongo:4.0.+
-    restart: unless-stopped +
-    ports: +
-      - 27017:27017 +
-#      - 27018:27018 +
-#      - 27019:27019 +
-    environment: +
-      - MONGO_INITDB_ROOT_USERNAME +
-      - MONGO_INITDB_ROOT_PASSWORD+
     volumes:     volumes:
-     # - mongodata:/data/db # needed for me to run container on Windows 10 +      - mongodata:/data/db # needed for me to run container on Windows 10 
-      - ./../.database:/data/db # For Mac/Linux +      #- ./../.database:/data/db # For Mac/Linux 
-  database: +...
-    build: . +
-    restart: unless-stopped +
-    links: +
-      - mongo +
-    ports: +
-      - 27000:3000 +
-    environment: +
-      - MONGO_DB_ENDPOINT=mongodb://mongo:27017/users+
 # needed for me to run container on Windows 10 # needed for me to run container on Windows 10
-#volumes: +volumes: 
- mongodata:+  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> </code>
 + 
wiki/software/beuthbot/database.1592315480.txt.gz · Zuletzt geändert: 16.06.2020 15:51 von Tobias Belkner