Giter Site home page Giter Site logo

api_rest-todolist_springboot's Introduction

Read Me First

o PROJETO a seguir tem como principal objetivo:

  • Uma aplicação de uma API Rest com controle de usuários e manipulação de listas, com foco em praticar conhecimentos adquiridos durante estudos.
  • As principais funções dentro do sistema são as seguintes: criar usuário, fazer login do usuário e uma lista individual para cada usuário.

Getting Started

Tools

Requirement

  • Spring Boot 3.1.11
  • Java 17
# Clone este repositório
$ git clone 

# Acesse a pasta do projeto no terminal/cmd
$ cd API_REST-ToDoList_SpringBoot

# Instale as dependências
$ mvn clean package

# Execute a aplicação 
$ mvn spring-boot:run

# O servidor inciará na porta:8081 - acesse http://localhost:8081/

Config File Application.properties

spring.datasource.username= Nome do seu usuario
spring.datasource.password= Senha do seu usuario

//Se tiver usando MySQL deve ser feito as seguintes configurações
spring.datasource.url=jdbc:mysql://localhost:3306/nomeDoSeuBancoDeDados

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect

//Se tiver usando PostgreSQL deve ser feito as seguintes configurações
spring.datasource.url=jdbc:postgresql://localhost:5432/nomeDoSeuBancoDeDados

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect

spring.jpa.hibernate.ddl-auto=update

spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true

Endpoints

Os Endpoints a seguir ilustram como usar alguns recursos concretamente:


User

Route function : Create User

Request:

{
	"name":"Teste",
	"username":"testeInicial",
	"email":"[email protected]",
	"password":"123"
}

Response:

{
	"id": "5a6ab725-1293-4f53-8070-701682deed8a",
	"name": "Teste",
	"username": "testeInicial",
	"password": "123",
	"email": "[email protected]",
	"createdAt": "2024-05-01T10:55:16.6729464"
}

Route function : Login

Request:

{
	"username":"testeInicial",
	"password":"123456"
}

Response:

{
	"id": "23b377ad-0f67-4eb5-b34b-801a41aa3de4",
	"name": "Teste",
	"username": "testeInicial",
	"email": "[email protected]",
	"createdAt": "2024-05-02T08:43:41.486564",
	"tasks": []
}

Route function : Update

Request:

{
	"name":"testeInicial",
	"username":"testeInicialupdate",
	"email":"[email protected]"
}

Response:

{
	"id": "5a6ab725-1293-4f53-8070-701682deed8a",
	"name": "testeInicial",
	"username": "testeInicialUpdate",
	"password": "123456",
	"email": "[email protected]",
	"createdAt": "2024-05-01T10:55:16.672946",
	"updateAt": "2024-05-01T11:09:02.1732391"
}

Route function : Password Update

Request:

{
	"password":"123456"
}

Response:

204 No Content

Route function : User Delete

Request:

Response:

204 No Content

Task

Route function : Task Create

Request:

{
  "title":"TesteA",
	"description":"Lorem lorem lorem lorem",
	"userid":"4ebac25f-4a04-4e4b-9e51-d12d47fbe989"
}

Response:

{
	"id": "2849510f-4bbb-4d5b-8f8e-515b4c1847ad",
	"title": "TesteA",
	"description": "Lorem lorem lorem lorem",
	"taskStatus": "pending",
	"createdAt": "2024-04-30T20:39:33.1564987",
	"userid": "4ebac25f-4a04-4e4b-9e51-d12d47fbe989"
}

Route function : List Task

Request:

Response:

[
	{
		"id": "3b24ea59-bd7d-4d31-b3cb-5bb68d11a102",
		"title": "TesteA",
		"description": "Lorem lorem lorem lorem",
		"taskStatus": "pending",
		"createdAt": "2024-04-30T11:33:59.613501",
		"updateAt": null
	},
	{
		"id": "5c464f52-eaad-45a3-82ae-d287f763924a",
		"title": "TestB",
		"description": "Lorem lorem lorem lorem",
		"taskStatus": "pending",
		"createdAt": "2024-04-30T11:33:45.913812",
		"updateAt": null
	},
	{
		"id": "be531191-1d2c-4388-9db7-be06bfd4676b",
		"title": "TestC",
		"description": "Lorem lorem lorem lorem",
		"taskStatus": "pending",
		"createdAt": "2024-04-30T11:33:53.99484",
		"updateAt": null
	}
]

Route function : List Task by status

Status disponivel no sistema : completed / pending

Request:

Response:

[
	{
		"id": "0067dbce-eab0-406c-856b-25dade66e0d6",
		"title": "TestB",
		"description": "Lorem lorem lorem lorem",
		"taskStatus": "pending",
		"createdAt": "2024-04-30T20:34:36.602814",
		"updateAt": null
	},
	{
		"id": "157fa2f3-0da6-4d40-8d76-2032fd825fb8",
		"title": "TestA",
		"description": "Lorem lorem lorem lorem",
		"taskStatus": "pending",
		"createdAt": "2024-04-30T20:34:48.494089",
		"updateAt": null
	},
	{
		"id": "2849510f-4bbb-4d5b-8f8e-515b4c1847ad",
		"title": "TestC",
		"description": "Lorem lorem lorem lorem",
		"taskStatus": "pending",
		"createdAt": "2024-04-30T20:39:33.156499",
		"updateAt": null
	}
]

Route function : Update

Request:

{
  "id":"3b24ea59-bd7d-4d31-b3cb-5bb68d11a102",
	"title":"TesteUpdate",
	"description":"testando rota de update task"
}

Response:

{
	"id": "7bc9a477-1b31-4abc-9352-7edace5cb284",
	"title": "TesteUpdate",
	"description": "testando rota de update task'",
	"taskStatus": "pending",
	"createdAt": "2024-05-02T08:57:13.807188",
	"userid": "23b377ad-0f67-4eb5-b34b-801a41aa3de4"
}

Route function : Update Status

Request:

Response:

{
	"id": "e67d5959-34da-4cbe-a169-56611f4f4211",
	"title": "Teste 3 EEEEEE",
	"description": "Lorem lorem lorem lorem",
	"taskStatus": "completed",
	"createdAt": "2024-04-30T20:34:58.376134",
	"userid": "4ebac25f-4a04-4e4b-9e51-d12d47fbe989"
}

Route function : Task Delete

Request:'

Response:

204 No Content'

api_rest-todolist_springboot's People

Contributors

joaoribeiro20 avatar

Watchers

 avatar

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.