Documentation ¶
Index ¶
- type CartDAO
- func (c *CartDAO) CreateCart(cart *models.Cart) (int64, error)
- func (c *CartDAO) DeleteCart(userId int64) error
- func (c *CartDAO) FindAll(UserId int64) ([]*models.Cart, error)
- func (c *CartDAO) FindAllByUserIdForCheckout(userid int64) ([]*models.Cart, error)
- func (c *CartDAO) FindCartByUserIDandSKUID(userid, skuid string) (*models.Cart, error)
- func (c *CartDAO) InitTable()
- func (c *CartDAO) UpdateCart(cart *models.Cart) (int64, error)
- type CartDAOInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartDAO ¶
type CartDAO struct {
// contains filtered or unexported fields
}
func (*CartDAO) DeleteCart ¶
DeleteCart 删除购物车根据用户id
func (*CartDAO) FindAllByUserIdForCheckout ¶
func (*CartDAO) FindCartByUserIDandSKUID ¶
type CartDAOInterface ¶
type CartDAOInterface interface { InitTable() CreateCart(*models.Cart) (int64, error) DeleteCart(int64) error UpdateCart(*models.Cart) (int64, error) FindCartByUserIDandSKUID(userid, skuid string) (*models.Cart, error) FindAll(int64) ([]*models.Cart, error) FindAllByUserIdForCheckout(int64) ([]*models.Cart, error) }
接口驱动设计(Interface-Driven Design)
func NewCartDAO ¶
func NewCartDAO(db *gorm.DB) CartDAOInterface
Click to show internal directories.
Click to hide internal directories.