|
|
| [Home](home) | [Escopo e Cronograma](escopo) | [Processo](processo) | [Design/Mockups](design_mockups) | [Configuração](configuracao) | [**Arquitetura**](arquitetura) | [Código](codigo) | [BD](banco_dados) | [Qualidade](qualidade) | [Utilização](utilizacao) | [Contratos](contratos)
|
|
|
| :----------: | :---------------------------: | :------------------: | :--------------: | :--------------------------: | :----------------------------: | :--------------: | :---------------: | :--------------------: | :----------------------: | :----------------------: | |
|
|
\ No newline at end of file |
|
|
| :----------: | :---------------------------: | :------------------: | :--------------: | :--------------------------: | :----------------------------: | :--------------: | :---------------: | :--------------------: | :----------------------: | :----------------------: |
|
|
|
|
|
|
## Contratos de comunicação back-front
|
|
|
|
|
|
---
|
|
|
### GET /students/
|
|
|
|
|
|
#### Params:
|
|
|
Nenhum parâmetro esperado
|
|
|
|
|
|
#### Query string:
|
|
|
- institution: str = faculdade do aluno
|
|
|
- semester: int = semestre em que o aluno se encontra
|
|
|
- offset: str = início da lista de professores
|
|
|
- limit: str = tamanho da lista retornada
|
|
|
|
|
|
#### Payload:
|
|
|
Nenhum payload esperado
|
|
|
|
|
|
#### Responses:
|
|
|
- 200
|
|
|
```
|
|
|
{
|
|
|
status: 200,
|
|
|
msg: "Success",
|
|
|
students: [
|
|
|
{
|
|
|
|
|
|
},
|
|
|
...
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 400
|
|
|
```
|
|
|
{
|
|
|
status: 400,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: "",
|
|
|
msg: "Invalid value for \"semester\""
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 500
|
|
|
```
|
|
|
{
|
|
|
status: 500,
|
|
|
msg: "Internal error occurred",
|
|
|
errors: Any
|
|
|
}
|
|
|
```
|
|
|
|
|
|
---
|
|
|
|
|
|
### GET /students/{id}/
|
|
|
|
|
|
#### Params:
|
|
|
- id: int = id do estudante
|
|
|
|
|
|
#### Query string:
|
|
|
Nenhuma query string esperada
|
|
|
|
|
|
#### Payload:
|
|
|
Nenhum payload esperado
|
|
|
|
|
|
#### Responses:
|
|
|
- 200
|
|
|
```
|
|
|
{
|
|
|
status: 200,
|
|
|
msg: "Success",
|
|
|
student: {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
- 400
|
|
|
```
|
|
|
{
|
|
|
status: 400,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: "",
|
|
|
msg: "Invalid value for \"id\""
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 404
|
|
|
```
|
|
|
{
|
|
|
status: 404,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: 10,
|
|
|
msg: "Student not found with id=10"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 500
|
|
|
```
|
|
|
{
|
|
|
status: 500,
|
|
|
msg: "Internal error occurred",
|
|
|
errors: Any
|
|
|
}
|
|
|
```
|
|
|
|
|
|
---
|
|
|
|
|
|
### POST /students/
|
|
|
|
|
|
#### Params:
|
|
|
Nenhum parâmetro esperado
|
|
|
|
|
|
#### Query string:
|
|
|
Nenhuma query string esperada
|
|
|
|
|
|
#### Payload:
|
|
|
```
|
|
|
{
|
|
|
student: {
|
|
|
name: "str",
|
|
|
idade: 26,
|
|
|
email: "str",
|
|
|
semester: 5,
|
|
|
course: "str"
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
#### Responses:
|
|
|
|
|
|
- 201:
|
|
|
```
|
|
|
{
|
|
|
status: 201,
|
|
|
msg: "Success",
|
|
|
student: {
|
|
|
id: 1,
|
|
|
name: "str",
|
|
|
idade: 26,
|
|
|
email: "str",
|
|
|
semester: 5,
|
|
|
course: "str"
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
- 400:
|
|
|
```
|
|
|
{
|
|
|
status: 400,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: "joao.severo",
|
|
|
msg: "Invalid value for \"email\""
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 404
|
|
|
```
|
|
|
{
|
|
|
status: 404,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: 10,
|
|
|
msg: "Student not found with id=10"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 500
|
|
|
```
|
|
|
{
|
|
|
status: 500,
|
|
|
msg: "Internal error occurred",
|
|
|
errors: Any
|
|
|
}
|
|
|
```
|
|
|
---
|
|
|
|
|
|
### PUT /students/{id}/
|
|
|
|
|
|
#### Params:
|
|
|
- id: int = id do aluno a atualizar dados
|
|
|
|
|
|
#### Query string:
|
|
|
Nenhuma query string esperada
|
|
|
|
|
|
#### Payload:
|
|
|
```
|
|
|
{
|
|
|
student: {
|
|
|
name: "str",
|
|
|
idade: 26,
|
|
|
email: "str",
|
|
|
semester: 5,
|
|
|
course: "str"
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Responses
|
|
|
|
|
|
- 204: NO_CONTENT
|
|
|
|
|
|
- 400:
|
|
|
```
|
|
|
{
|
|
|
status: 400,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: "joao.severo",
|
|
|
msg: "Invalid value for \"email\""
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 500
|
|
|
```
|
|
|
{
|
|
|
status: 500,
|
|
|
msg: "Internal error occurred",
|
|
|
errors: Any
|
|
|
}
|
|
|
```
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
### PATCH /students/{id}/
|
|
|
|
|
|
#### Params:
|
|
|
- id: int = id do aluno a complementar informações
|
|
|
|
|
|
#### Query string:
|
|
|
Nenhuma query string esperada
|
|
|
|
|
|
#### Payload:
|
|
|
```
|
|
|
{
|
|
|
student: {
|
|
|
description: "str",
|
|
|
experienceId: 1,
|
|
|
lattesId: 8979
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
---
|
|
|
|
|
|
### POST /login/
|
|
|
|
|
|
#### Params:
|
|
|
Nenhum parâmetro esperadao
|
|
|
|
|
|
#### Query string:
|
|
|
Nenhuma query string esperada
|
|
|
|
|
|
#### Payload:
|
|
|
```
|
|
|
{
|
|
|
email: "str",
|
|
|
password: "str",
|
|
|
isTeacher: 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Responses:
|
|
|
- 204: NO_CONTENT
|
|
|
|
|
|
- 400:
|
|
|
```
|
|
|
{
|
|
|
status: 400,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: "joao.severo",
|
|
|
msg: "Invalid value for \"email\""
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 401:
|
|
|
```
|
|
|
{
|
|
|
status: 401,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: "email/password",
|
|
|
msg: "Invalid email or password"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 500
|
|
|
```
|
|
|
{
|
|
|
status: 500,
|
|
|
msg: "Internal error occurred",
|
|
|
errors: Any
|
|
|
}
|
|
|
```
|
|
|
---
|
|
|
|
|
|
### GET /teachers/{id}/
|
|
|
|
|
|
#### Params:
|
|
|
- id: int = id do professor que se deseja abrir o perfil
|
|
|
|
|
|
#### Query string:
|
|
|
Nenhuma query string esperada
|
|
|
|
|
|
#### Payload:
|
|
|
Nenhum payload esperado
|
|
|
|
|
|
#### Responses:
|
|
|
- 200:
|
|
|
```
|
|
|
{
|
|
|
status: 200,
|
|
|
msg: "Success",
|
|
|
teacher: {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
- 400:
|
|
|
```
|
|
|
{
|
|
|
status: 400,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: "",
|
|
|
msg: "Invalid value for \"id\""
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 404
|
|
|
```
|
|
|
{
|
|
|
status: 404,
|
|
|
msg: "Bad request",
|
|
|
errors: [
|
|
|
{
|
|
|
value: 10,
|
|
|
msg: "Student not found with id=10"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
- 500
|
|
|
```
|
|
|
{
|
|
|
status: 500,
|
|
|
msg: "Internal error occurred",
|
|
|
errors: Any
|
|
|
}
|
|
|
```
|
|
|
---
|
|
|
|