repository

package
v0.0.0-...-2486f02 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 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 Product2CRepository

type Product2CRepository interface {
	MGetProducts2C(ctx context.Context, productIds []int64) ([]*entity.ProductEntity, error)
	SearchProducts(ctx context.Context, name, description, spuName *string) ([]*entity.ProductEntity, error)
}

type ProductRepository

type ProductRepository interface {
	AddProduct(ctx context.Context, product *entity.ProductEntity) error

	UpdateProduct(ctx context.Context, origin, target *entity.ProductEntity) error

	GetProductById(ctx context.Context, productId int64) (*entity.ProductEntity, error)

	ListProducts(ctx context.Context, filterParam map[string]interface{}) ([]*entity.ProductEntity, error)
}

type RepositoryRegistry

type RepositoryRegistry struct {
	// contains filtered or unexported fields
}

func GetRegistry

func GetRegistry() *RepositoryRegistry

func (*RepositoryRegistry) GetProduct2CRepository

func (r *RepositoryRegistry) GetProduct2CRepository() Product2CRepository

func (*RepositoryRegistry) GetProductRepository

func (r *RepositoryRegistry) GetProductRepository() ProductRepository

func (*RepositoryRegistry) GetStockRepository

func (r *RepositoryRegistry) GetStockRepository() StockRepository

func (*RepositoryRegistry) SetProduct2CRepository

func (r *RepositoryRegistry) SetProduct2CRepository(product2CRepositoryIns Product2CRepository)

func (*RepositoryRegistry) SetProductRepository

func (r *RepositoryRegistry) SetProductRepository(productRepositoryIns ProductRepository)

func (*RepositoryRegistry) SetStockRepository

func (r *RepositoryRegistry) SetStockRepository(stockRepositoryIns StockRepository)

type StockRepository

type StockRepository interface {
	IncrStock(ctx context.Context, productId, stockNum int64) error // 增加库存
	DecrStock(ctx context.Context, productId, stockNum int64) error // 减少库存
}

Jump to

Keyboard shortcuts

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