service

package
v0.0.0-...-a16dd36 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartDataService

type CartDataService struct {
	CartRepository repository.ICartRepository
}

func (*CartDataService) AddCart

func (u *CartDataService) AddCart(cart *model.Cart) (int64, error)

插入

func (*CartDataService) CleanCart

func (u *CartDataService) CleanCart(userID int64) error

func (*CartDataService) DecrNum

func (u *CartDataService) DecrNum(cartID int64, num int64) error

func (*CartDataService) DeleteCart

func (u *CartDataService) DeleteCart(cartID int64) error

删除

func (*CartDataService) FindAllCart

func (u *CartDataService) FindAllCart(userID int64) ([]model.Cart, error)

查找

func (*CartDataService) FindCartByID

func (u *CartDataService) FindCartByID(cartID int64) (*model.Cart, error)

查找

func (*CartDataService) IncrNum

func (u *CartDataService) IncrNum(cartID int64, num int64) error

func (*CartDataService) UpdateCart

func (u *CartDataService) UpdateCart(cart *model.Cart) error

更新

type ICartDataService

type ICartDataService interface {
	AddCart(*model.Cart) (int64, error)
	DeleteCart(int64) error
	UpdateCart(*model.Cart) error
	FindCartByID(int64) (*model.Cart, error)
	FindAllCart(int64) ([]model.Cart, error)

	CleanCart(int64) error
	DecrNum(int64, int64) error
	IncrNum(int64, int64) error
}

func NewCartDataService

func NewCartDataService(cartRepository repository.ICartRepository) ICartDataService

创建

Jump to

Keyboard shortcuts

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