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

Last edited by ESKieroff Oct 19, 2024
Page history

backend_users

Home Escopo Processo Design/Mockups Gerência Estudos Arquitetura Contratos BD Qualidade Configuração Instalação Instruções Utilização Analytics Infraestrutura Dicas

Users - usuários

fields:

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:

{
  "email": "[email protected]",
  "password": "cpplanta"
}

response:

{
  "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:

[
  {
    "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:

{
  "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:

request

response:

{
  "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:

{
  "message": "User ID 12 deleted successfully"
}

Reactvate

POST http://localhost:3000/users/activate/12

request: no body

response:

{
  "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