Handlers, DB, Cache

This commit is contained in:
2026-03-10 19:17:43 +03:00
parent e56b1f1305
commit 968c030939
23 changed files with 566 additions and 34 deletions

View File

@@ -0,0 +1,17 @@
package payment
import (
"net/http"
"go.uber.org/fx"
)
var Module = fx.Options(
fx.Provide(NewPaymentHandler),
)
type Handler interface {
GetSbpBanks(http.ResponseWriter, *http.Request)
PaymentCreate(http.ResponseWriter, *http.Request)
PaymentCallback(http.ResponseWriter, *http.Request)
}

View File

@@ -0,0 +1,54 @@
package payment
import (
"net/http"
"go.uber.org/fx"
"payouts/internal/config"
"payouts/internal/service/cache"
"payouts/internal/service/database"
)
const (
BaseRoute = "/payment"
CreateRoute = "/create"
CallbackRoute = "/callback"
BanksRoute = "/sbp/banks"
)
type paymentHandler struct {
dbService database.Service
cacheService cache.Service
}
// Params represents the module input params
type Params struct {
fx.In
AppConfig *config.App
DbService database.Service
CacheService cache.Service
}
func NewPaymentHandler(p Params) (Handler, error) {
return &paymentHandler{
dbService: p.DbService,
cacheService: p.CacheService,
}, nil
}
// GetSbpBanks implements [Handler].
func (p *paymentHandler) GetSbpBanks(http.ResponseWriter, *http.Request) {
panic("unimplemented")
}
// PaymentCreate implements [Handler].
func (p *paymentHandler) PaymentCreate(http.ResponseWriter, *http.Request) {
panic("unimplemented")
}
// PaymentCallback implements [Handler].
func (p *paymentHandler) PaymentCallback(http.ResponseWriter, *http.Request) {
panic("unimplemented")
}