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
根据用户ID清空购物车
func (*CartRepository) CreateCart ¶
func (u *CartRepository) CreateCart(cart *model.Cart) (int64, error)
创建Cart信息
func (*CartRepository) DecrNum ¶
func (u *CartRepository) DecrNum(cartID int64, num int64) error
购物车减少商品
func (*CartRepository) DeleteCartByID ¶
func (u *CartRepository) DeleteCartByID(cartID int64) error
根据ID删除Cart信息
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)
根据ID查找Cart信息
func (*CartRepository) IncrNum ¶
func (u *CartRepository) IncrNum(cartID int64, num int64) error
添加商品数量
func (*CartRepository) UpdateCart ¶
func (u *CartRepository) UpdateCart(cart *model.Cart) error
更新Cart信息
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 }
Click to show internal directories.
Click to hide internal directories.