2023-05-17 03:39:29 +00:00
|
|
|
package swagger
|
|
|
|
|
2023-05-17 20:27:09 +00:00
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/labstack/echo/v4"
|
|
|
|
)
|
|
|
|
|
2023-05-17 03:39:29 +00:00
|
|
|
//go:generate oapi-codegen --config api.yaml ../../openapi.yaml
|
|
|
|
//go:generate oapi-codegen --config models.yaml ../../openapi.yaml
|
2023-05-17 20:27:09 +00:00
|
|
|
|
|
|
|
type AccountController interface {
|
|
|
|
RemoveAccount(ctx echo.Context) error
|
|
|
|
GetAccount(ctx echo.Context) error
|
|
|
|
CreateAccount(ctx echo.Context) error
|
|
|
|
RemoveDirectAccount(ctx echo.Context, userId string) error
|
|
|
|
GetDirectAccount(ctx echo.Context, userId string) error
|
|
|
|
GetAccounts(ctx echo.Context, params PaginationAccountsParams) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type Deps struct {
|
|
|
|
AccountController AccountController
|
|
|
|
}
|
|
|
|
|
|
|
|
type API struct {
|
|
|
|
accountController AccountController
|
|
|
|
}
|
|
|
|
|
|
|
|
func New(deps *Deps) *API {
|
|
|
|
return &API{
|
|
|
|
accountController: deps.AccountController,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) DeleteAccount(ctx echo.Context) error {
|
|
|
|
return receiver.accountController.RemoveAccount(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) GetAccount(ctx echo.Context) error {
|
|
|
|
return receiver.accountController.GetAccount(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) AddAccount(ctx echo.Context) error {
|
|
|
|
return receiver.accountController.CreateAccount(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) DeleteDirectAccount(ctx echo.Context, accountId string) error {
|
|
|
|
return receiver.accountController.RemoveDirectAccount(ctx, accountId)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) GetDirectAccount(ctx echo.Context, accountId string) error {
|
|
|
|
return receiver.accountController.GetDirectAccount(ctx, accountId)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) PaginationAccounts(ctx echo.Context, params PaginationAccountsParams) error {
|
|
|
|
return receiver.accountController.GetAccounts(ctx, params)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) RemoveFromCart(ctx echo.Context, params RemoveFromCartParams) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) Add2cart(ctx echo.Context) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) PayCart(ctx echo.Context) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) GetCurrencies(ctx echo.Context) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) UpdateCurrencies(ctx echo.Context) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) GetHistory(ctx echo.Context, params GetHistoryParams) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) Add2history(ctx echo.Context) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) RequestMoney(ctx echo.Context, params RequestMoneyParams) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) ChangeCurrency(ctx echo.Context) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (receiver *API) PutMoney(ctx echo.Context) error {
|
|
|
|
return ctx.String(http.StatusNotImplemented, "method not implemented")
|
|
|
|
}
|