Merge branch 'master' of git.bib.de:MAM/VPR-Docs
This commit is contained in:
commit
e3bdfee519
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
||||
*.bak*
|
||||
*.bak*
|
||||
*.lck
|
@ -1,30 +1,36 @@
|
||||
https://dbdiagram.io/d/
|
||||
|
||||
|
||||
Table "user" {
|
||||
"id" INT(10) [pk]
|
||||
"name" VARCHAR(20)
|
||||
"forename" VARCHAR(20)
|
||||
"password" VARCHAR(20)
|
||||
"token" VARCHAR(20)
|
||||
"is_admin" BIT
|
||||
}
|
||||
|
||||
Table "event" {
|
||||
"id" INT(10) [pk]
|
||||
"name" VARCHAR(20)
|
||||
"priority" TINYINT(2)
|
||||
"is_full_day" BIT
|
||||
"start" TIME
|
||||
"end" TIME
|
||||
"id" bigint(20) [pk, not null, increment]
|
||||
"name" varchar(255) [default: NULL]
|
||||
"start" time [default: NULL]
|
||||
"end" time [default: NULL]
|
||||
"is_full_day" bit(1) [not null]
|
||||
"is_private" bit(1) [not null]
|
||||
"priority" int(11) [default: NULL]
|
||||
}
|
||||
|
||||
Table "event_list" {
|
||||
"id" INT(10) [pk]
|
||||
"user_id" NT(10)
|
||||
"event_id" NT(10)
|
||||
"date" date
|
||||
Table "user" {
|
||||
"id" bigint(20) [pk, not null, increment]
|
||||
"forename" varchar(255) [default: NULL]
|
||||
"name" varchar(255) [default: NULL]
|
||||
"is_admin" bit(1) [not null]
|
||||
"password" varchar(255) [default: NULL]
|
||||
"token" varchar(255) [default: NULL]
|
||||
}
|
||||
|
||||
Ref:"event_list"."user_id" < "user"."id"
|
||||
Ref:"event_list"."event_id" < "event"."id"
|
||||
Table "user_event" {
|
||||
"date" date [not null, default: `curdate()`]
|
||||
"event_id" bigint(20) [not null]
|
||||
"user_id" bigint(20) [not null]
|
||||
|
||||
Indexes {
|
||||
event_id [name: "FKspe8srtv69gubpphvrnd7wekt"]
|
||||
user_id [name: "FKk3smcqwou8absq8qjt3wk4vy9"]
|
||||
(date, event_id, user_id) [pk]
|
||||
}
|
||||
}
|
||||
|
||||
Ref:"event"."id" < "user_event"."event_id"
|
||||
Ref:"user"."id" < "user_event"."user_id"
|
Binary file not shown.
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 28 KiB |
113
Docs/REST-API/API Reference.md
Normal file
113
Docs/REST-API/API Reference.md
Normal file
@ -0,0 +1,113 @@
|
||||
# API Reference
|
||||
|
||||
The vpr Api ist created around REST. Our Api has several different endpoint, that are URL based and accept standard form-encoded request bodies.
|
||||
It returns JSON-encoded responses and uses standard HTTP response codes.
|
||||
|
||||
---
|
||||
|
||||
## The Endpoints at "/vpr/"
|
||||
GET:
|
||||
- /all-users
|
||||
|
||||
POST:
|
||||
- /all-events
|
||||
- /add-user
|
||||
- /add-event
|
||||
- /del-event
|
||||
|
||||
---
|
||||
|
||||
## Status-codes dan HTTP-responses
|
||||
|
||||
| STATUS | meaning |
|
||||
| --- | --- |
|
||||
| 200 | OK. The Request was successful |
|
||||
| 400 | Bad request. Check if you send all parameter |
|
||||
| 404 | endpoint not found. The Url might contain a spelling mistake |
|
||||
| 405 | Request-Method not allowed. Check if the endpoint requires an GET or POST request |
|
||||
| 500 | Internal Server error. The request failed due to an exception at the server, the Request-parameter might be in a wrong format, or the database might be unreachable |
|
||||
|
||||
---
|
||||
|
||||
## /all-users
|
||||
|
||||
Request (GET):
|
||||
|
||||
curl localhost:8080/vpr/all-users
|
||||
|
||||
Response:
|
||||
|
||||
[
|
||||
[
|
||||
userId: int,
|
||||
forename: string,
|
||||
name: string
|
||||
]
|
||||
]
|
||||
|
||||
---
|
||||
|
||||
## /all-events
|
||||
|
||||
Request (POST):
|
||||
|
||||
curl localhost:8080/vpr/all-events -X POST -d "userId=<int>"
|
||||
|
||||
Response:
|
||||
|
||||
[
|
||||
[
|
||||
eventId: int,
|
||||
name: string,
|
||||
start: string,
|
||||
priority: int,
|
||||
isFullDay: boolean,
|
||||
date: string,
|
||||
userId: int,
|
||||
forename: string,
|
||||
name: string
|
||||
|
||||
]
|
||||
]
|
||||
|
||||
---
|
||||
|
||||
## /add-user
|
||||
|
||||
Request (POST):
|
||||
|
||||
curl localhost:8080/vpr/add-user -X POST -d "name=<string>&forename=<string>&password=<string>&isAdmin=<boolean>"
|
||||
|
||||
Response:
|
||||
|
||||
status 200 if request is ok
|
||||
|
||||
And String "Saved"
|
||||
|
||||
---
|
||||
|
||||
## /add-event
|
||||
|
||||
Request (POST):
|
||||
|
||||
curl localhost:8080/vpr/add-event -X POST -d "userId=<String>&date=<String>&name=<String>&start=<String>&end=<String>&prority=<int>&isFullDay=<boolean>&isPrivate=<boolean>"
|
||||
|
||||
Response:
|
||||
|
||||
status 200 if request is ok
|
||||
|
||||
And String "Saved"
|
||||
|
||||
---
|
||||
|
||||
## /del-event
|
||||
|
||||
Request (POST):
|
||||
|
||||
curl localhost:8080/vpr/del-event -X POST -d "eventId=<int>"
|
||||
|
||||
Response:
|
||||
|
||||
status 200 if request is ok
|
||||
|
||||
And String "Deleted"
|
@ -1,6 +1,6 @@
|
||||
# 1 Formatting
|
||||
## 1.1 General
|
||||
Maximal 80-100 letters in one line
|
||||
Maximal 80-100 letters in one line
|
||||
We use the default build in Formatter from 'IntelliJ IDEA' (Ctr+Alt+L)
|
||||
|
||||
## 1.2 Brackets
|
||||
|
Loading…
Reference in New Issue
Block a user