Coder Social home page Coder Social logo

beecasestudy's Introduction

Technologies Used in the Application Spring Boot, Hibernate, MySql, Tomcat JDBC Connection pooling library to implement the connection pool.

Assumptions There are 10 users present in the Database with Username user1,user2,.........,user10 with password "passwd".

every user has an account with account number as BEECS01 for user1 and BEECS02 for user2 and so on. every account will have an initial Balance of 10000

A new payee can be added from the existing customers only.

Future balace is calculated using simple interest.

For connection pooling i have used tomcat-jdbc library it comes as default with the spring-boot-starter-data-jpa.

URLs I/P and O/p for each and every functionality.

  1. login and logout

http://localhost:8080/login [post request]

I/P { "username": "user1", "password": "passwd" }

O/p { "userId": 1, "username": "user1", "password": "passwd", "message": "User Logged In successfully", "status": true } Note: Incase some exception occurs or you enter the wrong credentials then in that case output will only show "message field as not null rest og the fields will be null"

http://localhost:8080/logout [Get request]

2)Get the balance info

You should be logged in otherwise you will get this output

{ "holderName": null, "balance": 0, "accountNumber": null, "message": "Session Expired please login" }

http://localhost:8080/getAccountDetails [Get] O/P { "holderName": "User1 Name", "balance": 5000, "accountNumber": "BEECS01", "message": null }

  1. Add and delete payee.

Payee can be only added from the existing list of users.

http://localhost:8080/getUsers [GET] gives you the existing users list

[ { "userId": 1, "username": "user1", "password": "passwd", "message": null, "status": true }, { "userId": 2, "username": "user2", "password": "passwd", "message": null, "status": true }, ... ]

http://localhost:8080/getPayees [GET] username of the benificiary will be displayed in the benificiary field.

[ { "payeeId": 1, "benificiary": "user2" }, { "payeeId": 2, "benificiary": "user3" } ]

http://localhost:8080/savePayee/ [GET] if you try to add the existing users it will not allow

http://localhost:8080/deletePayee/ [GET]

  1. Before transfering fund to a user he should be registered as payee

http://localhost:8080/transcat [POST]

I/P { "payeeName": "user2", "amount": "1000" }

here amount 5000 will be tranfered to user2

O/P { "holderName": "User1 Name", "balance": 9000, "accountNumber": "BEECS01", "message": "Transaction Completed!" } In Output message balance will be the updated one. In order to verify for user2 login as user2 and check

5)Calculate the future date

http://localhost:8080/calculateBalance/ [GET]

In order to avoid the DB connection leak i have written the shutdown hook in the Main Function please refer to comments in the file SpringBootApp.java.

Running the Application

Inorder to run the application make sure Java8 and Maven are installed. MySQL is running. create a db called bee. Import the database dump bee.sql file change the database password and username in application.properties Run the code as normal spring boot Application

beecasestudy's People

Contributors

parth2691 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.