Documentation ¶
Index ¶
- type CartRepository
- type LomsService
- type ProductService
- type Service
- func (s *Service) AddItem(ctx context.Context, userID int64, skuID int64, count uint16) (err error)
- func (s *Service) Checkout(ctx context.Context, userID int64) (orderID int64, err error)
- func (s *Service) DeleteItem(ctx context.Context, userID int64, skuID int64) (err error)
- func (s *Service) DeleteItemsByUserID(ctx context.Context, userID int64) (err error)
- func (s *Service) GetCart(ctx context.Context, userID int64) (cart *models.Cart, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartRepository ¶
type CartRepository interface { Add(ctx context.Context, userID int64, skuID int64, count uint16) error DeleteItem(ctx context.Context, userID int64, skuID int64) error DeleteItemsByUserID(_ context.Context, userID int64) (int, error) GetCart(ctx context.Context, userID int64) ([]models.ItemCount, error) }
type LomsService ¶
type ProductService ¶
type ProductService interface { GetProduct(ctx context.Context, sku int64) (*productserviceModels.GetProductResponse, error) GetProducts(ctx context.Context, skus []int64) ([]productserviceModels.GetProductResponse, error) GetListSkus(ctx context.Context, startAfterSku, count int64) ( *productserviceModels.ListSkusResponse, error, ) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewCartService ¶
func NewCartService( productService ProductService, repo CartRepository, lomsService LomsService, ) *Service
func (*Service) DeleteItem ¶
func (*Service) DeleteItemsByUserID ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.