repository

package
v0.0.0-...-6e5aec4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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) DecrNum

func (rep CartRepository) DecrNum(cartID int64, num 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) IncrNum

func (rep CartRepository) IncrNum(cartID int64, num int64) 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL