Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
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: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
+ | - [[[[wiki: | ||
====Motivation==== | ====Motivation==== | ||
Zeile 226: | Zeile 249: | ||
< | < | ||
- | version: '3.0' | + | ... |
- | services: | + | |
- | mongo: | + | |
- | image: mongo:4.0.4 | + | |
- | restart: unless-stopped | + | |
- | ports: | + | |
- | - 27017: | + | |
- | # - 27018: | + | |
- | # - 27019: | + | |
- | environment: | + | |
- | - MONGO_INITDB_ROOT_USERNAME | + | |
- | - MONGO_INITDB_ROOT_PASSWORD | + | |
volumes: | volumes: | ||
- | # | + | |
- | - ./ | + | |
- | | + | ... |
- | build: | + | |
- | restart: unless-stopped | + | |
- | links: | + | |
- | - mongo | + | |
- | ports: | + | |
- | - 27000: | + | |
- | environment: | + | |
- | - MONGO_DB_ENDPOINT=mongodb:// | + | |
# needed for me to run container on Windows 10 | # needed for me to run container on Windows 10 | ||
- | #volumes: | + | volumes: |
- | # | + | mongodata: |
+ | </ | ||
+ | |||
+ | Außerdem muss ein shared Folder existieren, welcher beispielsweise ' | ||
+ | Die Ordnerstruktur sollte nun wie folgt aussehen: | ||
+ | < | ||
+ | E: | ||
+ | └───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. | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
</ | </ | ||
+ |