mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-16 11:26:00 +01:00
@@ -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")))
|
||||
|
||||
|
||||
15
pkg/controllers/gettxs.ctrl.go
Normal file
15
pkg/controllers/gettxs.ctrl.go
Normal 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{})
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user