Documentation ¶
Index ¶
- type CartRepository
- func (u *CartRepository) CleanCart(userID int64) error
- func (u *CartRepository) CreateCart(cart *model.Cart) (int64, error)
- func (u *CartRepository) DecrNum(cartID int64, num int64) error
- func (u *CartRepository) DeleteCartByID(cartID int64) error
- func (u *CartRepository) FindAll(userID int64) (cartAll []model.Cart, err error)
- func (u *CartRepository) FindCartByID(cartID int64) (cart *model.Cart, err error)
- func (u *CartRepository) IncrNum(cartID int64, num int64) error
- func (u *CartRepository) InitTable() error
- func (u *CartRepository) UpdateCart(cart *model.Cart) error
- type ICartRepository
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 (*CartRepository) CleanCart ¶
func (u *CartRepository) CleanCart(userID int64) error
func (*CartRepository) CreateCart ¶
func (u *CartRepository) CreateCart(cart *model.Cart) (int64, error)
func (*CartRepository) DeleteCartByID ¶
func (u *CartRepository) DeleteCartByID(cartID int64) error
func (*CartRepository) FindAll ¶
func (u *CartRepository) FindAll(userID int64) (cartAll []model.Cart, err error)
func (*CartRepository) FindCartByID ¶
func (u *CartRepository) FindCartByID(cartID int64) (cart *model.Cart, err error)
func (*CartRepository) InitTable ¶
func (u *CartRepository) InitTable() error
func (*CartRepository) UpdateCart ¶
func (u *CartRepository) UpdateCart(cart *model.Cart) error
type ICartRepository ¶
type ICartRepository interface { InitTable() error FindCartByID(int64) (*model.Cart, error) CreateCart(*model.Cart) (int64, error) DeleteCartByID(int64) error UpdateCart(*model.Cart) error FindAll(int64) ([]model.Cart, error) CleanCart(int64) error IncrNum(int64, int64) error DecrNum(int64, int64) error }
func NewCartRepository ¶
func NewCartRepository(db *gorm.DB) ICartRepository
Click to show internal directories.
Click to hide internal directories.