Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • W wiki
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • 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
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Dietoterapia
  • wiki
  • Wiki
  • endpoints

Last edited by João Lucas de Almeida Oct 17, 2018
Page history
This is an old version of this page. You can view the most recent version or browse the history.

endpoints

Home Sprints Requisitos Arquitetura Configuração Endpoints Mockups Problemas

Abaixo os comandos o cadastro e funções dentro do aplicativo:

1. Usuário:

Cadastrar   POST: api/usuarios/
{
  "id": "",
  "cpf": "1111111112",
  "email": "[email protected]",
  "matricula": "101011",
  "nome": "Admin1",
  "senha": "e10adc3949ba59abbe56e057f20f883e",
  "tipo": "ADMIN", *** ou "USER"
  "status": true
}
Alterar   PUT: api/usuarios/update
{
  "id": 1,
  "cpf": "1111111112",
  "email": "[email protected]",
  "matricula": "101011",
  "nome": "Admin1",
  "senha": "e10adc3949ba59abbe56e057f20f883e",
  "tipo": "ADMIN", *** ou "USER"
  "status": true
}
Buscar Por ID   GET: api/usuarios/{id} || *api/usuarios/12*
{
  "id": 1,
  "cpf": "1111111112",
  "email": "[email protected]",
  "matricula": "101011",
  "nome": "Admin1",
  "senha": "e10adc3949ba59abbe56e057f20f883e",
  "tipo": "ADMIN", *** ou "USER"
  "status": true,
  "valid": true
}
Listar Todos   GET: api/usuarios
{
  "Usuarios": [
    {
      "id": 1,
      "cpf": "1111111112",
      "email": "[email protected]",
      "matricula": "101011",
      "nome": "Admin1",
      "senha": "e10adc3949ba59abbe56e057f20f883e",
      "tipo": "ADMIN", *** ou "USER"
      "status": true,
      "valid": true
    },
    {
      "id": 2,
      "cpf": "1111111112",
      "email": "[email protected]",
      "matricula": "101011",
      "nome": "Admin1",
      "senha": "e10adc3949ba59abbe56e057f20f883e",
      "tipo": "ADMIN", *** ou "USER"
      "status": true,
      "valid": true
    }
  ]
}
Deletar Por ID   DELETE: api/usuarios/{id} || *api/usuarios/23413252*
Sem retorno de json

2. Ingredientes e seus Atributos:

Cadastrar   POST: api/ingredientes/
{
    "id": "",
    "nome": "Arroz",
    "origem": "Taco",
    "status": true,
    "criador": { "id": 1 },
    "ingredienteAtributo": [
         {
          "atributo": { "id": 1, "tipo" : "NULL" },
          "valor": "45"
        }
    ],
   "tipo": "PRIVADO", *** ou "COMUM"
}
Alterar   PUT: api/ingredientes/update
{
    "id": "1",
    "nome": "Arroz",
    "origem": "Taco",
    "status": true,
    "criador": { "id": 1, "tipo" : "NULL" },
    "ingredienteAtributo": [
         {
          "atributo": { "id": 1 },
          "valor": "45"
        },
         {
          "atributo": { "id": 2 },
          "valor": null
        }
    ],
    "tipo": "PRIVADO", *** ou "COMUM"
}
Buscar Por ID   GET: api/ingredientes/{id} || *api/ingredientes/12*
{
  "id": 1,
  "nome": "testeMock6734",
  "origem": "tacoMock",
  "status": true,
  "tipo": "PRIVADO", *** ou "COMUM"
  "criador": {
    "id": 1,
    "cpf": "1111111112",
    "email": "[email protected]",
    "matricula": "101011",
    "nome": "Admin1",
    "senha": "e10adc3949ba59abbe56e057f20f883e",
    "tipo": "ADMIN", *** ou "USER"
    "status": true,
    "valid": true
  },
  "ingredienteAtributo": [
    {
      "atributo": {
        "id": 3,
        "nome": "falasio",
        "unidade": "o",
        "multiplicador": 9,
        "obrigatorio": true,
        "status": true,
        "active": true
      },
      "valor": null
    },
    {
      "atributo": {
        "id": 1,
        "nome": "calcioEdited",
        "unidade": "ga",
        "multiplicador": 41,
        "obrigatorio": false,
        "status": true,
        "active": true
      },
      "valor": "46"
    }
  ]
}
Listar Todos   GET: api/ingredientes
{
  "Ingredientes": [
    {
      "id": 1,
      "nome": "Arroz",
      "origem": "Taco",
      "tipo": "COMUM", ** ou "PRIVADO"
      "criador": {
        "id": 1,
        "cpf": "1111111112",
        "email": "[email protected]",
        "matricula": "101011",
        "nome": "Admin1",
        "senha": "e10adc3949ba59abbe56e057f20f883e",
        "tipo": "ADMIN", *** ou "USER"
        "status": true,
        "valid": true
      },
      "ingredienteAtributo": [
        {
          "atributo": {
            "id": 1,
            "nome": "potasio",
            "unidade": "g",
            "multiplicador": 5,
            "obrigatorio": true,
            "status": true,
            "active": true
          },
          "valor": "45"
        },
        {
          "atributo": {
            "id": 2,
            "nome": "calcio",
            "unidade": "g",
            "multiplicador": 9,
            "obrigatorio": true,
            "status": true,
            "active": true
          },
          "valor": null
        },
        ......
      ],
      "status": true
    },
    outros ingrediente......
  ]
}

3. Atributos:

Cadastrar   POST: api/atributos/
{
  "id": "",
  "nome": "calcio",
  "unidade": "g",
  "multiplicador": 41,
  "ordem": 1,
  "obrigatorio": false,
  "status": true,
  "active": true
}
Alterar   PUT: api/atributos/update
{
  "id": "1",
  "nome": "calcio",
  "unidade": "g",
  "multiplicador": 41,
  "ordem": 1,
  "obrigatorio": false,
  "status": true
}
Buscar Por ID   GET: api/atributos/{id} || *api/atributos/12*
{
  "id": "1",
  "nome": "calcio",
  "unidade": "g",
  "multiplicador": 41,
  "ordem": 1,
  "obrigatorio": false,
  "status": true
}
Listar Todos   GET: api/atributos
{
  "Atributos": [
    {
      "id": 1,
      "nome": "calcioEdited",
      "unidade": "ga",
      "multiplicador": 41,
      "obrigatorio": false,
      "ordem": 1,
      "status": true,
      "active": true
    },
    .......
  ]
}

4. Grupos de Receitas:

Cadastrar   POST: api/grupos/
{
      "id": "",
      "nome": "Sobremesa",
      "custo": 32,
      "status": true
}
Alterar   PUT: api/grupos/update
{
      "id": 12,
      "nome": "Sobremesa",
      "custo": 32,
      "status": true
}
Buscar Por ID   GET: api/grupos/{id} || *api/grupos/12*
{
      "id": 12,
      "nome": "Sobremesa",
      "custo": 32,
      "status": true,
      "active": true
}
Listar Todos   GET: api/grupos
{
  "Grupos": [
    {
      "id": 1,
      "nome": "Sobremesa",
      "custo": 32,
      "status": true,
      "active": true
    },
    ......
  ]
}

5. Login:

Logar   POST: api/auth
{
    "email" : "[email protected]",
    "senha" : "123456"
}

6. Receitas:

Cadastrar   POST: api/receitas/
{
	"id": "",
	"nome": "Trufas de Chocolate",
	"status": "true",
        "passos": [
            "limpar",
            "fever",
            "reserve"
        ],
	"rendimento": 20,
	"tempo": "2 horas",
	"imagem": "Imagem",
	"tipo": "PUBLICO",
	"criadores":[{"id": "1", "tipo":"NULL"}],
	"receitaIngrediente": [
		 {
	       "ingrediente": {"id": 1, "tipo":"NULL"},
	       "custoKg": "5",
	       "pesoG": "5"
	    }
	],
	"professor": {"id": "1", "tipo":"NULL"},
	"grupoReceita": {"id": "1"}
}
Alterar   PUT: api/receitas/update
{
	"id": "2",
	"nome": "Trufas de Chocolate",
	"status": "true",
        "passos": [
            "limpar",
            "fever",
            "reserve"
        ],
	"rendimento": 20,
	"tempo": "2 horas",
	"imagem": "Imagem",
	"tipo": "PUBLICO",
	"criadores":[{"id": "1", "tipo":"NULL"}],
	"receitaIngrediente": [
		 {
	       "ingrediente": {"id": 1, "tipo":"NULL"},
	       "custoKg": "5",
	       "pesoG": "5"
	    }
	],
	"professor": {"id": "1", "tipo":"NULL"},
	"grupoReceita": {"id": "1"}
}
Buscar Por ID   GET: api/receitas/{id} || *api/receitas/12*
{
    "id": 2,
    "nome": "Trufas de Chocolate2",
    "status": false,
        "passos": [
            "limpar",
            "fever",
            "reserve"
        ],
    "rendimento": 24,
    "criadores": [
        {
            "id": 1,
            "cpf": "1111111111",
            "email": "[email protected]",
            "matricula": "101010",
            "nome": "Admin",
            "senha": "c56d0e9a7ccec67b4ea131655038d604",
            "tipo": "ADMIN",
            "status": true,
            "valid": true
        }
    ],
    "receitaIngrediente": [
        {
            "ingrediente": {
                "id": 1,
                "nome": "Feijao7",
                "criador": {
                    "id": 1,
                    "cpf": "1111111111",
                    "email": "[email protected]",
                    "matricula": "101010",
                    "nome": "Admin",
                    "senha": "c56d0e9a7ccec67b4ea131655038d604",
                    "tipo": "ADMIN",
                    "status": true,
                    "valid": true
                },
                "origem": "Taco1",
                "status": true,
                "ingredienteAtributo": [
                    {
                        "atributo": {
                            "id": 1,
                            "nome": "calcio",
                            "unidade": "g",
                            "multiplicador": 41,
                            "obrigatorio": false,
                            "status": true,
                            "active": true
                        },
                        "valor": "23"
                    }
                ],
                "tipo": "PRIVADO"
            },
            "custoKg": 5,
            "pesoG": 5
        }
    ],
    "professor": {
        "id": 1,
        "cpf": "1111111111",
        "email": "[email protected]",
        "matricula": "101010",
        "nome": "Admin",
        "senha": "c56d0e9a7ccec67b4ea131655038d604",
        "tipo": "ADMIN",
        "status": true,
        "valid": true
    },
    "grupoReceita": {
        "id": 1,
        "nome": "Sobremesa",
        "custo": 32,
        "status": true,
        "active": true
    }
}
Listar Todos   GET: api/receitas
{
    "Receitas": [
        {
            "id": 2,
            "nome": "Trufas de Chocolate2",
            "status": false,
            "passos": [
                "limpar",
                "fever",
                "reserve"
            ],
            "rendimento": 24,
            "criadores": [
                {
                    "id": 1,
                    "cpf": "1111111111",
                    "email": "[email protected]",
                    "matricula": "101010",
                    "nome": "Admin",
                    "senha": "c56d0e9a7ccec67b4ea131655038d604",
                    "tipo": "ADMIN",
                    "status": true,
                    "valid": true
                }
            ],
            "receitaIngrediente": [
                {
                    "ingrediente": {
                        "id": 1,
                        "nome": "Feijao7",
                        "criador": {
                            "id": 1,
                            "cpf": "1111111111",
                            "email": "[email protected]",
                            "matricula": "101010",
                            "nome": "Admin",
                            "senha": "c56d0e9a7ccec67b4ea131655038d604",
                            "tipo": "ADMIN",
                            "status": true,
                            "valid": true
                        },
                        "origem": "Taco1",
                        "status": true,
                        "ingredienteAtributo": [
                            {
                                "atributo": {
                                    "id": 1,
                                    "nome": "calcio",
                                    "unidade": "g",
                                    "multiplicador": 41,
                                    "obrigatorio": false,
                                    "status": true,
                                    "active": true
                                },
                                "valor": "23"
                            }
                        ],
                        "tipo": "PRIVADO"
                    },
                    "custoKg": 5,
                    "pesoG": 5
                }
            ],
            "professor": {
                "id": 1,
                "cpf": "1111111111",
                "email": "[email protected]",
                "matricula": "101010",
                "nome": "Admin",
                "senha": "c56d0e9a7ccec67b4ea131655038d604",
                "tipo": "ADMIN",
                "status": true,
                "valid": true
            },
            "grupoReceita": {
                "id": 1,
                "nome": "Sobremesa",
                "custo": 32,
                "status": true,
                "active": true
            }
        },
    ......
  ]
}

7.  Pacientes:

Cadastrar   `POST api/pacientes`
    {
        "nome": "João da Silva",
        "sexo": "M",
        "dataNascimento": "1990-03-15",
        "restricaoAlimentar": "eutrofico"
    }
Alterar   `PUT api/pacientes/update`
    {
        "id": 1,
        "nome": "João da Silva",
        "sexo": "M",
        "dataNascimento": "1990-03-15",
        "restricaoAlimentar": "eutrofico"
    }
Buscar Por ID   `GET api/pacientes/{id}`
    {
        "id": 1,
        "nome": "João da Silva",
        "sexo": "M",
        "dataNascimento": "1990-03-15",
        "restricaoAlimentar": "eutrofico"
    }
Buscar Todos   `GET api/pacientes`
    {
        "Pacientes": [
            {
                "id": 1,
                "nome": "João da Silva",
                "sexo": "M",
                "dataNascimento": "1990-03-15",
                "restricaoAlimentar": "eutrofico"
            },
            {
                "id": 2,
                "nome": "Maria de Souza",
                "sexo": "F",
                "dataNascimento": "1980-07-28",
                "restricaoAlimentar": "vegetariano"
            }
        ]
    }
Deletar Por ID   `DELETE api/pacientes/{id}`

Sem retorno de JSON

Clone repository
  • Arquitetura
  • Configuração
  • Requisitos
  • configuracoes
    • Angular
    • Diagrama ER
    • Git
    • IntelliJ
    • Wiki
  • endpoints
  • Home
  • mockups
  • problemas
  • sprints