Documentation ¶
Index ¶
- type CartRepository
- func (rep CartRepository) CleanCart(userID int64) error
- func (rep CartRepository) CreateCart(cart *model.Cart) (int64, error)
- func (rep CartRepository) DecrNum(cartID int64, num int64) error
- func (rep CartRepository) DeleteCartByID(cartID int64) error
- func (rep CartRepository) FindAll(userID int64) (cartAll []model.Cart, err error)
- func (rep CartRepository) FindCartByID(cartID int64) (cart *model.Cart, err error)
- func (rep CartRepository) IncrNum(cartID int64, num int64) error
- func (rep CartRepository) InitTable() error
- func (rep 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 (rep CartRepository) CleanCart(userID int64) error
func (CartRepository) CreateCart ¶
func (rep CartRepository) CreateCart(cart *model.Cart) (int64, error)
func (CartRepository) DeleteCartByID ¶
func (rep CartRepository) DeleteCartByID(cartID int64) error
func (CartRepository) FindAll ¶
func (rep CartRepository) FindAll(userID int64) (cartAll []model.Cart, err error)
func (CartRepository) FindCartByID ¶
func (rep CartRepository) FindCartByID(cartID int64) (cart *model.Cart, err error)
func (CartRepository) InitTable ¶
func (rep CartRepository) InitTable() error
func (CartRepository) UpdateCart ¶
func (rep CartRepository) UpdateCart(cart *model.Cart) error
type ICartRepository ¶
type ICartRepository interface { // InitTable 初始化数据表 InitTable() error // FindCartByID 根据CartID查找Cart信息 FindCartByID(int64) (*model.Cart, error) // CreateCart 创建Cart CreateCart(*model.Cart) (int64, error) // DeleteCartByID 根据CartID删除Cart DeleteCartByID(int64) error // UpdateCart 更新Cart信息 UpdateCart(*model.Cart) error // FindAll 查找所有Cart信息 FindAll(int64) ([]model.Cart, error) // CleanCart 情况购物车 CleanCart(int64) error // IncrNum 增加商品数量 IncrNum(int64, int64) error // DecrNum 减少商品数量 DecrNum(int64, int64) error }
func NewCartRepository ¶
func NewCartRepository(db *gorm.DB) ICartRepository
Click to show internal directories.
Click to hide internal directories.