-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.http
133 lines (100 loc) · 2.56 KB
/
routes.http
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
## Lembretes
### Options
OPTIONS BASE_URL:HTTP_PORT/reminders
Body: No Needed Body
Response: Status 200 - No Response Body
Response Headers: Access-Control-Allow-Methods: 'GET, POST, DELETE, OPTIONS'
### POST Reminder
POST BASE_URL:HTTP_PORT/reminders
Content-Type: application/json
Body:
{
"text": "Reminder Example",
"date": "2024-07-26 23:30:52.421798",
}
Response: Status 201 - No Response Body
Response Headers: Location: '/reminders/7036c693-5928-4f08-a013-ee5f086c76ff'
###
# GET List of Reminders
# This endpoint retrieves a list of reminders. You can filter the results using query parameters.
# Query Parameters:
# - page: The number of page, based on limit = 10 and offset = (page * 10)
# - checked: Filter reminders by a specific boolean check state.
# - emotion: Filter reminders by a specific emotion.
# - limit: The numbers of items to return.
# - offset: The number of items to skip before starting to collect the result set.
#
# Example: GET BASE_URL:HTTP_PORT/reminders?page=3&checked=true&emotion=sad
#
POST BASE_URL:HTTP_PORT/reminders
Content-Type: application/json
Body: No Needed Body
{
"statusCode": 200,
"data": {
"reminders": [
{
"id": "bf3cbfe7-0c32-4ffb-a227-e74c45576980",
"text": "Lembrar de convidar a Bruna para uma noite de puro glamour e sofisticação. ✨🍷🌹",
"emotion": "luxury",
"date": "2024-07-17 13:19:46"
},
{
"id": "b790055f-54a6-4171-bc22-f992d140a98d",
"text": "Hoje, às 20 horas, vou fazer a lição de casa com muita alegria! ✨📚😁",
"emotion": "happy",
"date": "2024-07-17 06:15:09"
}
],
"total": 2
}
}
### GET Detail
GET BASE_URL:HTTP_PORT/reminders/:id
Content-Type: application/json
Body: No Needed Body
Response:
{
"statusCode": 200,
"data": {
"id": "0a96e35f-dc2c-4c8f-b822-d96093418202",
"text": "Vamos arrasar nas lições de casa às 20 horas e garantir um futuro brilhante! 🌟📚😊",
"emotion": "happy",
"date": "2024-07-17 06:15:09"
}
}
### GET Count
GET BASE_URL:HTTP_PORT/reminders/count
Content-Type: application/json
Body: No Needed Body
Response:
{
"statusCode": 200,
"data": {
"total": 51,
"checks": 5,
"unchecks": 46,
"happiness": 39,
"sad": 1,
"angry": 4,
"anxiety": 1,
"envy": 1,
"shame": 1,
"fear": 1,
"disgust": 1,
"boredom": 2
}
}
### PATCH Check
PATCH BASE_URL:HTTP_PORT/reminders/:id/check
Content-Type: application/json
Body: No Needed Body
Response:
{
"statusCode": 200,
"data": true
}
### DELETE
DELETE BASE_URL:HTTP_PORT/reminders/:id
Body: No Needed Body
Response: Status 200 - No Response Body