repository

package
v0.0.0-...-8f657ed Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: GPL-3.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 (u *CartRepository) CleanCart(userID int64) error

func (*CartRepository) CreateCart

func (u *CartRepository) CreateCart(cart *model.Cart) (int64, error)

func (*CartRepository) DecrNum

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

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

Jump to

Keyboard shortcuts

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