Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeHttpHandler ¶
Types ¶
type ProductList ¶
type ProductTop ¶
type ProductTopResponse ¶
type ProductTopResponse struct { Data []*ProductTop `json:"data"` TotalVentas float64 `json:"totalVentas"` }
type Repository ¶
type Repository interface { GetProductById(productId int) (*Product, error) GetProducts(params *getProductsRequest) ([]*Product, error) GetTotalProducts() (int, error) InsertProduct(params *getAddProductRequest) (int64, error) UpdateProduct(params *updateProductRequest) (int64, error) DeleteProduct(params *deleteProductRequest) (int64, error) GetBestSellers() ([]*ProductTop, error) GetTotalVentas() (float64, error) }
func NewRepository ¶
func NewRepository(databaseConnection *sql.DB) Repository
type Service ¶
type Service interface { GetProductById(param *getProductByIDRequest) (*Product, error) GetProducts(params *getProductsRequest) (*ProductList, error) InsertProduct(params *getAddProductRequest) (int64, error) UpdateProduct(params *updateProductRequest) (int64, error) DeleteProduct(params *deleteProductRequest) (int64, error) GetBestSellers() (*ProductTopResponse, error) }
func NewService ¶
func NewService(repo Repository) Service
Click to show internal directories.
Click to hide internal directories.