Ultra-simple bank account application. Supports create account, view account & transfer balance methods
To build & run the app use the following command:
git clone https://github.com/cikasfm/revolut-backend.git
cd revolut-backend
mvn clean compile exec:java
Open the address http://localhost:4567 in your browser to see the Swagger API definition test UI
One for the Bank
curl -X PUT "https://thin-bank.herokuapp.com/api/account?accountName=Bank" -H "accept: application/json"
Output:
{
"status": 200,
"message": "OK",
"data": {
"accountNumber": 1,
"accountName": "Bank",
"balance": 0
}
}
One for a user named John
curl -X PUT "https://thin-bank.herokuapp.com/api/account?accountName=John" -H "accept: application/json"
Output:
{
"status": 200,
"message": "OK",
"data": {
"accountNumber": 2,
"accountName": "John",
"balance": 0
}
}
curl -X POST "https://thin-bank.herokuapp.com/api/balance/deposit" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{ \"toAcct\": 1, \"amount\": 999999999}"
Output:
{
"status": 200,
"message": "OK",
"data": {
"accountNumber": 1,
"accountName": "Bank",
"balance": 999999999.00
}
}
curl -X POST "https://thin-bank.herokuapp.com/api/balance/transfer" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{ \"fromAcct\": 1, \"toAcct\": 2, \"amount\": 100}"
Output
{
"status": 200,
"message": "OK"
}
curl -X GET "https://thin-bank.herokuapp.com/api/account/all?pageNum=0&pageSize=20" -H "accept: application/json"
Output
{
"status": 200,
"message": "OK",
"data": [
{
"accountNumber": 1,
"accountName": "Bank",
"balance": 999999899
},
{
"accountNumber": 2,
"accountName": "John",
"balance": 100
}
]
}