handler

package
v0.0.0-...-be5a897 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WalletHandler

type WalletHandler struct {
	// contains filtered or unexported fields
}

func NewWalletHandler

func NewWalletHandler(services *service.Manager, logger logger.Logger) *WalletHandler

func (WalletHandler) CreateWallet

func (w WalletHandler) CreateWallet(c echo.Context) error

CreateWallet creates a new wallet for user.

@Tags Wallet @Summary Create a new wallet @Description Creates a new wallet with the provided information @ID create-wallet @Accept json @Produce json @Param userId path uint64 true "Authorized user ID" @Param wallet body model.WalletCreateDTO true "Wallet object to be created" @Success 201 {object} model.Response "Wallet created" @Failure 400 {object} model.Response "Bad request" @Failure 422 {object} model.Response "Unprocessable entity" @Router /users/{userId}/wallets [post]

func (WalletHandler) DeleteWallet

func (w WalletHandler) DeleteWallet(c echo.Context) error

DeleteWallet deletes the wallet by ID.

@Tags Wallet @Summary Delete wallet @Description Deletes wallet by the provided wallet ID @ID delete-wallet @Accept json @Produce json @Param userId path uint64 true "Authorized user ID" @Param wallet body model.WalletDeleteDTO true "Wallet delete request" @Success 204 {string} string "No content" @Failure 400 {object} model.Response "Bad request" @Failure 422 {object} model.Response "Unprocessable entity" @Router /users/{userId}/wallets/{walletId} [delete]

func (WalletHandler) GetWallets

func (w WalletHandler) GetWallets(c echo.Context) error

GetWallets retrieves user's wallets.

@Tags Wallet @Summary Get user's wallets @Description Gets user's wallets @ID get-wallets @Accept json @Produce json @Param userId path uint64 true "Authorized user ID" @Success 200 {object} model.Response "Wallets retrieved" @Failure 422 {object} model.Response "Unprocessable entity" @Router /users/{userId}/wallets [get]

func (WalletHandler) UpdateWallet

func (w WalletHandler) UpdateWallet(c echo.Context) error

UpdateWallet updates the wallet.

@Tags Wallet @Summary Update wallet @Description Updates wallet's properties @ID update-wallet @Accept json @Produce json @Param userId path uint64 true "Authorized user ID" @Param wallet body model.WalletUpdateDTO true "Wallet update attributes" @Success 200 {object} model.Response "Wallet updated" @Failure 400 {object} model.Response "Bad request" @Failure 422 {object} model.Response "Unprocessable entity" @Router /users/{userId}/wallets/{walletId} [patch]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL