handlers

package
v0.0.0-...-91ee031 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomerHandler

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

func NewCustomerHandler

func NewCustomerHandler(db *gorm.DB) CustomerHandler

func (*CustomerHandler) Create

func (h *CustomerHandler) Create(echo echo.Context) error

Create godoc @Summary Insert Customer @Description Insert Customer @Tags Customers @Accept json @Produce json @Param CustomerToInsert body dto.CustomerDto true "teste" @Router /v1/customer [post] @success 200 {array} domain.Customer @Failure 500 {object} error

func (*CustomerHandler) Delete

func (h *CustomerHandler) Delete(echo echo.Context) error

func (*CustomerHandler) GetAll

func (h *CustomerHandler) GetAll(echo echo.Context) error

func (CustomerHandler) GetByCpf

func (h CustomerHandler) GetByCpf(echo echo.Context) error

GetByCpf godoc @Summary Get Customer by CPF @Description Retrieve a customer by their CPF @Tags Customers @Accept json @Produce json @Param cpf path string true "CPF of the customer" @Router /v1/customer/cpf/{cpf} [get] @Success 200 {object} domain.Customer @Failure 500 {object} error

func (*CustomerHandler) Update

func (h *CustomerHandler) Update(echo echo.Context) error

type ItemHandler

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

func NewItemHandler

func NewItemHandler(db *gorm.DB) ItemHandler

func (*ItemHandler) Create

func (h *ItemHandler) Create(echo echo.Context) error

Create godoc @Summary Insert Item @Description Insert Item @Tags Items @Accept json @Produce json @Param ItemToInsert body dto.ItemDto true "teste" @Router /v1/item [post] @success 200 {array} domain.Item @Failure 500 {object} error

func (*ItemHandler) Delete

func (h *ItemHandler) Delete(echo echo.Context) error

Delete godoc @Summary Delete Item @Description Delete Item @Tags Items @Accept json @Produce json @Param id path int true "ID do item" @Router /v1/item/{id} [delete] @success 200 {string} string "item deleted successfully" @Failure 500 {object} error

func (*ItemHandler) GetAll

func (h *ItemHandler) GetAll(echo echo.Context) error

GetAll godoc @Summary List Items @Description List All Items @Tags Items @Accept json @Produce json @Router /v1/item [get] @success 200 {object} domain.Item @Failure 500 {object} error

func (*ItemHandler) Update

func (h *ItemHandler) Update(echo echo.Context) error

Update godoc @Summary Update Item @Description Update Item @Tags Items @Accept json @Produce json @Param id path int true "ID do item" @Param ItemToInsert body dto.ItemDto true "teste" @Router /v1/item/{id} [put] @success 200 {array} domain.Item @Failure 500 {object} error

type OrderHandler

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

func NewOrderHandler

func NewOrderHandler(db *gorm.DB) OrderHandler

func (*OrderHandler) Checkout

func (h *OrderHandler) Checkout(echo echo.Context) error

Create godoc @Summary Insert Order @Description Insert Order @Tags Orders @Accept json @Produce json @Param Order body dto.OrderDto true "Order to create" @Router /v1/orders/checkout [post] @success 200 {array} presenters.OrderPresenter @Failure 500 {object} error

func (*OrderHandler) GetAll

func (h *OrderHandler) GetAll(echo echo.Context) error

GetAll godoc @Summary List Orders @Description List All Orders @Tags Orders @Accept json @Produce json @Router /v1/orders [get] @Success 200 {object} domain.Order @Failure 500 {object} error

func (*OrderHandler) GetOrderPaymentStatus

func (h *OrderHandler) GetOrderPaymentStatus(echo echo.Context) error

GetOrderPaymentStatus godoc @Summary Get Order Payment Status @Description Get Order Payment Status @Tags Orders @Accept json @Produce json @Param orderID path int true "ID do pedido" @Router /v1/orders/{orderID}/payment/status [get] @success 200 {object} presenters.OrderPaymentStatusPresenter @Failure 500 {object} error

func (*OrderHandler) UpdateOrderPaymentStatus

func (h *OrderHandler) UpdateOrderPaymentStatus(echo echo.Context) error

UpdateOrderPaymentStatus godoc @Summary Update Order Payment Status @Description Update Order Payment Status @Tags Orders @Accept json @Produce json @Param orderID path int true "ID do pedido" @Param UpdateBody body dto.OrderPaymentStatusDto true "UpdateBody" @Router /v1/orders/{orderID}/payment/status [put] @success 200 {object} string @Failure 500 {object} error

func (*OrderHandler) UpdateStatus

func (h *OrderHandler) UpdateStatus(echo echo.Context) error

Create godoc @Summary Update Order Status @Description Update Order Status @Tags Orders @Accept json @Produce json @Param id path int true "ID do item" @Param Order body dto.OrderStatusDto true "Status to update Order" @Router /v1/orders/{id} [patch] @success 200 {object} domain.Order @Failure 500 {object} error

Jump to

Keyboard shortcuts

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