Code Monkey home page Code Monkey logo

bank-rest-api's Introduction

Bank-REST-API

INSTRUCTIONS:

To build, test and generate the jar with Maven, run from the root directory of the project:

mvn package

To test, run from the root directory of the project:

mvn test

To start the server, run the jar with this command from the root directory of the project:

java -jar target/Bank-REST-API-1.0-SNAPSHOT.jar server configuration.yml

The jar will be generated at the path target/Bank-REST-API-1.0-SNAPSHOT.jar.

Server

The Application starts a server on localhost port 8080.

Available Services

HTTP METHOD PATH USAGE
POST /api/accounts/create?id={id}&name={name}&balance={balance} create a new account
GET /api/accounts/{accountId} get account by accountId
POST /api/transactions/create?from={senderAccountId}&to={recipientAccountId}&amount={amount} perform transaction between 2 accounts
GET /api/transactions/{transactionId} get transaction by id
GET /api/transactions/account?id={accountId} get all the transactions of an account

Http Status

  • 200 OK
  • 400 Bad Request
  • 404 Not Found
Response: 200 Status.OK
Response:
{
    "id": 1,
    "name": "Hang",
    "balance": 50.0,
    "lock": {}
}
Response: (transactionId)
1
Response:
{
    "id": 1,
    "sourceAccountId": 2,
    "destinationAccountId": 1,
    "amount": 50.0
}
Response:
[
    {
        "id": 2,
        "sourceAccountId": 1,
        "destinationAccountId": 2,
        "amount": 100.0
    }
]

bank-rest-api's People

Contributors

hanglili avatar

Watchers

 avatar DEVANG SHARMA 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.