service

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: 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