Giter Club home page Giter Club logo

crud-base-springboot's Introduction

CRUD Logo

API Crud-Base

Base de CRUD feito em Java com Springboot

Java SpringBoot Apache Maven PostgreSQL

Como usar

  • Precisará criar um banco de dados com o nome crud-base em PostgreSQL, para isso rode o Script localizado na raiz do projeto:

    $ ./script-create-data-base.sh
    
  • Após, execute no terminal:

    $ mvn clean install
    
  • Entao execute a API pela IDE;

Abaixo um exemplo de inserção:

Metodo: POST
EndPoint: localhost:8080/person/create
Body:

{
    "name": "Teste",
    "cellphone": "00000000000",
    "phone": "1111111111",
    "address": "Rua teste",
    "email": "[email protected]"
}

Response:

{
    "object": {
        "id": "acca6f1e-444a-4ade-9318-6503a10e0b5b",
        "createdAt": "2022-03-04T18:41:18Z",
        "updatedAt": null,
        "name": "Teste",
        "cellphone": "00000000000",
        "phone": "1111111111",
        "address": "Rua teste",
        "email": "[email protected]"
    },
    "listObject": null,
    "situation": "SUCCESS",
    "message": "Person created successfully"
}

Resultado Final

Person

  • Banco de dados: image
  • JSON getAll:
{
    "object": null,
    "listObject": [
        [
            {
                "id": "acca6f1e-444a-4ade-9318-6503a10e0b5b",
                "createdAt": "2022-03-04T18:41:18Z",
                "updatedAt": null,
                "name": "Teste",
                "cellphone": "00000000000",
                "phone": "1111111111",
                "address": "Rua teste",
                "email": "[email protected]"
            }
        ]
    ],
    "situation": "SUCCESS",
    "message": "Person found"
}

Course

  • Banco de dados: image
  • JSON getAll:
{
    "object": null,
    "listObject": [
        [
            {
                "id": "dc1e310b-9b87-4132-8309-affb9de95486",
                "createdAt": "2022-03-04T18:56:28Z",
                "updatedAt": null,
                "name": "Tecnologia em Analise e Desenvolvimento de Software",
                "situation": "ACTIVE"
            }
        ]
    ],
    "situation": "SUCCESS",
    "message": "Course found"
}

Students

  • Banco de dados: image
  • JSON getAll:
{
    "object": null,
    "listObject": [
        [
            {
                "id": "92560835-dfa3-47ee-84e7-4c3cd2c464a6",
                "createdAt": "2022-03-04T18:59:43Z",
                "updatedAt": null,
                "course": {
                    "id": "dc1e310b-9b87-4132-8309-affb9de95486",
                    "createdAt": "2022-03-04T18:56:28Z",
                    "updatedAt": null,
                    "name": "Tecnologia em Analise e Desenvolvimento de Software",
                    "situation": "ACTIVE"
                },
                "person": {
                    "id": "acca6f1e-444a-4ade-9318-6503a10e0b5b",
                    "createdAt": "2022-03-04T18:41:18Z",
                    "updatedAt": null,
                    "name": "Teste",
                    "cellphone": "00000000000",
                    "phone": "1111111111",
                    "address": "Rua teste",
                    "email": "[email protected]"
                }
            }
        ]
    ],
    "situation": "SUCCESS",
    "message": "Students found"
}

EndPoints

Person

/person
├───/getAll
├───/getById
|      └───/{id}
├───/create
├───/update
|      └───/{id}
└───/delete
       └───/{id}

Course

/course
├───/getAll
├───/getById
|      └───/{id}
├───/create
├───/update
|      └───/{id}
└───/delete
       └───/{id}

Students

/students
├───/getAll
├───/getById
|      └───/{id}
├───/create
├───/update
|      └───/{id}
└───/delete
       └───/{id}

Desenvolvido com 💜 por RBalconi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.