handler

package
v0.0.0-...-d2a67e6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 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 CategoryHandler

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

func (*CategoryHandler) Create

func (h *CategoryHandler) Create(w http.ResponseWriter, r *http.Request)

Create godoc @Summary Create a new category @Description Create a new category with the provided data @Tags categories @Accept json @Produce json @Param category body entity.Category true "Category data" @Success 201 {object} entity.Category "Category created successfully" @Router /api/categories [post]

func (*CategoryHandler) Delete

func (h *CategoryHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete godoc @Summary Delete a category by ID @Description Delete an existing category using its ID @Tags categories @Accept json @Produce json @Param id path int true "Category ID" @Success 200 "Category deleted successfully" @Router /api/categories/{id} [delete]

func (*CategoryHandler) GetByID

func (h *CategoryHandler) GetByID(w http.ResponseWriter, r *http.Request)

GetByID godoc @Summary Get a category by ID @Description Retrieve a category using its ID @Tags categories @Accept json @Produce json @Param id path int true "Category ID" @Success 200 {object} entity.Category "Category retrieved successfully" @Router /api/categories/{id} [get]

func (*CategoryHandler) ListAll

func (h *CategoryHandler) ListAll(w http.ResponseWriter, r *http.Request)

ListAll godoc @Summary List all categories with pagination @Description Get a list of all categories with pagination @Tags categories @Accept json @Produce json @Param offset query int true "Offset" @Param limit query int true "Limit" @Success 200 {array} entity.Category "Categories retrieved successfully" @Router /api/categories [get]

func (*CategoryHandler) Update

func (h *CategoryHandler) Update(w http.ResponseWriter, r *http.Request)

Update godoc @Summary Update a category by ID @Description Update an existing category by ID @Tags categories @Accept json @Produce json @Param id path int true "Category ID" @Param category body entity.Category true "Category data" @Success 200 {object} entity.Category "Category updated successfully" @Router /api/categories/{id} [put]

type ClientHandler

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

func (*ClientHandler) Create

func (h *ClientHandler) Create(w http.ResponseWriter, r *http.Request)

Create godoc @Summary Create a client @Description Create a new client with the provided data @Tags clients @Accept json @Produce json @Param client body entity.Client true "Client" @Success 201 {object} entity.Client "Client created successfully" @Router /api/clients [post]

func (*ClientHandler) Delete

func (h *ClientHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete godoc @Summary Delete a client by ID @Description Delete an existing client using its ID @Tags clients @Accept json @Produce json @Param id path int true "Client ID" @Success 200 "Client deleted successfully" @Router /api/clients/{id} [delete]

func (*ClientHandler) GetByID

func (h *ClientHandler) GetByID(w http.ResponseWriter, r *http.Request)

GetByID godoc @Summary Get a client by ID @Description Retrieve a client using its ID @Tags clients @Accept json @Produce json @Param id path int true "Client ID" @Success 200 {object} entity.Client "Client retrieved successfully" @Router /api/clients/{id} [get]

func (*ClientHandler) ListAll

func (h *ClientHandler) ListAll(w http.ResponseWriter, r *http.Request)

ListAll godoc @Summary List all clients with pagination @Description Get a list of all clients with pagination @Tags clients @Accept json @Produce json @Param offset query int true "Offset" @Param limit query int true "Limit" @Success 200 {array} entity.Client "Clients retrieved successfully" @Router /api/clients [get]

func (*ClientHandler) Update

func (h *ClientHandler) Update(w http.ResponseWriter, r *http.Request)

Update godoc @Summary Update a client @Description Update an existing client by ID @Tags clients @Accept json @Produce json @Param id path int true "Client ID" @Param client body entity.Client true "Client data" @Success 200 {object} entity.Client "Client updated successfully" @Router /api/clients/{id} [put]

type OrderHandler

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

func NewOrderHandler

func NewOrderHandler(r repository.OrderRepository) *OrderHandler

func (*OrderHandler) Create

func (h *OrderHandler) Create(w http.ResponseWriter, r *http.Request)

Create godoc @Summary Create a new order @Description Create a new order with the provided data @Tags orders @Accept json @Produce json @Param order body entity.Order true "Order data" @Success 201 {object} entity.Order "Order created successfully" @Router /api/orders [post]

func (*OrderHandler) Delete

func (h *OrderHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete godoc @Summary Delete a order @Description Delete an existing order using its ID @Tags orders @Accept json @Produce json @Param id path int true "order ID" @Success 200 "Order deleted successfully" @Router /api/orders/{id} [delete]

func (*OrderHandler) GetByClientID

func (h *OrderHandler) GetByClientID(w http.ResponseWriter, r *http.Request)

GetByClientID godoc @Summary Get orders by client ID @Description Retrieve orders using its client ID @Tags orders @Produce json @Accept json @Param id path uuid true "client ID" @Success 200 {array} entity.Order "Orders retrieved successfully" @Router /api/orders/client/{id} [get]

func (*OrderHandler) GetByID

func (h *OrderHandler) GetByID(w http.ResponseWriter, r *http.Request)

GetByID godoc @Summary Get a order by ID @Description Retrieve a order using its ID @Tags orders @Accept json @Produce json @Param id path int true "Order ID" @Success 200 {object} entity.Order "Order retrieved successfully" @Router /api/orders/{id} [get]

func (*OrderHandler) List

func (h *OrderHandler) List(w http.ResponseWriter, r *http.Request)

ListAll godoc @Summary List orders with pagination @Description Get a list of orders with pagination @Tags orders @Accept json @Produce json @Param offset query int true "Offset" @Param limit query int true "Limit" @Success 200 {array} entity.Order "Orders retrieved successfully" @Router /api/orders [get]

func (*OrderHandler) SetStatus

func (h *OrderHandler) SetStatus(w http.ResponseWriter, r *http.Request)

SetStatus godoc @Summary Set status @Description Set status of an order provided its ID @Tags orders @Accept json @Produce json @Param id path int true "order ID" @Param order body entity.Order true "Order data" @Success 200 {object} entity.Order "Order status updated successfully" @Router /api/orders/{id} [put]

type ProductHandler

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

func (*ProductHandler) Create

func (h *ProductHandler) Create(w http.ResponseWriter, r *http.Request)

Create godoc @Summary Create a new product @Description Create a new product with provided data @Tags products @Accept json @Produce json @Param product body entity.Product true "Product data" @Success 201 {object} entity.Product "Product created successfully" @Router /api/products [post]

func (*ProductHandler) Delete

func (h *ProductHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete godoc @Summary Delete a product by ID @Description Delete an existing product using its ID @Tags products @Accept json @Produce json @Param id path int true "Product ID" @Success 200 {object} entity.Product "Product deleted successfully" @Router /api/products/{id} [delete]

func (*ProductHandler) GetByID

func (h *ProductHandler) GetByID(w http.ResponseWriter, r *http.Request)

GetByID godoc @Summary Get a product by ID @Description Retrive a product using its ID @Tags products @Accept json @Produce json @Param id path int true "Product ID" @Success 200 {object} entity.Product "Product retrieved successfully" @Router /api/products/{id} [get]

func (*ProductHandler) ListAll

func (h *ProductHandler) ListAll(w http.ResponseWriter, r *http.Request)

ListAll godoc @Summary List all products with pagination @Description Get a list of all products with pagination @Tags products @Accept json @Produce json @Param offset query int true "Offset" @Param limit query int true "Limit" @Success 200 {array} entity.Product "Products retrieved successfully" @Router /api/products [get]

func (*ProductHandler) Update

func (h *ProductHandler) Update(w http.ResponseWriter, r *http.Request)

Update godoc @Summary Update a product by ID @Description Update an existing product by ID @Tags products @Accept json @Produce json @Param id path int true "Product ID" @Param product body entity.Product true "Product data" @Success 200 {object} entity.Product "Product updated successfully" @Router /api/products/{id} [put]

Jump to

Keyboard shortcuts

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