Documentation ¶
Index ¶
- type MySQLTransactionKey
- type MySQLUnitOfWork
- type OrderRepository
- func (repo OrderRepository) Create(ctx context.Context, param entity.CreateOrderParam) (*entity.Order, error)
- func (repo OrderRepository) CreateOrderItems(ctx context.Context, orderID int64, items []*entity.CreateOrderItemParam) error
- func (repo OrderRepository) GetAllOrders(ctx context.Context) ([]*entity.Order, error)
- func (repo OrderRepository) GetAnnualIncome(ctx context.Context) ([]*entity.AnnualIncome, error)
- func (repo OrderRepository) GetDailyOrderCount(ctx context.Context) (int, error)
- func (repo OrderRepository) GetLastDayIncome(ctx context.Context) (int, error)
- func (repo OrderRepository) GetLastMonthIncome(ctx context.Context) (int, error)
- func (repo OrderRepository) GetOrderItemsByID(ctx context.Context, ID int64) ([]*entity.OrderItem, error)
- func (repo OrderRepository) GetTotalOrderCount(ctx context.Context) (int, error)
- type ProductRepository
- func (repo ProductRepository) Create(ctx context.Context, param entity.CreateProductParam) (*entity.Product, error)
- func (repo ProductRepository) DecrementProductByIDs(ctx context.Context, IDDecrementMap map[int64]int) error
- func (repo ProductRepository) DeleteByID(ctx context.Context, ID int64) (bool, error)
- func (repo ProductRepository) GetAllProducts(ctx context.Context) ([]*entity.Product, error)
- func (repo ProductRepository) GetBestSellerProducts(ctx context.Context) ([]*entity.ProductSale, error)
- func (repo ProductRepository) GetProductByCode(ctx context.Context, code string) (*entity.Product, error)
- func (repo ProductRepository) GetProductByID(ctx context.Context, ID int64) (*entity.Product, error)
- func (repo ProductRepository) GetProductsByIDs(ctx context.Context, IDs ...int64) ([]*entity.Product, error)
- func (repo ProductRepository) UpdateByID(ctx context.Context, ID int64, param entity.UpdateProductParam) (bool, error)
- type UserRepository
- func (repo UserRepository) GetUserByEmail(ctx context.Context, email string) (*entity.User, error)
- func (repo UserRepository) GetUserByID(ctx context.Context, ID int64) (*entity.User, error)
- func (repo UserRepository) UpdateByID(ctx context.Context, ID int64, param entity.UpdateUserParam) (bool, error)
- func (repo UserRepository) UpdatePasswordByID(ctx context.Context, ID int64, password string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLTransactionKey ¶ added in v1.0.0
type MySQLTransactionKey string
type MySQLUnitOfWork ¶ added in v1.0.0
func NewMySQLUnitOfWork ¶ added in v1.0.0
func NewMySQLUnitOfWork(DB *sql.DB) *MySQLUnitOfWork
type OrderRepository ¶
func NewOrderRepository ¶
func NewOrderRepository(DB *sql.DB) *OrderRepository
func (OrderRepository) Create ¶
func (repo OrderRepository) Create(ctx context.Context, param entity.CreateOrderParam) (*entity.Order, error)
func (OrderRepository) CreateOrderItems ¶ added in v1.0.0
func (repo OrderRepository) CreateOrderItems(ctx context.Context, orderID int64, items []*entity.CreateOrderItemParam) error
func (OrderRepository) GetAllOrders ¶
func (OrderRepository) GetAnnualIncome ¶
func (repo OrderRepository) GetAnnualIncome(ctx context.Context) ([]*entity.AnnualIncome, error)
func (OrderRepository) GetDailyOrderCount ¶
func (repo OrderRepository) GetDailyOrderCount(ctx context.Context) (int, error)
func (OrderRepository) GetLastDayIncome ¶
func (repo OrderRepository) GetLastDayIncome(ctx context.Context) (int, error)
func (OrderRepository) GetLastMonthIncome ¶
func (repo OrderRepository) GetLastMonthIncome(ctx context.Context) (int, error)
func (OrderRepository) GetOrderItemsByID ¶
func (OrderRepository) GetTotalOrderCount ¶
func (repo OrderRepository) GetTotalOrderCount(ctx context.Context) (int, error)
type ProductRepository ¶
func NewProductRepository ¶
func NewProductRepository(DB *sql.DB) *ProductRepository
func (ProductRepository) Create ¶
func (repo ProductRepository) Create(ctx context.Context, param entity.CreateProductParam) (*entity.Product, error)
func (ProductRepository) DecrementProductByIDs ¶ added in v1.0.0
func (ProductRepository) DeleteByID ¶
func (ProductRepository) GetAllProducts ¶
func (ProductRepository) GetBestSellerProducts ¶
func (repo ProductRepository) GetBestSellerProducts(ctx context.Context) ([]*entity.ProductSale, error)
func (ProductRepository) GetProductByCode ¶
func (ProductRepository) GetProductByID ¶
func (ProductRepository) GetProductsByIDs ¶
func (ProductRepository) UpdateByID ¶
func (repo ProductRepository) UpdateByID(ctx context.Context, ID int64, param entity.UpdateProductParam) (bool, error)
type UserRepository ¶
func NewUserRepository ¶
func NewUserRepository(DB *sql.DB) *UserRepository
func (UserRepository) GetUserByEmail ¶
func (UserRepository) GetUserByID ¶
func (UserRepository) UpdateByID ¶
func (repo UserRepository) UpdateByID(ctx context.Context, ID int64, param entity.UpdateUserParam) (bool, error)
func (UserRepository) UpdatePasswordByID ¶
Click to show internal directories.
Click to hide internal directories.