productshttphandler

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultResponse

type DefaultResponse struct {
	Message string `json:"message"`
}

type ProductRequest

type ProductRequest struct {
	Name     string `json:"name" binding:"required"`
	Price    uint64 `json:"price" binding:"required"`
	Quantity uint64 `json:"quantity" binding:"required"`
}

type ProductResponse

type ProductResponse struct {
	ID        uint64    `json:"id" binding:"required"`
	Name      string    `json:"name" binding:"required"`
	Price     uint64    `json:"price" binding:"required"`
	Quantity  uint64    `json:"quantity" binding:"required"`
	CreatedAt time.Time `json:"created_at"`
}

type ProductsHandler

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

func NewProductsHandler

func NewProductsHandler(log *slog.Logger, db *sqlx.DB, productsService *products.ProductsService) *ProductsHandler

func (*ProductsHandler) CreateProduct

func (h *ProductsHandler) CreateProduct(c *gin.Context)

func (*ProductsHandler) DeleteProduct

func (h *ProductsHandler) DeleteProduct(c *gin.Context)

func (*ProductsHandler) FindProduct

func (h *ProductsHandler) FindProduct(c *gin.Context)

func (*ProductsHandler) FindProductList

func (h *ProductsHandler) FindProductList(c *gin.Context)

func (*ProductsHandler) UpdateProduct

func (h *ProductsHandler) UpdateProduct(c *gin.Context)

Jump to

Keyboard shortcuts

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