Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Wiki Wiki
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 52
    • Issues 52
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CP - Planta
  • WikiWiki
  • Wiki
  • backend_users

backend_users · Changes

Page history
docs: docs authored Oct 19, 2024 by Rodrigo Oliveira Rosa's avatar Rodrigo Oliveira Rosa
Hide whitespace changes
Inline Side-by-side
backend_users.md 0 → 100644
View page @ e9b6d2ca
| [Home](home) | [**Escopo**](escopo) | [Processo](processo) | [Design/Mockups](design_mockups) | [Gerência](gerencia) | [Estudos](estudos) | [Arquitetura](arquitetura) | [Contratos](contratos) | [BD](banco_dados) | [Qualidade](qualidade) | [Configuração](configuracao) | [Instalação](instalacao) | [Instruções](instrucoes) | [Utilização](utilizacao) | [Analytics](Analytics) | [Infraestrutura](infraestrutura) | [Dicas](dicas) |
| :-------: | :---------------------: | :---------------: | :---------------------------: | :----------------: | :-------------: | :---------------------: | :-----------------: | :------------: | :-----------------: | :-------------------------: | :---------------------: | :---------------------: | :---------------------: | :-----------------: | :---------------------------: | :---------: |
# Users - usuários
fields:
```js
id: number;
email: string;
password: string;
role: Role;
username: string;
first_name: string;
last_name: string;
gender: Gender;
active: boolean;
```
Endpoints:
## Create
POST http://localhost:3000/users/
request:
```json
{
"email": "[email protected]",
"password": "cpplanta"
}
```
response:
```json
{
"id": 15,
"username": null,
"email": "[email protected]",
"active": true,
"role": "DEFAULT",
"first_name": null,
"last_name": null,
"gender": "OTHER",
"created_at": "19/10/2024 01:50:35",
"updated_at": "19/10/2024 01:50:35"
}
```
Observações:
"role" serve para diferenciar o papel, por exemplo:
ADMIN (Cássio),
ROOT (sistema),
DEMO (demonstração/ apresentação final)
O campo "active", onde ocorrer, serve para exclusão lógica do registro. Quando não houver, a remoção é física.
## FindAll
GET http://localhost:3000/users/
request: no body
QueryParams:
orderBy
fields:
'id',
'username',
'email',
'first_name',
'last_name',
'gender',
'role',
'created_at',
'updated_at'
response:
```json
[
{
"id": 10,
"username": "root",
"email": "[email protected]",
"active": true,
"role": "ROOT",
"first_name": "CP",
"last_name": "Planta",
"gender": "MALE",
"created_at": "18/10/2024 00:09:25",
"updated_at": "18/10/2024 00:09:25"
},
{
"id": 11,
"username": "Cassio",
"email": "[email protected]",
"active": true,
"role": "ROOT",
"first_name": "Cassio",
"last_name": "Santos",
"gender": "MALE",
"created_at": "18/10/2024 00:09:25",
"updated_at": "18/10/2024 00:09:25"
},
{
"id": 12,
"username": "Roberto",
"email": "[email protected]",
"active": true,
"role": "DEMO",
"first_name": "Roberto",
"last_name": "Da Silva",
"gender": "MALE",
"created_at": "18/10/2024 00:09:25",
"updated_at": "18/10/2024 00:09:25"
},
(...)
]
```
## FindById
GET http://localhost:3000/users/12
request: no body
response:
```json
{
"id": 12,
"username": "Roberto",
"email": "[email protected]",
"active": true,
"role": "DEMO",
"first_name": "Roberto",
"last_name": "Da Silva",
"gender": "MALE",
"created_at": "18/10/2024 00:09:25",
"updated_at": "18/10/2024 00:09:25"
}
```
## Update
PATH http://localhost:3000/users/12
request:
- queryparams:
![1729314551145](resources/images/backend/Contratosbackefront/1729314551145.png)
response:
```json
{
"id": 12,
"username": "fernanda",
"email": "[email protected]",
"active": true,
"role": "DEFAULT",
"first_name": "Fernanda",
"last_name": "Silva",
"gender": "FEMALE",
"created_at": "18/10/2024 00:09:25",
"updated_at": "19/10/2024 02:07:17"
}
```
## Delete
DELETE http://localhost:3000/users/12
request: no body
response:
```json
{
"message": "User ID 12 deleted successfully"
}
```
## Reactvate
POST http://localhost:3000/users/activate/12
request: no body
response:
```json
{
"message": "User ID 12 activated successfully"
}
```
Clone repository
  • Infraestrutura
  • Utilizando a wiki
    • adicionando imagens
    • escrevendo em markdown
    • wiki no editor de texto
  • analytics
  • arquitetura
  • backend_categories
  • backend_inicio
  • backend_persons
  • backend_production_order
  • backend_products
  • backend_qualidade
  • backend_settings
  • backend_stock
  • backend_stock_locations
View All Pages