-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobject_description.txt
101 lines (73 loc) · 2.17 KB
/
object_description.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
nestbox
- id
- from_date
- until_date
- uuid
- is_public
- mandant_id
geolocations
- id
- nestbox_id
- latitude
- longitude
- from_date
- until_date
breed
- id
- nestbox_id
- user_id
- discovery_date
- id_bird
bird
- id
- name
- furter_information_link
mandant
- id
- name
- website
- email
user
- id
- mandant_id
- lastname
- firstname
- email
- password
- salt
mandant 1 ----- n users
|
+----- 1 ------ n nestboxes 1 ----- n breeds
|
+ n ------------- n geolocation
API draft
Public
GET /nestboxes/{uuid}
GET /nestboxes/{uuid}/breeds/
Secured
POST /nextboxes/{uuid}/breeds/
GET /mandants/birds/
POST /mandants/birds/
PUT /mandants/birds/
MongoDB
- Indexes
db.mandants.createIndex({"uuid": 1}, {"unique": true})
db.nestboxes.createIndex({"uuid": 1}, {"unique": true})
db.breeds.createIndex({"uuid": 1}, {"unique": true})
db.breeds.createIndex({"nestbox_uuid": 1})
db.users.createIndex({"uuid": 1}, {"unique": true})
db.users.createIndex({"username": 1}, {"unique": true})
db.geolocations.createIndex({"uuid": 1}, {"unique": true})
db.birds.createIndex({"uuid": 1}, {"unique": true})
db.birds.createIndex({"mandant_uuid": 1})
db.sessions.createIndex({"session_key": 2}, {"unique": true})
db.sessions.createIndex({"session_key": 1}, { expireAfterSeconds: 86400 })
db.geolocations.createIndex({"nestbox_uuid": 1})
db.nestboxes.createIndex({"mandant_uuid":1})
curl
- login
curl --header "Content-Type: application/json" --request POST --data '{"username":"fg_1990","password":"secretbird"}' http://127.0.0.1:8080/login
curl http://127.0.0.1:8080/nestboxes/ea492bf7-445c-4727-80a5-8f55f9f40fa5/breeds?page_limit=20\&page_number=1
curl http://127.0.0.1:8080/nestboxes/87fc2fdc-df23-4cce-ba61-99bba7d58f68
curl -H "Authorization: Basic 6c2cc09d-097b-41d4-acdc-70257b46bc54" -H "Content-Type: application/json" --request POST --data '{"uuid":"xxx","bird":"veryrarebird"}' http://127.0.0.1:8080/nestboxes/87fc2fdc-df23-4cce-ba61-99bba7d58f68/breeds
curl --header "Content-Type: application/json" --request POST --data '{"username":"fg_1990","password":"secretbird"}' http://127.0.0.1:8080/login