Merge pull request #16 from getAlby/gettxs-endpoint

Get TXS endpoint
This commit is contained in:
Michael Bumann
2022-01-14 03:18:08 +02:00
committed by GitHub
3 changed files with 29 additions and 13 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("/gettxs", controllers.GetTXSController{}.GetTXS, middleware.JWT([]byte("secret")))
e.GET("/checkpayment/:payment_hash", controllers.CheckPaymentController{}.CheckPayment, middleware.JWT([]byte("secret")))
e.GET("/balance", controllers.BalanceController{}.Balance, middleware.JWT([]byte("secret")))

View File

@@ -0,0 +1,15 @@
package controllers
import (
"github.com/bumi/lndhub.go/pkg/database/models"
"github.com/labstack/echo/v4"
"net/http"
)
// GetTXSController : GetTXSController struct
type GetTXSController struct{}
// GetTXS : Get TXS Controller
func (GetTXSController) GetTXS(c echo.Context) error {
return c.JSON(http.StatusOK, &models.Invoice{})
}

View File

@@ -4,17 +4,17 @@ import "time"
// Invoice : Invoice Model
type Invoice struct {
ID uint `gorm:"primary_key"`
Type string
UserID uint
TransactionEntryID uint
Amount uint
Memo string
DescriptionHash string
PaymentRequest string
RHash string
State string
CreatedAt time.Time
UpdatedAt time.Time
SettledAt time.Time
ID uint `gorm:"primary_key" json:"id"`
Type string `json:"type"`
UserID uint `json:"user_id"`
TransactionEntryID uint `json:"transaction_entry_id"`
Amount uint `json:"amount"`
Memo string `json:"memo"`
DescriptionHash string `json:"description_hash"`
PaymentRequest string `json:"payment_request"`
RHash string `json:"r_hash"`
State string `json:"state"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
SettledAt time.Time `json:"settled_at"`
}