- Inspired by Swagger API docs style & structure: http://localhost:8080/swagger-ui/index.html
- This application supports multi-language. Default is English (EN).
- If Accept-Language exists, while empty, it is default (English)
- If Accept-Language exists, while EN, it is English
- If Accept-Language exists, while TR, it is Turkish
- messages_x.properties can be created to multiply keys in messages.properties (where x is language code such as IT, ES, FR).
POST
/
To create user
curl --location 'localhost:8080/user/create' --header 'Content-Type: application/json' --header 'Accept-Language: tr' --data-raw '{"username": "user1_tc","password": "password","email": "user1@email.com"}'
POST
/
To authentication
curl --location 'localhost:8080/user/auth' --header 'Content-Type: application/json' --header 'Accept-Language;' --data '{ "username": "user1_tc", "password": "password" }' > ```
GET
/
To list users
curl --location 'localhost:8080/user/list' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg'
GET
/
To get specific user
curl --location --request GET 'localhost:8080/user/get' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"id": 1 }'
PUT
/
To set rule
curl --location --request PUT 'localhost:8080/user/set-role' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"id": "2"}'
PUT
/
To update specific user
curl --location --request PUT 'localhost:8080/user/update' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data-raw '{"id": "1","username": "user1_tc_update","email": "user1@email.com"}'
DELETE
/
To delete logically
curl --location --request DELETE 'localhost:8080/user/delete-logical' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMl90YyIsImlhdCI6MTczNzgyODg5MCwiZXhwIjoxNzY5MzY0ODkwfQ.jlM-9VaQZjTD9dSZA_aTS_REo4cXjKztkNfS0Y_mLaM' --data '{"id": "1"}'
DELETE
/
To delete hard
curl --location --request DELETE 'localhost:8080/user/delete-hard' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMl90YyIsImlhdCI6MTczNzgyODg5MCwiZXhwIjoxNzY5MzY0ODkwfQ.jlM-9VaQZjTD9dSZA_aTS_REo4cXjKztkNfS0Y_mLaM' --data '{"id": "2"}'
POST
/
To create customer
curl --location 'localhost:8080/customer/create' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"name": "customer1_name","surname": "customer1_surname","userId": "1","creditLimit": "10000","usedCreditLimit": "1500"}'
GET
/
To list customers
curl --location 'localhost:8080/customer/list' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg'
PUT
/
To update specific customer
curl --location --request PUT 'localhost:8080/customer/update' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"id": 1,"name": "customer1_name","surname": "customer1_surname","creditLimit": "20000","usedCreditLimit": "1500"}'
POST
/
To create loan - Create a new loan for a given customer, amount, interest rate and number of installments
curl --location 'localhost:8080/loan/create' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"customerId": 1,"amount": 1000,"interestRate": 0.2,"numberOfInstallment": 6 }'
GET
/
To list loan of specific customer
curl --location --request GET 'localhost:8080/loan/list' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90Y191cGRhdGUiLCJpYXQiOjE3Mzc4MzE0NzEsImV4cCI6MTc2OTM2NzQ3MX0.e3hgaKhN1JoveEUs-YE-RKtVx9XPUuMRJgCjyGtBZ38' --data '{"customerId": 1 }'
GET
/
To list loan installment of specific loan
curl --location --request GET 'localhost:8080/loan/list-installments' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90Y191cGRhdGUiLCJpYXQiOjE3Mzc4MzE0NzEsImV4cCI6MTc2OTM2NzQ3MX0.e3hgaKhN1JoveEUs-YE-RKtVx9XPUuMRJgCjyGtBZ38' --data '{"loanId": 1 }'