balance_test

command module
v0.0.0-...-8678cf8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2016 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

##TODO

    create database and edit config/app.yml

    cd $GOPATH
    
    mkdir -p src/app && cd src/app
    
    git clone REPOPATH  .
    
    glide install
    
    go test -v $(glide novendor)
        

###задание

Реализовать сервис по работе со счетами пользователей. В сервисе есть пользователи (id, name, balance). Можно:
Просмотреть баланс
Request:
GET /balance?user=101

Response:
200 OK
{“balance”: 1000}

зачислять деньги на счет пользователям (создать пользователя, если еще не существует) 
Request:
POST /deposit
{“user”: 101, “amount”: 100}

Response:
200 OK

снимать деньги со счетов
Request:
POST /withdraw
{“user”: 101, “amount”: 50}

Response:
200 OK

переводить деньги от одного пользователя другому.
Request:
POST /transfer
{“from”: 101, “to”: 205, amount: 25}

Response:
200 OK

Данные необходимо хранить в postgresql. Реализовать валидацию. В случае любой ошибки валидации отдавать 422 ошибку.
можно использовать любые framework’и

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址