git clone https://github.com/DimitarChikalanov/car-repository.git
cd /car-repository
./mvnw spring-boot:run
I use a postgres database. We use the following settings to sit in the application.properties.
spring.datasource.url=jdbc:postgresql://localhost:5432/travel
spring.datasource.username=
spring.datasource.password=
After starting the application, we run the following sql script.
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
insert into travel.public.users (id, first_name, last_name, username)
values (uuid_generate_v1(), 'Dimitar', 'Dimtrov', 'admin');
insert into travel.public.users (id, first_name, last_name, username)
values (uuid_generate_v1(), 'Dimitar', 'Dimtrov', 'dimitar55');
insert into travel.public.users (id, first_name, last_name, username)
values (uuid_generate_v1(), 'Pesho', 'Dimtrov', 'pesho33');
METHOD | PATH | DESCRIPTION |
---|---|---|
GET | https://api.currencyscoop.com/v1/latest?api_key= | Get currency and rate |
GET | https://api.geodatasource.com/neighbouring-countries?key= | Get neighboring countries |
GET | https://restcountries.eu/rest/v2/all | Get all coutries in world |
METHOD | PATH | DESCRIPTION |
---|---|---|
POST | /api/travel | Start new travel |
Curl for Travel
1.Start new travel
curl --location --request POST 'http://127.0.0.1:8089/api/travel' \
--header 'Content-Type: application/json' \
--data-raw '{
"username":"admin",
"startingCountry":"Azerbaijan",
"budget":4000,
"budgetPerCountry":500,
"currencyCode":"EUR"
}'