mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-10 00:16:04 +01:00
Change controller types names
This commit is contained in:
@@ -46,8 +46,8 @@ func main() {
|
||||
e.Use(middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(20)))
|
||||
|
||||
e.POST("/auth", controllers.AuthController{}.Auth)
|
||||
e.POST("/create", controllers.CreateUserRouter{}.CreateUser)
|
||||
e.POST("/addinvoice", controllers.AddInvoiceRouter{}.AddInvoice, middleware.JWT([]byte("secret")))
|
||||
e.POST("/create", controllers.CreateUserController{}.CreateUser)
|
||||
e.POST("/addinvoice", controllers.AddInvoiceController{}.AddInvoice, middleware.JWT([]byte("secret")))
|
||||
|
||||
// Start server
|
||||
go func() {
|
||||
|
||||
@@ -12,11 +12,11 @@ import (
|
||||
"github.com/bumi/lndhub.go/pkg/database/models"
|
||||
)
|
||||
|
||||
// AddInvoiceRouter : Add invoice router struct
|
||||
type AddInvoiceRouter struct{}
|
||||
// AddInvoiceController : Add invoice controller struct
|
||||
type AddInvoiceController struct{}
|
||||
|
||||
// AddInvoice : Add invoice Router
|
||||
func (AddInvoiceRouter) AddInvoice(c echo.Context) error {
|
||||
// AddInvoice : Add invoice Controller
|
||||
func (AddInvoiceController) AddInvoice(c echo.Context) error {
|
||||
user := c.Get("user").(*jwt.Token)
|
||||
claims := user.Claims.(jwt.MapClaims)
|
||||
userID := claims["id"].(float64)
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
// AuthController : AuthController struct
|
||||
type AuthController struct{}
|
||||
|
||||
// Auth : Auth Router
|
||||
// Auth : Auth Controller
|
||||
func (AuthController) Auth(c echo.Context) error {
|
||||
type RequestBody struct {
|
||||
Login string `json:"login"`
|
||||
|
||||
@@ -13,11 +13,11 @@ import (
|
||||
|
||||
const alphaNumBytes = random.Alphanumeric
|
||||
|
||||
// CreateUserRouter : Create user router struct
|
||||
type CreateUserRouter struct{}
|
||||
// CreateUserController : Create user controller struct
|
||||
type CreateUserController struct{}
|
||||
|
||||
// CreateUser : Create user Router
|
||||
func (CreateUserRouter) CreateUser(c echo.Context) error {
|
||||
// CreateUser : Create user Controller
|
||||
func (CreateUserController) CreateUser(c echo.Context) error {
|
||||
type RequestBody struct {
|
||||
PartnerID string `json:"partnerid"`
|
||||
AccountType string `json:"accounttype"`
|
||||
|
||||
Reference in New Issue
Block a user