Documentation ¶
Index ¶
- type EncodeShoppingCartService
- type FillShoppingCartService
- type RShoppingCart
- type RShoppingCartProduct
- type RShoppingCartProductGroup
- type ShoppingCart
- func (this *ShoppingCart) AddProduct(poolProduct *product.PoolProduct, skuName string, count int) error
- func (this *ShoppingCart) DeleteItem(id int) error
- func (this *ShoppingCart) DeleteItems(ids []int) error
- func (this *ShoppingCart) GetInvalidProducts() []*ShoppingCartProduct
- func (this *ShoppingCart) GetProductCount() int
- func (this *ShoppingCart) GetValidProducts() []*ShoppingCartProduct
- type ShoppingCartProduct
- type ShoppingCartRepository
- type ShoppingCartService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncodeShoppingCartService ¶
type EncodeShoppingCartService struct {
eel.ServiceBase
}
func NewEncodeShoppingCartService ¶
func NewEncodeShoppingCartService(ctx context.Context) *EncodeShoppingCartService
func (*EncodeShoppingCartService) Encode ¶
func (this *EncodeShoppingCartService) Encode(shoppingCart *ShoppingCart) *RShoppingCart
Encode 对单个实体对象进行编码
type FillShoppingCartService ¶
type FillShoppingCartService struct {
eel.ServiceBase
}
func NewFillShoppingCartService ¶
func NewFillShoppingCartService(ctx context.Context) *FillShoppingCartService
type RShoppingCart ¶
type RShoppingCart struct { ProductGroups []*RShoppingCartProductGroup `json:"product_groups"` InvalidProducts []*RShoppingCartProduct `json:"invalid_products"` }
type RShoppingCartProduct ¶
type RShoppingCartProduct struct { Id int `json:"id"` ShoppingCartItemId int `json:"shopping_cart_item_id"` Name string `json:"name"` SkuName string `json:"sku_name"` SkuDisplayName string `json:"sku_display_name"` Thumbnail string `json:"thumbnail"` Price int `json:"price"` Stocks int `json:"stocks"` PurchaseCount int `json:"purchase_count"` }
type RShoppingCartProductGroup ¶
type RShoppingCartProductGroup struct {
Products []*RShoppingCartProduct `json:"products"`
}
type ShoppingCart ¶
type ShoppingCart struct { eel.EntityBase Id int UserId int CorpId int CreatedAt time.Time // contains filtered or unexported fields }
func (*ShoppingCart) AddProduct ¶
func (this *ShoppingCart) AddProduct(poolProduct *product.PoolProduct, skuName string, count int) error
AddProduct 向购物车中添加商品
func (*ShoppingCart) DeleteItem ¶
func (this *ShoppingCart) DeleteItem(id int) error
DeleteItem 从购物车中删除商品项
func (*ShoppingCart) DeleteItems ¶
func (this *ShoppingCart) DeleteItems(ids []int) error
DeleteItems 从购物车中删除商品项
func (*ShoppingCart) GetInvalidProducts ¶
func (this *ShoppingCart) GetInvalidProducts() []*ShoppingCartProduct
GetInvalidProducts 获得购物车中无效商品集合
func (*ShoppingCart) GetProductCount ¶
func (this *ShoppingCart) GetProductCount() int
GetProductCount 获得购物车中商品的数量
func (*ShoppingCart) GetValidProducts ¶
func (this *ShoppingCart) GetValidProducts() []*ShoppingCartProduct
GetValidProducts 获得购物车中有效商品集合
type ShoppingCartProduct ¶
type ShoppingCartProduct struct { eel.EntityBase Id int UserId int PoolProductId int ProductSkuName string ProductSkuDisplayName string Count int PoolProduct *product.PoolProduct // contains filtered or unexported fields }
func NewShoppingCartProductFromModel ¶
func NewShoppingCartProductFromModel(ctx context.Context, model *m_mall.ShoppingCartItem) *ShoppingCartProduct
根据model构建对象
func (*ShoppingCartProduct) IsValid ¶
func (this *ShoppingCartProduct) IsValid() bool
IsValid 判断购物车商品是否可以购买
type ShoppingCartRepository ¶
type ShoppingCartRepository struct {
eel.RepositoryBase
}
func NewShoppingCartRepository ¶
func NewShoppingCartRepository(ctx context.Context) *ShoppingCartRepository
func (*ShoppingCartRepository) GetShoppingCartForUserInCorp ¶
func (this *ShoppingCartRepository) GetShoppingCartForUserInCorp(user business.IUser, corp business.ICorp) *ShoppingCart
GetShipInfoInCorp 根据id和user获得ShipInfo对象
type ShoppingCartService ¶
type ShoppingCartService struct {
eel.ServiceBase
}
func NewShoppingCartService ¶
func NewShoppingCartService(ctx context.Context) *ShoppingCartService
func (*ShoppingCartService) DeleteShoppingCartItems ¶
func (this *ShoppingCartService) DeleteShoppingCartItems(ids []int)
Click to show internal directories.
Click to hide internal directories.