The application converts salary to PLN.
- Adding the new country
- Added countries
- Prerequisites
- Installing
- Metric tools and consoles provided
- API Endpoint
- Example
- Built with
- You can use POST in swagger.
http://localhost:8080/swagger-ui.html#/
- Or add countries to the
import.sql
file before running the application.
- United Kingdom -
UK
- Germany -
DE
- Poland -
PL
- Maven
- JDK 8
-
(Optional) Set profile via
application.properties
(production or development). The default profile is development. -
Build and run the application:
mvn install
cd target
java -jar salaryapp-1.0-SNAPSHOT.war
or
docker build --tag mikbac/salary_app:1.0 -f Dockerfile .
docker container run -p 8080:8080 --ip 0.0.0.0 --name salary_app mikbac/salary_app:1.0
- Open the browser and hit
http://localhost:8080/
All tools are available ONLY for active development profile.
A list of all endpoints is available in the Spring documentation.
e.g.
http://localhost:8080/info
URL:
http://localhost:8080/swagger-ui.html
Password and login user are available in application.properties
file.
URL:
http://localhost:8080/h2-console/
Endpoints | Usage | Params |
---|---|---|
GET /api/countries |
Get all of the countries available for the app. | |
POST /api/countries |
Add a new countryModel. | countryCode - [String] tax - [BigDecimal] fixedCosts - [BigDecimal] currencyCode - [String] |
GET /api/salaries/pln?countryCode={countryCode}&salary={salaryFromClient} |
Calculate salary. | {countryCode} - Country code {salaryFromClient} - Salary |
An example of an HTTP request is available in the http/question.http
file.
The application uses the NBP Web API.