Skip to content

ccfantini/task-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Control API

It is a demonstrative REST API application for task management developed using Spring Boot with H2 database and OAuth2 to authentication.

Heroku

The project is published on the HEROKU platform integrated with GitHub.

https://itau-task-control.herokuapp.com/swagger-ui.html

Settings

  • It is not necessary to make any changes to the application.properties
  • The data.sql file contains the data of users previously registered when starting the application.

Getting Started

  1. Install Java JDK 1.8 and set it as an environment variable.

  2. Install Maven and set it as an environment variable.

  3. Build the project with the following commands.

    mvn clean install

    mvn package

  4. Execute the project.

    java -jar target/itau-task-control-0.0.1.jar

  5. Access the Swgger UI.

    https://localhost:8080/swagger-ui.htm

swagger-ui

How-to

  1. Authenticate (OAuth2) the user using the example postman or curl command.

    curl --location --request POST 'https://localhost:8080/oauth/token' --header 'Authorization: Basic aXRhdS10YXNrOml0YXUtdGFzay1zZWNyZXQ=' --form 'username=juliana' --form 'password=juli2020' --form 'grant_type=password'

  • It is also possible to use API through the swagger page.
  • In the swagger, fill in the Authorization field the following "Bearer [ACCESS_TOKEN]"
  1. Register task.

    curl -X POST "https://localhost:8080/tasks" -H "accept: /" -H "Authorization: Bearer l+2nilfBzQOudwMWJ6wuTRNWHKE=" -H "Content-Type: application/json" -d "{"description": "teste 222", "status": "PENDING", "summary": "teste 222"}"

  2. Search all tasks.

    curl -X GET "https://localhost:8080/tasks" -H "accept: /" -H "Authorization: Bearer l+2nilfBzQOudwMWJ6wuTRNWHKE="

  3. Update a task.

    curl -X PUT "https://localhost:8080/tasks" -H "accept: /" -H "Authorization: Bearer bnayOvEPJIrDDgGI8Xxizf6mUsw=" -H "Content-Type: application/json" -d "{ "id": 2, "summary": "teste alterada", "description": "teste desc alterada", "status": "COMPLETED" }"

  4. Search task by status.

    curl -X GET "https://localhost:8080/tasks/status/PENDING" -H "accept: /" -H "Authorization: Bearer +W7oZ3o7mZAFLlabMCb2mRyecx4="

  5. Delete task by ID.

    curl -X DELETE "https://localhost:8080/tasks/1" -H "accept: /" -H "Authorization: Bearer +W7oZ3o7mZAFLlabMCb2mRyecx4="

Health Check

curl -X GET "https://localhost:8080/actuator/health" -H "accept: /" -H "Authorization: Bearer X/JptYEx1/y6gZGHYDbc2M6hDAA="

Log (HTTP Trace)

curl -X GET "https://localhost:8080/actuator/httptrace" -H "accept: /" -H "Authorization: Bearer X/JptYEx1/y6gZGHYDbc2M6hDAA="

Metrics

Unit Test

  • Execute mvn test
  • Reports cd target/surefire-reports/

Documentation

  • Execute mvn javadoc:javadoc

  • Reports cd target/site/apidocs Open index.html

Technologies

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages