Skip to content

Commit d56f5ed

Browse files
authored
#1 Add design draft (#2)
1 parent 2b8ff1c commit d56f5ed

File tree

2 files changed

+3336
-0
lines changed

2 files changed

+3336
-0
lines changed

doc/README.md

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Documentation
2+
3+
## Design
4+
5+
- [Excalidraw Board][design-excalidraw]
6+
7+
- [Excalidraw Board File][design-excalidraw-file]
8+
9+
### Entity
10+
11+
```java
12+
class Person {
13+
Long id; // больше 0, должно быть уникальным, автоген
14+
String first_name; // не может быть пустой
15+
String last_name; // не может быть пустой
16+
List<Picture> pictures; // не меньше 1
17+
Set<Intereset> interests;
18+
int height; // больше 50, меньше 300
19+
Optional<LocalDate> birthday;
20+
Optional<ZodiacSign> zodiac_sign;
21+
Optional<Faculty> faculty;
22+
Optional<Location> location;
23+
OffsetDateTime creationDate; // автоген
24+
}
25+
26+
class Picture {
27+
Long id; // больше 0, автоген
28+
Optional<URI> large; // минимум large, medium или small точно установлены
29+
Optional<URI> medium;
30+
Optional<URI> small;
31+
}
32+
33+
class Topic {
34+
Long id; // больше 0, автоген
35+
String name; // длина от 3 до 32 символов
36+
Picture icon;
37+
Color color;
38+
}
39+
40+
class Interest {
41+
Topic topic;
42+
int degree; // от 0 до 5
43+
}
44+
45+
class Location {
46+
String name; // от 3 до 128 символов
47+
Coordinates coordinates;
48+
}
49+
50+
class Coordinates {
51+
Double latitude; // from −90° at the south pole to 90° at the north pole
52+
Double longitude; // from 0° to 180° East and 0° to 180° West
53+
}
54+
55+
enum ZodiacSign {
56+
ARIES, TAURUS, GEMINI, ...;
57+
}
58+
59+
enum Faculty {
60+
VT, CT, IS;
61+
}
62+
```
63+
64+
### API
65+
66+
#### People Service
67+
68+
```bash
69+
# Here are also other filters and paging
70+
GET /people?first_name="admin"
71+
72+
GET /people/{person-id}
73+
74+
POST /people
75+
76+
PATCH /people/{person-id}
77+
78+
DELETE /people/{person-id}
79+
```
80+
81+
#### Matchmaker Service
82+
83+
```bash
84+
GET /suggestions/{person-id}
85+
86+
POST /attitudes
87+
{
88+
"target_id": <person-id>,
89+
"score": <like|skip>
90+
}
91+
92+
GET /matches/{person-id}
93+
94+
# Alternative API just for a teacher
95+
96+
# посчитать число лайков и дизлайков у всех пользователей
97+
GET /statistics/count-liked
98+
{
99+
"list": [
100+
{ "person_id": { "attitudes": { "like": <N>, "skip": <M> } } }
101+
]
102+
}
103+
104+
# лайкнуть или дизлайкнуть человека
105+
POST /partner/{person-id}/attitude/{like|skip}
106+
{}
107+
```
108+
109+
[design-excalidraw]: https://excalidraw.com/#json=wz5D6d2kiOioUYp5yoa1v,wQOnDjOdMOMRvj6yPgqDPA
110+
[design-excalidraw-file]: ./design-v2.excalidraw

0 commit comments

Comments
 (0)