Implement Rest API for ATM Backend service.
Clone this repository
Make sure you are using JDK 1.8 and Maven 3.x
to build--- mvn clean install
Unzip the zip file (if you downloaded one)
Open Command Prompt and Change directory (cd) to folder containing pom.xml
Open Eclipse
File -> Import -> Existing Maven Project -> Navigate to the folder where you unzipped the zip
Select the right project
Choose the Spring Boot Application file (search for @SpringBootApplication)
Right Click on the file and Run as Java Application
By default it will run in 8080 port
https://github.com/akshant31/ATM/blob/main/uml.JPG
You can use postman to hit the APIs ,sample curl request are provided below
// TO DEPOSIT MONEY
curl --location --request POST 'localhost:8080/deposit' <br />
--header 'Content-Type: application/json' <br />
--data-raw '{
"account_id":1000000,
"amount": 5000
}'
// TO WITHDRAW MONEY
curl --location --request POST 'localhost:8080/withdraw' <br />
--header 'Content-Type: application/json' <br />
--data-raw '{
"account_id":1000000,
"amount": 3000
}'
// TO CHECK BALANCE
curl --location --request GET 'localhost:8080/check-balance/1000000'
// TO ADD NEW USER
curl --location --request POST 'localhost:8080/newUser' <br />
--header 'Content-Type: application/json' <br />
--data-raw '{
"name":"test",
"city": "udaipur",
"phone":9078987689,
"account_type":"savings"
}'
- Name, City, Phone no required for opening account
- Only integer value can be debited or credited.
- As no UI , hardcoded the message string.