remove some interfaces

This commit is contained in:
Maxim Dolgushin 2023-11-05 14:09:50 +07:00 committed by skeris
parent 32eb736b14
commit 4f8963f8a3
6 changed files with 21 additions and 58 deletions

@ -9,20 +9,17 @@ import (
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/customer"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/history"
)
type historyService interface {
CreateHistory(ctx context.Context, history *models.History) (*models.History, errors.Error)
}
type Deps struct {
Logger *zap.Logger
HistoryService historyService
HistoryService *history.Service
}
type Controller struct {
logger *zap.Logger
historyService historyService
historyService *history.Service
}
func New(deps Deps) *Controller {

@ -9,21 +9,17 @@ import (
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/payment_callback"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/callback"
)
type paymentCallbackService interface {
SuccessEvent(context.Context, *models.PaymentEvent) errors.Error
FailureEvent(context.Context, *models.PaymentEvent) errors.Error
}
type Deps struct {
Logger *zap.Logger
PaymentCallbackService paymentCallbackService
PaymentCallbackService *callback.PaymentCallbackService
}
type Controller struct {
logger *zap.Logger
paymentCallbackService paymentCallbackService
paymentCallbackService *callback.PaymentCallbackService
}
func New(deps Deps) *Controller {

@ -1,7 +1,6 @@
package account
import (
"context"
"fmt"
"log"
"net/http"
@ -11,29 +10,19 @@ import (
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/swagger"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/account"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/echotools"
)
type accountService interface {
GetAccountByUserID(ctx context.Context, userID string) (*models.Account, errors.Error)
GetAccountsList(ctx context.Context, pagination *models.Pagination) (*models.PaginationResponse[models.Account], errors.Error)
CreateAccount(ctx context.Context, account *models.Account) (*models.Account, errors.Error)
CreateAccountByUserID(ctx context.Context, userID string) (*models.Account, errors.Error)
RemoveAccount(ctx context.Context, userID string) (*models.Account, errors.Error)
DeleteAccount(ctx context.Context, userID string) (*models.Account, errors.Error)
SetVerificationStatus(ctx context.Context, userID string, status models.AccountStatus) (*models.Account, errors.Error)
UpdateAccountName(ctx context.Context, userID string, name *models.Name) (*models.Account, errors.Error)
}
type Deps struct {
Logger *zap.Logger
Service accountService
Service *account.Service
}
type Controller struct {
logger *zap.Logger
service accountService
service *account.Service
}
func New(deps Deps) *Controller {

@ -1,7 +1,6 @@
package cart
import (
"context"
"fmt"
"log"
"net/http"
@ -11,23 +10,18 @@ import (
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/swagger"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/cart"
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/validate"
)
type cartService interface {
Remove(ctx context.Context, userID, itemID string) (*models.Account, errors.Error)
Add(context.Context, *models.AddItemToCart) (*models.Account, errors.Error)
Pay(ctx context.Context, token, userID string) (*models.Account, errors.Error)
}
type Deps struct {
Logger *zap.Logger
CartService cartService
CartService *cart.Service
}
type Controller struct {
logger *zap.Logger
cartService cartService
cartService *cart.Service
}
func New(deps Deps) *Controller {

@ -1,7 +1,6 @@
package currency
import (
"context"
"fmt"
"log"
"net/http"
@ -9,22 +8,18 @@ import (
"github.com/labstack/echo/v4"
"go.uber.org/zap"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/currency"
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/echotools"
)
type currencyService interface {
GetCurrencies(context.Context) ([]string, errors.Error)
PutCurrencies(context.Context, []string) ([]string, errors.Error)
}
type Deps struct {
Logger *zap.Logger
CurrencyService currencyService
CurrencyService *currency.Service
}
type Controller struct {
logger *zap.Logger
currencyService currencyService
currencyService *currency.Service
}
func New(deps Deps) *Controller {

@ -1,7 +1,6 @@
package wallet
import (
"context"
"fmt"
"log"
"net/http"
@ -10,30 +9,23 @@ import (
"go.uber.org/zap"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/payment"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/wallet"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/echotools"
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/validate"
)
type walletService interface {
ReplenishAccountWallet(context.Context, *models.ReplenishAccountWallet) (*models.Account, errors.Error)
ChangeCurrency(ctx context.Context, userID string, currency models.CurrencyKey) (*models.Account, errors.Error)
}
type paymentService interface {
GetPaymentLink(context.Context, *models.GetPaymentLinkRequest) (string, errors.Error)
}
type Deps struct {
Logger *zap.Logger
WalletService walletService
PaymentService paymentService
WalletService *wallet.Service
PaymentService *payment.Service
}
type Controller struct {
logger *zap.Logger
walletService walletService
paymentService paymentService
walletService *wallet.Service
paymentService *payment.Service
}
func New(deps Deps) *Controller {