Merge pull request #15 from getAlby/balance-endpoint

Balance endpoint
This commit is contained in:
Michael Bumann
2022-01-14 03:16:33 +02:00
committed by GitHub
2 changed files with 19 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ func main() {
e.POST("/create", controllers.CreateUserController{}.CreateUser)
e.POST("/addinvoice", controllers.AddInvoiceController{}.AddInvoice, middleware.JWT([]byte("secret")))
e.POST("/payinvoice", controllers.PayInvoiceController{}.PayInvoice, middleware.JWT([]byte("secret")))
e.GET("/balance", controllers.BalanceController{}.Balance, middleware.JWT([]byte("secret")))
// Start server
go func() {

View File

@@ -0,0 +1,18 @@
package controllers
import (
"github.com/labstack/echo/v4"
"net/http"
)
// BalanceController : BalanceController struct
type BalanceController struct{}
// Balance : Balance Controller
func (BalanceController) Balance(c echo.Context) error {
return c.JSON(http.StatusOK, echo.Map{
"BTC": echo.Map{
"AvailableBalance": 1,
},
})
}