Skip to content

laioviana/spring-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Assignment

Running the project

To run the project execute the mvn spring-boot:run command. To run the tests execute the mvn test command.

Before running the project make sure the Postgres database is populated and running.

You can do that with Docker using docker-compose up in the project root folder Or, add manually with schema.sql and data.sql located inside the database-init folder.

Please use admin and passwordfor basic authentication

You can also access the swagger ui interface in http://localhost:8080/swagger-ui.html

API Documentation

GET /location/{postcodeA}/{postcodeB}

Calculates the distance between two postcodes

Parameters

Name Type Description
postcodeA string string related to the first postcode
postcodeB string string related to the second postcode

Responses

Status Meaning Description
200 OK successful operation
400 Bad Request wrong input parameters
404 Not Found postcode not found

PUT /location/{locationId}

Updates location with new latitude and longitude

Path/Body Parameters

Name Type Description
locationId long id for the location that will be updated
latitude string string that will be updated to the location
longitude string string that will be updated to the location

Responses

Status Meaning Description
200 OK successful operation
400 Bad Request wrong input parameters
404 Not Found location not found

About

standard spring boot application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages