Documentation ¶
Index ¶
- type CartRepository
- type CategoryRepository
- type ItemRepository
- func (r *ItemRepository) Create(item *entity.Item) (*entity.Item, error)
- func (r *ItemRepository) Delete(itemID int) error
- func (r *ItemRepository) GetById(itemID int) (*entity.Item, error)
- func (r *ItemRepository) ListByCartId(cartId int) ([]*entity.Item, error)
- func (r *ItemRepository) Update(item *entity.Item) (*entity.Item, error)
- type PromotionRepository
- type Repositories
- type VasItemRepository
- func (r *VasItemRepository) Create(vasItem *entity.VasItem) (*entity.VasItem, error)
- func (r *VasItemRepository) DeleteById(vasItemId int) error
- func (r *VasItemRepository) GetById(vasItemId int) (*entity.VasItem, error)
- func (r *VasItemRepository) ListByItemId(itemId int) ([]*entity.VasItem, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartRepository ¶
type CartRepository struct {
// contains filtered or unexported fields
}
func NewCartRepository ¶
func NewCartRepository(d *database.Database, dbName string) *CartRepository
func (*CartRepository) Delete ¶
func (r *CartRepository) Delete(id int) error
type CategoryRepository ¶
type CategoryRepository struct {
// contains filtered or unexported fields
}
func NewCategoryRepository ¶
func NewCategoryRepository(d *database.Database, dbName string) *CategoryRepository
type ItemRepository ¶
type ItemRepository struct {
// contains filtered or unexported fields
}
func NewItemRepository ¶
func NewItemRepository(d *database.Database, dbName string) *ItemRepository
func (*ItemRepository) Delete ¶
func (r *ItemRepository) Delete(itemID int) error
func (*ItemRepository) ListByCartId ¶
func (r *ItemRepository) ListByCartId(cartId int) ([]*entity.Item, error)
type PromotionRepository ¶
type PromotionRepository struct {
// contains filtered or unexported fields
}
func NewPromotionRepository ¶
func NewPromotionRepository(d *database.Database, dbName string) *PromotionRepository
type Repositories ¶
type Repositories struct { Item repository.ItemRepositoryI Category repository.CategoryRepositoryI Promotion repository.PromotionRepositoryI VasItem repository.VasItemRepositoryI Cart repository.CartRepositoryI // contains filtered or unexported fields }
func NewRepositories ¶
func NewRepositories(cfg config.MongoDBConfig) (*Repositories, error)
func (*Repositories) Close ¶
func (r *Repositories) Close()
type VasItemRepository ¶
type VasItemRepository struct {
// contains filtered or unexported fields
}
func NewVasItemRepository ¶
func NewVasItemRepository(d *database.Database, dbName string) *VasItemRepository
func (*VasItemRepository) DeleteById ¶
func (r *VasItemRepository) DeleteById(vasItemId int) error
func (*VasItemRepository) GetById ¶
func (r *VasItemRepository) GetById(vasItemId int) (*entity.VasItem, error)
func (*VasItemRepository) ListByItemId ¶
func (r *VasItemRepository) ListByItemId(itemId int) ([]*entity.VasItem, error)
Click to show internal directories.
Click to hide internal directories.