desafiogo

module
v0.0.0-...-20a34b2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: GPL-2.0

README

gopherbadger-tag-do-not-edit gopherbadger-tag-do-not-edit

Bank API

Instructions to Run

Prod
  • toDo
Local
  • Database: docker-compose up will start the PostgreSQL DB
  • make migrateup will migrate the database structure
  • go run main.go will start the api

Routes

Accounts
  • POST {{base_url}}/accounts/create - Create one account in the database
{
	Name       string    `json:"name"`
	Cpf        string    `json:"cpf"`
	Secret     string    `json:"secret"`
}
  • GET {{base_url}}/accounts/{accountID} - Get one account by ID
  • GET {{base_url}}/accounts/all - List all accounts
Transfer
  • GET {{base_url}}/transfers/{accountID} - List all transfer by account ID
  • POST {{base_url}}/transferTo - Perform a transfer between two accounts (Login Required) (QueryParams: accountID_destination, amount)
Auth
  • POST {{base_url}}/accounts/login - Authenticate the account and returns JWT token
{
	Cpf        string    `json:"cpf"`
	Secret     string    `json:"secret"`
}

Jump to

Keyboard shortcuts

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