/SpringAccountProject

Spring AccountProject

Primary LanguageJava

SpringAccountProject

Spring AccountProject

계좌 API

  1. 유저 생성
{
    "name": "nyh",
    "privateNumber": "0001000100"
}
  • Response
{
    "id": 1,
    "name": "nyh",
    "privateNumber": "0001000100",
    "registeredAt": "2022-06-21T20:06:41.6626601"
}
  1. 계좌 생성
{
  "userId": 1,
  "initialBalance": 50000
}
  • Response
{
    "userId": 1,
    "accountNumber": "1000000000",
    "registeredAt": "2022-06-21T20:07:16.1417518"
}
  1. 계좌 해지
{
  "userId": 1,
  "accountNumber": 1000000001
}
  • Response
{
    "userId": 1,
    "accountNumber": "1000000000",
    "registeredAt": "2022-06-21T20:07:16.1417518"
}
  1. 계좌 확인
{
    "accountList": [
        {
            "accountNumber": "1000000000",
            "balance": 50000
        }
    ]
}

트랜잭션 API

  1. 잔액 사용
{
    "userId":1,
    "accountNumber":"1000000000",
    "amount": 1000
}
  • Response
{
    "userId": null,
    "accountNumber": null,
    "transactionResult": "S",
    "transactionId": "8e6d10ed52fd438d81672b546802584e",
    "amount": 1000,
    "transactedAt": "2022-06-21T20:12:04.1727453"
}
  1. 잔액 사용 취소
{
   "transactionId":"8e6d10ed52fd438d81672b546802584e",
   "accountNumber":"1000000000",
   "amount":1000
}
  • Response
{
    "accountNumber": null,
    "transactionResult": "S",
    "transactionId": "3a7745b24edf41eab96824e4f901164c",
    "amount": 1000,
    "transactedAt": "2022-06-21T20:12:56.7205807"
}
  1. 잔액 사용 확인
{
    "accountNumber": null,
    "transactionType": "CANCEL",
    "transactionResult": "S",
    "transactionId": "3a7745b24edf41eab96824e4f901164c",
    "amount": 1000,
    "transactedAt": "2022-06-21T20:14:56.7860617"
}
  • Response (use)
{
    "accountNumber": null,
    "transactionType": "USE",
    "transactionResult": "S",
    "transactionId": "a2964337eff34c15b22b57931809b74d",
    "amount": 1000,
    "transactedAt": "2022-06-21T20:15:36.8282946"
}