-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestes.http
395 lines (269 loc) · 7.48 KB
/
testes.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
############# Login
POST http://localhost:3030/login
Content-Type: application/json
{
"email": "[email protected]",
"senha": "senha"
}
####Possíveis requisições para tipo (Não é permitido deletar um tipo de usuário)
POST http://localhost:3030/tipo
Content-Type: application/json
{
"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6ImQ2YTRkMzEwLWNiNmUtMTFlYy05NWFmLTMzZGVlOWEzNzAwOCIsImlkIjoxLCJub21lX2NvbXBsZXRvIjoiQ2FyaW5oYSIsImVtYWlsIjoiYWRtaW5AZW1haWwuY29tIiwicm9sZSI6MiwiaWF0IjoxNjUxNjQzNzQ1fQ.fg_s9Om3jfiqkt9BwhGge_l1po3QOsm-XFVXqvIkfL4",
"descricao":"Administrador"
}
#############
####Requisição do arquivo de busca
###################
POST http://localhost:3030/busca
Content-Type: application/json
{
"data_retirada":"2022-05-23T00:00:00Z",
"data_entrega":"2022-06-25T00:00:00Z",
"cidade_origem":"Rio de Janeiro",
"cidade_destino":"São Paulo",
"estado_origem":"Rio de Janeiro",
"estado_destino":"São Paulo"
}
##############################
#############
GET http://localhost:3030/tipo/2
Content-Type: application/json
#############
PUT http://localhost:3030/tipo
Content-Type: application/json
{
"id":1,
"descricao":"Usuário"
}
###########################
####Possíveis requisições para endereço (Não é permitido deletar um endereço)
POST http://localhost:3030/endereco
Content-Type: application/json
{
"cep":"02341-123",
"logadouro":"Rua das felicidades, 1",
"complemento":"Apartamento 1",
"estado" :"São Paulo",
"cidade":"São Paulo"
}
# /*
# "id_usuario":1
# "id_locadora":1
# Incluir FK somente da entidade a qual pertence o endereço*/
#############
GET http://localhost:3030/endereco/1
Content-Type: application/json
#############
PUT http://localhost:3030/endereco
Content-Type: application/json
{
"id":1,
"cep":"02341-153",
"logadouro":"Rua das Superações, 1",
"complemento":"Apartamento 1",
"estado" :"São Paulo",
"cidade":"São Paulo"
}
###########################
####Possíveis requisições para mensagem (Não é permitido alterar uma mensagem)
POST http://localhost:3030/mensagem
Content-Type: application/json
{
"nome_completo":"Carinha que mora logo ali",
"email":"[email protected]",
"conteudo":"Hey, me passa um dolar!"
}
#############
GET http://localhost:3030/mensagem/1
Content-Type: application/json
#############
GET http://localhost:3030/mensagem
Content-Type: application/json
#############
DELETE http://localhost:3030/mensagem
Content-Type: application/json
{
"id":1
}
###########################
####Possíveis requisições para Status de veículo (Não é permitido deletar um tipo de status)
POST http://localhost:3030/status
Content-Type: application/json
{
"descricao":"Alugado"
}
#############
GET http://localhost:3030/status/1
Content-Type: application/json
#############
GET http://localhost:3030/locadora
Content-Type: application/json
#############
PUT http://localhost:3030/status
Content-Type: application/json
{
"id":1,
"descricao":"Disponível"
}
###########################
####Possíveis requisições para Locadora
POST http://localhost:3030/locadora
Content-Type: application/json
{
"nome":"Ag. 01 - SP",
"email":"[email protected]",
"cnpj":"00000000000000",
"telefone" :"21 55322342"
}
#############
GET http://localhost:3030/locadora/1
Content-Type: application/json
#############
GET http://localhost:3030/locadora
Content-Type: application/json
#############
PUT http://localhost:3030/locadora
Content-Type: application/json
{
"id":1,
}
###########################
DELETE http://localhost:3030/locadora
Content-Type: application/json
{
"id":1
}
##############################
####Possíveis requisições para veiculo
POST http://localhost:3030/veiculo
Content-Type: application/json
{
"modelo": "Uno de firma",
"placa" : "MAD-8012",
"km_rodados" : 280,
"custo_diaria" : 20,
"renavam" : "56778776565",
"id_locadora_proprietaria" : 1,
"id_locadora_atual" : 1,
"id_status_veiculo": 1
}
#############
GET http://localhost:3030/veiculo/1
Content-Type: application/json
#############
GET http://localhost:3030/veiculo
Content-Type: application/json
#############
PUT http://localhost:3030/veiculo
Content-Type: application/json
{
"id":1,
"modelo": "Uno de firma 1",
"placa" : "MAD-8012",
"km_rodados" : 280,
"custo_diaria" : 20,
"renavam" : "56778776565",
"id_locadora_proprietaria" : 1,
"id_locadora_atual" : 1,
"id_status_veiculo": 1
}
###########################
####Possíveis requisições para Usuario
POST http://localhost:3030/usuario
Content-Type: application/json
{
"nome_completo": "Fulano de Tal",
"senha": "senha",
"email": "[email protected]",
"cpf": "00000000000",
"telefone": "1123320232",
"data_nascimento": "2022-03-28T23:08:13.145Z",
"cnh": "001241241241243",
"validade_cnh": "2022-03-28T23:08:13.145Z",
"fk_id_tipo_usuario" : 2
}
#############
PUT http://localhost:3030/usuario
Content-Type: application/json
{
"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6ImRmN2Y3OGYwLWRhMWUtMTFlYy1hZDk4LTA5OGFkNTdlMTZhNSIsImlkIjoyLCJlbWFpbCI6Im1hcmN1c0BtYXJjdXMuY29tIiwiaWF0IjoxNjUzMjU4NjY3fQ.Ap6GYUI615xqMuql9PiSTfjJmv8rTfEgecqesiL3N0s",
"id":1,
"nome_completo": "Carinha",
"email": "[email protected]",
"senha": "senha",
"cpf": "00000000000",
"telefone": "1123320232",
"data_nascimento": "2022-03-28T23:08:13.145Z",
"cnh": "001241241241243",
"validade_cnh": "2022-03-28T23:08:13.145Z",
"fk_id_tipo_usuario" : 2
}
#############
POST http://localhost:3030/usuario/1
Content-Type: application/json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidG9rZW4iOiI5ODY0MzE4MC1kZWI2LTExZWMtYjRlNy0zYmNlZmU3MTcwMzYiLCJlbWFpbCI6ImFkbWluQGVtYWlsLmNvbSIsImlhdCI6MTY1Mzc2MzYzNn0.f7usEG3tfbwJDudt47ikn1814nBxgp0K_Yrlt2ncmVE"
}
#############
GET http://localhost:3030/reserva/3
Content-Type: application/json
#############
GET http://localhost:3030/reserva
Content-Type: application/json
#############
PUT http://localhost:3030/locadora
Content-Type: application/json
{
"id":1,
"nome":"Ag. 01 - SP",
"email":"[email protected]",
"cnpj":"00.000.000/0000-00",
"telefone" :"11 55882342"
}
###########################
####Possíveis requisições para Reserva
POST http://localhost:3030/reserva
Content-Type: application/json
{
"id_veiculo": 1,
"id_usuario": 1,
"id_locadora_retirada":1,
"id_locadora_entrega": 1,
"data_retirada": "2022-03-28T23:08:13.145Z",
"data_entrega": "2022-04-29T23:08:13.145Z",
"valor": 3200.21
}
#############
###################
GET http://localhost:3030/busca
Content-Type: application/json
{
"data_retirada":"2002-01-01 00:00:00Z",
"data_entrega":"2999-01-01 00:00:00Z",
"cidade_origem":"São Paulo",
"cidade_destino":"São Paulo",
"estado_origem":"São Paulo",
"estado_destino":"São Paulo"
}
##############################
#############
GET http://localhost:3030/reserva/usuario/1
Content-Type: application/json
#############
GET http://localhost:3030/reserva/3
Content-Type: application/json
#############
GET http://localhost:3030/reserva
Content-Type: application/json
#############
PUT http://localhost:3030/locadora
Content-Type: application/json
{
"id":1,
"nome":"Ag. 01 - SP",
"email":"[email protected]",
"cnpj":"00.000.000/0000-00",
"telefone" :"11 55882342"
}
###########################