product

package
v0.0.0-...-2cd4ea5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const NEW_PRODUCT_DISPLAY_INDEX = 9999999

Variables

This section is empty.

Functions

This section is empty.

Types

type EncodePoolProductService

type EncodePoolProductService struct {
	eel.ServiceBase
}

func NewEncodePoolProductService

func NewEncodePoolProductService(ctx context.Context) *EncodePoolProductService

func (*EncodePoolProductService) Encode

func (this *EncodePoolProductService) Encode(poolProduct *PoolProduct) *RPoolProduct

Encode 对单个实体对象进行编码

func (*EncodePoolProductService) EncodeMany

func (this *EncodePoolProductService) EncodeMany(poolProducts []*PoolProduct) []*RPoolProduct

EncodeMany 对实体对象进行批量编码

type EncodeProductCategoryService

type EncodeProductCategoryService struct {
	eel.ServiceBase
}

func NewEncodeProductCategoryService

func NewEncodeProductCategoryService(ctx context.Context) *EncodeProductCategoryService

func (*EncodeProductCategoryService) Encode

func (this *EncodeProductCategoryService) Encode(productCategory *ProductCategory) *RProductCategory

Encode 对单个实体对象进行编码

func (*EncodeProductCategoryService) EncodeMany

func (this *EncodeProductCategoryService) EncodeMany(product_categories []*ProductCategory) []*RProductCategory

EncodeMany 对实体对象进行批量编码

func (*EncodeProductCategoryService) EncodeTree

func (this *EncodeProductCategoryService) EncodeTree(product_categories []*ProductCategory) *RProductCategoryTreeNode

EncodeTree 编码为tree

type EncodeProductLabelService

type EncodeProductLabelService struct {
	eel.ServiceBase
}

func NewEncodeProductLabelService

func NewEncodeProductLabelService(ctx context.Context) *EncodeProductLabelService

func (*EncodeProductLabelService) Encode

func (this *EncodeProductLabelService) Encode(productLabel *ProductLabel) *RProductLabel

Encode 对单个实体对象进行编码

func (*EncodeProductLabelService) EncodeMany

func (this *EncodeProductLabelService) EncodeMany(productLabels []*ProductLabel) []*RProductLabel

EncodeMany 对实体对象进行批量编码

type EncodeProductPropertyService

type EncodeProductPropertyService struct {
	eel.ServiceBase
}

func NewEncodeProductPropertyService

func NewEncodeProductPropertyService(ctx context.Context) *EncodeProductPropertyService

func (*EncodeProductPropertyService) Encode

func (this *EncodeProductPropertyService) Encode(productProperty *ProductProperty) *RProductProperty

Encode 对单个实体对象进行编码

func (*EncodeProductPropertyService) EncodeMany

func (this *EncodeProductPropertyService) EncodeMany(product_properties []*ProductProperty) []*RProductProperty

EncodeMany 对实体对象进行批量编码

type EncodeProductPropertyValueService

type EncodeProductPropertyValueService struct {
	eel.ServiceBase
}

func NewEncodeProductPropertyValueService

func NewEncodeProductPropertyValueService(ctx context.Context) *EncodeProductPropertyValueService

func (*EncodeProductPropertyValueService) Encode

Encode 对单个实体对象进行编码

func (*EncodeProductPropertyValueService) EncodeMany

func (this *EncodeProductPropertyValueService) EncodeMany(product_property_values []*ProductPropertyValue) []*RProductPropertyValue

EncodeMany 对实体对象进行批量编码

type FillPoolProductService

type FillPoolProductService struct {
	eel.ServiceBase
	Corp business.ICorp
}

func NewFillPoolProductService

func NewFillPoolProductService(ctx context.Context) *FillPoolProductService

func NewFillPoolProductServiceForCorp

func NewFillPoolProductServiceForCorp(ctx context.Context, corp business.ICorp) *FillPoolProductService

func (*FillPoolProductService) Fill

func (this *FillPoolProductService) Fill(poolProducts []*PoolProduct, option eel.FillOption)

func (*FillPoolProductService) FillOne

func (this *FillPoolProductService) FillOne(poolProduct *PoolProduct, option eel.FillOption)

type FillProductCategoryService

type FillProductCategoryService struct {
	eel.ServiceBase
}

func NewFillProductCategoryService

func NewFillProductCategoryService(ctx context.Context) *FillProductCategoryService

func (*FillProductCategoryService) Fill

func (this *FillProductCategoryService) Fill(productCategories []*ProductCategory, option eel.FillOption)

type FillProductLabelService

type FillProductLabelService struct {
	eel.ServiceBase
}

func NewFillProductLabelService

func NewFillProductLabelService(ctx context.Context) *FillProductLabelService

func (*FillProductLabelService) Fill

func (this *FillProductLabelService) Fill(productLabels []*ProductLabel, option eel.FillOption)

func (*FillProductLabelService) FillOne

func (this *FillProductLabelService) FillOne(productLabel *ProductLabel, option eel.FillOption)

type FillProductPropertyService

type FillProductPropertyService struct {
	eel.ServiceBase
}

func NewFillProductPropertyService

func NewFillProductPropertyService(ctx context.Context) *FillProductPropertyService

func (*FillProductPropertyService) Fill

func (this *FillProductPropertyService) Fill(productProperties []*ProductProperty, option eel.FillOption)

type FillProductService

type FillProductService struct {
	eel.ServiceBase
	Corp business.ICorp
}

func NewFillProductService

func NewFillProductService(ctx context.Context) *FillProductService

func NewFillProductServiceForCorp

func NewFillProductServiceForCorp(ctx context.Context, corp business.ICorp) *FillProductService

func (*FillProductService) Fill

func (this *FillProductService) Fill(products []*Product, option eel.FillOption)

type PoolProduct

type PoolProduct struct {
	eel.EntityBase
	Id                  int
	CorpId              int
	ProductId           int
	ProductType         string
	SupplierId          int
	Status              string
	Type                string
	SourcePoolProductId int
	DisplayIndex        int
	SoldCount           int
	SyncAt              time.Time
	CreatedAt           time.Time

	//foreign key
	Product *Product
}

func NewPoolProductFromModel

func NewPoolProductFromModel(ctx context.Context, model *m_product.PoolProduct) *PoolProduct

工厂方法 根据model构建对象

func (*PoolProduct) CanPurchase

func (this *PoolProduct) CanPurchase() bool

func (*PoolProduct) Disable

func (this *PoolProduct) Disable()

func (*PoolProduct) Enable

func (this *PoolProduct) Enable()

func (*PoolProduct) GetSku

func (this *PoolProduct) GetSku(skuName string) *ProductSku

func (*PoolProduct) GetUnifiedPostageMoney

func (this *PoolProduct) GetUnifiedPostageMoney() int

func (*PoolProduct) IsSelfProduct

func (this *PoolProduct) IsSelfProduct() bool

func (*PoolProduct) RemoveLabel

func (this *PoolProduct) RemoveLabel(label *ProductLabel)

func (*PoolProduct) SetLabels

func (this *PoolProduct) SetLabels(labels []*ProductLabel)

func (*PoolProduct) Update

func (this *PoolProduct) Update(
	userId int,
	productId int,
	name string,
	supplierId int,
	status int,
	productType int,
	displayIndex int,
	syncAt string,
) error

Update 更新对象

func (*PoolProduct) UseUnifiedPostage

func (this *PoolProduct) UseUnifiedPostage() bool

type PoolProductRepository

type PoolProductRepository struct {
	eel.RepositoryBase
}

func NewPoolProductRepository

func NewPoolProductRepository(ctx context.Context) *PoolProductRepository

func (*PoolProductRepository) GetAllPoolProductsForCorp

func (this *PoolProductRepository) GetAllPoolProductsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*PoolProduct, eel.INextPageInfo)

GetAllPoolProductsForCorp 获得所有PoolProduct对象集合

func (*PoolProductRepository) GetEnabledPoolProductsForCorp

func (this *PoolProductRepository) GetEnabledPoolProductsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*PoolProduct, eel.INextPageInfo)

GetEnabledPoolProductsForCorp 获得启用的PoolProduct对象集合

func (*PoolProductRepository) GetPagedPoolProducts

func (this *PoolProductRepository) GetPagedPoolProducts(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PoolProduct, eel.INextPageInfo)

func (*PoolProductRepository) GetPoolProduct

func (this *PoolProductRepository) GetPoolProduct(id int) *PoolProduct

GetPoolProduct 根据id和corp获得PoolProduct对象

func (*PoolProductRepository) GetPoolProductInCorp

func (this *PoolProductRepository) GetPoolProductInCorp(corp business.ICorp, id int) *PoolProduct

GetPoolProductInCorp 根据id和corp获得PoolProduct对象

func (*PoolProductRepository) GetPoolProducts

func (this *PoolProductRepository) GetPoolProducts(filters eel.Map, orderExprs ...string) []*PoolProduct

func (*PoolProductRepository) GetPoolProductsByProductIdsForCorp

func (this *PoolProductRepository) GetPoolProductsByProductIdsForCorp(corp business.ICorp, productIds []int) []*PoolProduct

GetPoolProductsByProductIds 根据id和corp获得PoolProduct对象

func (*PoolProductRepository) GetSelectablePlatformPoolProductsForCorp

func (this *PoolProductRepository) GetSelectablePlatformPoolProductsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*PoolProduct, eel.INextPageInfo)

GetSelectablePlatformPoolProductsForCorp 获得可供corp选择的平台商品集合

type Product

type Product struct {
	eel.EntityBase
	Id     int
	CorpId int

	Type           string
	CreateType     string
	Name           string
	PromotionTitle string
	Code           string
	CategoryId     int
	DisplayIndex   int
	Thumbnail      string
	IsDeleted      bool
	IsEnabled      bool
	CreatedAt      time.Time

	//logistics info
	PostageType         string
	UnifiedPostageMoney int
	LimitZoneType       int
	LimitZoneId         int

	//foreign key
	Categories            []*ProductCategory
	Labels                []*ProductLabel
	Description           *ProductDescription
	Medias                []*ProductMedia
	ProductUsableImoneyId int //refer to product_usable_imoney
	ProductUsableImoney   *ProductUsableImoney
	Skus                  []*ProductSku
}

func NewProductFromModel

func NewProductFromModel(ctx context.Context, model *m_product.Product) *Product

根据model构建对象

func (*Product) Disable

func (this *Product) Disable()

func (*Product) Enable

func (this *Product) Enable()

func (*Product) GetLimitZoneAreas

func (this *Product) GetLimitZoneAreas() []*limit_zone.LimitProvince

func (*Product) GetLimitZontTypeText

func (this *Product) GetLimitZontTypeText() string

func (*Product) GetSku

func (this *Product) GetSku(skuName string) *ProductSku

func (*Product) HasStandardSku

func (this *Product) HasStandardSku() bool

func (*Product) RemoveLabel

func (this *Product) RemoveLabel(label *ProductLabel)

func (*Product) SetLabels

func (this *Product) SetLabels(labels []*ProductLabel)

func (*Product) UseUnifiedPostage

func (this *Product) UseUnifiedPostage() bool

type ProductCategory

type ProductCategory struct {
	eel.EntityBase
	Id           int
	CorpId       int
	Name         string
	NodeType     string
	ProductCount int
	DisplayIndex int
	IsEnabled    bool
	CreatedAt    time.Time

	//foreign key
	FatherId int
	Corp     business.ICorp
}

func NewProductCategory

func NewProductCategory(
	ctx context.Context,
	corp business.ICorp,
	name string,
	fatherId int,
) *ProductCategory

工厂方法

func NewProductCategoryFromModel

func NewProductCategoryFromModel(ctx context.Context, model *m_product.ProductCategory) *ProductCategory

根据model构建对象

func NewRootProductCategory

func NewRootProductCategory(ctx context.Context, corp business.ICorp) *ProductCategory

根据model构建对象

func (*ProductCategory) Disable

func (this *ProductCategory) Disable()

func (*ProductCategory) Enable

func (this *ProductCategory) Enable()

func (*ProductCategory) GetPagedProducts

func (this *ProductCategory) GetPagedProducts(filters eel.Map, page *eel.PageInfo, orderExprs string) ([]*PoolProduct, eel.INextPageInfo)

func (*ProductCategory) GetSubCategories

func (this *ProductCategory) GetSubCategories() []*ProductCategory

func (*ProductCategory) Update

func (this *ProductCategory) Update(
	name string,
) error

Update 更新对象

type ProductCategoryRepository

type ProductCategoryRepository struct {
	eel.RepositoryBase
}

func NewProductCategoryRepository

func NewProductCategoryRepository(ctx context.Context) *ProductCategoryRepository

func (*ProductCategoryRepository) GetAllProductCategories

func (this *ProductCategoryRepository) GetAllProductCategories() []*ProductCategory

GetAllProductCategoriesForCorp 获得corp的ProductCategory对象集合

func (*ProductCategoryRepository) GetCorpProductCategories

func (this *ProductCategoryRepository) GetCorpProductCategories(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*ProductCategory, eel.INextPageInfo)

GetCorpProductCategories 获得corp的ProductCategory对象集合

func (*ProductCategoryRepository) GetEnabledProductCategoriesForCorp

func (this *ProductCategoryRepository) GetEnabledProductCategoriesForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*ProductCategory, eel.INextPageInfo)

GetEnabledProductCategoriesForCorp 获得启用的ProductCategory对象集合

func (*ProductCategoryRepository) GetPagedProductCategories

func (this *ProductCategoryRepository) GetPagedProductCategories(filters eel.Map, page *eel.PageInfo, orderExprs string) ([]*ProductCategory, eel.INextPageInfo)

func (*ProductCategoryRepository) GetProductCategories

func (this *ProductCategoryRepository) GetProductCategories(filters eel.Map, orderExprs ...string) []*ProductCategory

func (*ProductCategoryRepository) GetProductCategory

func (this *ProductCategoryRepository) GetProductCategory(id int) *ProductCategory

GetProductCategory 根据id和corp获得ProductCategory对象

func (*ProductCategoryRepository) GetProductCategoryInCorp

func (this *ProductCategoryRepository) GetProductCategoryInCorp(corp business.ICorp, id int) *ProductCategory

GetProductCategoryInCorp 根据id和corp获得ProductCategory对象

func (*ProductCategoryRepository) GetProductCategoryPathEndWithId

func (this *ProductCategoryRepository) GetProductCategoryPathEndWithId(endId int) []*ProductCategory

GetProductCategoryPathEndWithId 获得以id结尾的category tree path

type ProductDescription

type ProductDescription struct {
	eel.EntityBase
	Id           int
	ProductId    int
	Introduction string
	Detail       string
	Remark       string
}

func NewProductDescriptionFromModel

func NewProductDescriptionFromModel(ctx context.Context, model *m_product.ProductDescription) *ProductDescription

根据model构建对象

type ProductFactory

type ProductFactory struct {
	eel.ServiceBase
}

func NewProductFactory

func NewProductFactory(ctx context.Context) *ProductFactory

func (*ProductFactory) CreateProduct

func (this *ProductFactory) CreateProduct(strBaseInfo string, strSkuInfos string, strMediaInfo string, strLogisticsInfo string) *PoolProduct

func (*ProductFactory) EnsureSkuPropertyExists

func (this *ProductFactory) EnsureSkuPropertyExists(corp business.ICorp, skuInfos []*productSkuInfo)

type ProductLabel

type ProductLabel struct {
	eel.EntityBase
	Id        int
	CorpId    int
	Name      string
	IsEnabled bool
	CreatedAt time.Time
}

func NewProductLabel

func NewProductLabel(
	ctx context.Context,
	corp business.ICorp,
	name string,
) *ProductLabel

工厂方法

func NewProductLabelFromModel

func NewProductLabelFromModel(ctx context.Context, model *m_product.ProductLabel) *ProductLabel

根据model构建对象

func (*ProductLabel) Disable

func (this *ProductLabel) Disable()

func (*ProductLabel) Enable

func (this *ProductLabel) Enable()

func (*ProductLabel) Update

func (this *ProductLabel) Update(
	name string,
) error

Update 更新对象

type ProductLabelRepository

type ProductLabelRepository struct {
	eel.RepositoryBase
}

func NewProductLabelRepository

func NewProductLabelRepository(ctx context.Context) *ProductLabelRepository

func (*ProductLabelRepository) GetAllProductLabelsForCorp

func (this *ProductLabelRepository) GetAllProductLabelsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*ProductLabel, eel.INextPageInfo)

GetAllProductLabelsForCorp 获得所有ProductLabel对象集合

func (*ProductLabelRepository) GetEnabledProductLabelsForCorp

func (this *ProductLabelRepository) GetEnabledProductLabelsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*ProductLabel, eel.INextPageInfo)

GetEnabledProductLabelsForCorp 获得启用的ProductLabel对象集合

func (*ProductLabelRepository) GetPagedProductLabels

func (this *ProductLabelRepository) GetPagedProductLabels(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*ProductLabel, eel.INextPageInfo)

func (*ProductLabelRepository) GetProductLabel

func (this *ProductLabelRepository) GetProductLabel(id int) *ProductLabel

GetProductLabel 根据id和corp获得ProductLabel对象

func (*ProductLabelRepository) GetProductLabelInCorp

func (this *ProductLabelRepository) GetProductLabelInCorp(corp business.ICorp, id int) *ProductLabel

GetProductLabelInCorp 根据id和corp获得ProductLabel对象

func (*ProductLabelRepository) GetProductLabels

func (this *ProductLabelRepository) GetProductLabels(filters eel.Map, orderExprs ...string) []*ProductLabel

func (*ProductLabelRepository) GetProductLabelsInCorp

func (this *ProductLabelRepository) GetProductLabelsInCorp(corp business.ICorp, ids []int) []*ProductLabel

type ProductMedia

type ProductMedia struct {
	eel.EntityBase
	Id        int
	ProductId int
	Type      string
	Url       string
}

func NewProductMediaFromModel

func NewProductMediaFromModel(ctx context.Context, model *m_product.ProductMedia) *ProductMedia

根据model构建对象

type ProductPool

type ProductPool struct {
	eel.RepositoryBase
	Corp business.ICorp
}

func GetGlobalProductPool

func GetGlobalProductPool(ctx context.Context) *ProductPool

func GetProductPoolForCorp

func GetProductPoolForCorp(ctx context.Context, corp business.ICorp) *ProductPool

func (*ProductPool) AddProduct

func (this *ProductPool) AddProduct(product *Product, supplierCorpId int) *PoolProduct

func (*ProductPool) AddProducts

func (this *ProductPool) AddProducts(products []*Product, supplierCorpId int) []*PoolProduct

func (*ProductPool) AddProductsByProducts

func (this *ProductPool) AddProductsByProducts(products []*Product)

func (*ProductPool) GetLowStockProductCount

func (this *ProductPool) GetLowStockProductCount() int

GetLowStockProductCount 获得库存不足的商品数量

func (*ProductPool) GetLowStockProducts

func (this *ProductPool) GetLowStockProducts() []*PoolProduct

func (*ProductPool) GetOnsaleCount

func (this *ProductPool) GetOnsaleCount() int

获得在售商品的数量

func (*ProductPool) GetPagedPoolProducts

func (this *ProductPool) GetPagedPoolProducts(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PoolProduct, eel.INextPageInfo)

func (*ProductPool) GetPagedPromotionPoolProducts

func (this *ProductPool) GetPagedPromotionPoolProducts(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PoolProduct, eel.INextPageInfo)

func (*ProductPool) GetPoolProduct

func (this *ProductPool) GetPoolProduct(id int) *PoolProduct

func (*ProductPool) GetPoolProductByProductId

func (this *ProductPool) GetPoolProductByProductId(productId int) *PoolProduct

func (*ProductPool) GetPoolProducts

func (this *ProductPool) GetPoolProducts(filters eel.Map, orderExprs ...string) []*PoolProduct

func (*ProductPool) GetPoolProductsByIds

func (this *ProductPool) GetPoolProductsByIds(ids []int) []*PoolProduct

func (*ProductPool) GetPoolProductsByProductIds

func (this *ProductPool) GetPoolProductsByProductIds(ids []int) []*PoolProduct

func (*ProductPool) SearchCategoryProducts

func (this *ProductPool) SearchCategoryProducts(productCategory *ProductCategory, filters eel.Map, page *eel.PageInfo) ([]*PoolProduct, eel.INextPageInfo)

SearchCategoryProducts 获得product pool中属于指定category的商品集合

func (*ProductPool) SearchProducts

func (this *ProductPool) SearchProducts(filters eel.Map, page *eel.PageInfo) ([]*PoolProduct, eel.INextPageInfo)

func (*ProductPool) SyncPoolProducts

func (this *ProductPool) SyncPoolProducts(poolProducts []*PoolProduct)

type ProductProperty

type ProductProperty struct {
	eel.EntityBase
	Id        int
	CorpId    int
	Name      string
	IsDeleted bool
	CreatedAt time.Time

	//foreign key
	Values []*ProductPropertyValue
}

func NewProductProperty

func NewProductProperty(
	ctx context.Context,
	corp business.ICorp,
	name string,
) *ProductProperty

工厂方法

func NewProductPropertyFromModel

func NewProductPropertyFromModel(ctx context.Context, model *m_product.ProductProperty) *ProductProperty

根据model构建对象

func (*ProductProperty) AddNewValue

func (this *ProductProperty) AddNewValue(text string, image string) *ProductPropertyValue

func (*ProductProperty) AppendValue

func (this *ProductProperty) AppendValue(value *ProductPropertyValue)

func (*ProductProperty) Delete

func (this *ProductProperty) Delete() error

func (*ProductProperty) DeleteValue

func (this *ProductProperty) DeleteValue(valueId int)

func (*ProductProperty) Disable

func (this *ProductProperty) Disable()

func (*ProductProperty) Enable

func (this *ProductProperty) Enable()

func (*ProductProperty) Update

func (this *ProductProperty) Update(
	name string,
) error

Update 更新对象

type ProductPropertyRepository

type ProductPropertyRepository struct {
	eel.RepositoryBase
}

func NewProductPropertyRepository

func NewProductPropertyRepository(ctx context.Context) *ProductPropertyRepository

func (*ProductPropertyRepository) GetAllProductPropertiesForCorp

func (this *ProductPropertyRepository) GetAllProductPropertiesForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*ProductProperty, eel.INextPageInfo)

GetAllProductPropertiesForCorp 获得所有ProductProperty对象集合

func (*ProductPropertyRepository) GetEnabledProductPropertiesForCorp

func (this *ProductPropertyRepository) GetEnabledProductPropertiesForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*ProductProperty, eel.INextPageInfo)

GetEnabledProductPropertiesForCorp 获得启用的ProductProperty对象集合

func (*ProductPropertyRepository) GetPagedProductProperties

func (this *ProductPropertyRepository) GetPagedProductProperties(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*ProductProperty, eel.INextPageInfo)

func (*ProductPropertyRepository) GetProductProperties

func (this *ProductPropertyRepository) GetProductProperties(filters eel.Map, orderExprs ...string) []*ProductProperty

func (*ProductPropertyRepository) GetProductPropertiesInCorps

func (this *ProductPropertyRepository) GetProductPropertiesInCorps(corpIds []int) []*ProductProperty

GetProductPropertiesInCorps 根据id和corp获得ProductProperty对象

func (*ProductPropertyRepository) GetProductProperty

func (this *ProductPropertyRepository) GetProductProperty(id int) *ProductProperty

GetProductProperty 根据id和corp获得ProductProperty对象

func (*ProductPropertyRepository) GetProductPropertyInCorp

func (this *ProductPropertyRepository) GetProductPropertyInCorp(corp business.ICorp, id int) *ProductProperty

GetProductPropertyInCorp 根据id和corp获得ProductProperty对象

func (*ProductPropertyRepository) GetProductPropertyValue

func (this *ProductPropertyRepository) GetProductPropertyValue(id int) *ProductPropertyValue

GetProductPropertyValue 根据id获得ProductPropertyValue对象

type ProductPropertyValue

type ProductPropertyValue struct {
	eel.EntityBase
	Id           int
	PropertyId   int
	PropertyName string
	Text         string
	Image        string
	IsDeleted    bool
	CreatedAt    time.Time
}

func NewProductPropertyValue

func NewProductPropertyValue(
	ctx context.Context,
	propertyId int,
	text string,
	image string,
) *ProductPropertyValue

工厂方法

func NewProductPropertyValueFromModel

func NewProductPropertyValueFromModel(ctx context.Context, model *m_product.ProductPropertyValue) *ProductPropertyValue

根据model构建对象

func (*ProductPropertyValue) Disable

func (this *ProductPropertyValue) Disable()

func (*ProductPropertyValue) Enable

func (this *ProductPropertyValue) Enable()

func (*ProductPropertyValue) GetFullId

func (this *ProductPropertyValue) GetFullId() string

func (*ProductPropertyValue) Update

func (this *ProductPropertyValue) Update(
	text string,
	picUrl string,
) error

Update 更新对象

type ProductRepository

type ProductRepository struct {
	eel.RepositoryBase
}

func NewProductRepository

func NewProductRepository(ctx context.Context) *ProductRepository

func (*ProductRepository) GetAllProductsForCorp

func (this *ProductRepository) GetAllProductsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*Product, eel.INextPageInfo)

GetAllProductsForCorp 获得所有Product对象集合

func (*ProductRepository) GetEnabledProductsForCorp

func (this *ProductRepository) GetEnabledProductsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*Product, eel.INextPageInfo)

GetEnabledProductsForCorp 获得启用的Product对象集合

func (*ProductRepository) GetPagedProducts

func (this *ProductRepository) GetPagedProducts(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*Product, eel.INextPageInfo)

func (*ProductRepository) GetProduct

func (this *ProductRepository) GetProduct(id int) *Product

GetProduct 根据id和corp获得Product对象

func (*ProductRepository) GetProductByName

func (this *ProductRepository) GetProductByName(name string) *Product

func (*ProductRepository) GetProductIdsWithLabelForCorp

func (this *ProductRepository) GetProductIdsWithLabelForCorp(corp business.ICorp, labelId int, page *eel.PageInfo, filters eel.Map) ([]int, eel.INextPageInfo)

GetProductsWithLabelForCorp 获得label对应的Product对象集合

func (*ProductRepository) GetProductInCorp

func (this *ProductRepository) GetProductInCorp(corp business.ICorp, id int) *Product

GetProductInCorp 根据id和corp获得Product对象

func (*ProductRepository) GetProducts

func (this *ProductRepository) GetProducts(filters eel.Map, orderExprs ...string) []*Product

func (*ProductRepository) GetProductsByIds

func (this *ProductRepository) GetProductsByIds(ids []int) []*Product

GetProduct 根据id和corp获得Product对象

func (*ProductRepository) GetProductsUseLimitZone

func (this *ProductRepository) GetProductsUseLimitZone(limitZoneId int) []*Product

GetProduct 根据id和corp获得Product对象

func (*ProductRepository) IsValidProductSku

func (this *ProductRepository) IsValidProductSku(productId int, skuName string) bool

IsValidProductSku 判断(productId, skuName)的组合是否是可用的商品sku

type ProductShelf

type ProductShelf struct {
	eel.RepositoryBase
	Type string
	Corp business.ICorp
}

func GetForSaleProductShelfForCorp

func GetForSaleProductShelfForCorp(ctx context.Context, corp business.ICorp) *ProductShelf

func GetInSaleProductShelfForCorp

func GetInSaleProductShelfForCorp(ctx context.Context, corp business.ICorp) *ProductShelf

func (*ProductShelf) AddProduct

func (this *ProductShelf) AddProduct(poolProduct *PoolProduct)

func (*ProductShelf) AddProducts

func (this *ProductShelf) AddProducts(poolProducts []*PoolProduct)

func (*ProductShelf) GetPagedProducts

func (this *ProductShelf) GetPagedProducts(filters eel.Map, page *eel.PageInfo) ([]*PoolProduct, eel.INextPageInfo)

func (*ProductShelf) MoveProducts

func (this *ProductShelf) MoveProducts(poolProducts []*PoolProduct)

type ProductSku

type ProductSku struct {
	eel.EntityBase
	Id         int
	CorpId     int
	ProductId  int
	Name       string
	Code       string
	IsStandard bool
	Price      int
	CostPrice  int
	Stocks     int
	IsDeleted  bool
	CreatedAt  time.Time

	//foreign key
	PropertyValues []*ProductPropertyValue
	Property2Value map[string]string
}

func NewProductSkuFromModel

func NewProductSkuFromModel(ctx context.Context, model *m_product.ProductSku) *ProductSku

根据model构建对象

func (*ProductSku) CanAffordStock

func (this *ProductSku) CanAffordStock(stock int) bool

CheckStock 检查库存是否满足 TODO 处理并发购买

func (*ProductSku) FillProperties

func (this *ProductSku) FillProperties(id2property map[int]*ProductProperty, id2value map[int]*ProductPropertyValue)

func (*ProductSku) GetDisplayName

func (this *ProductSku) GetDisplayName() string

GetDisplayName 获得sku name(3:1_5:8)对应的display name(黑色 M)

func (*ProductSku) HasStocks

func (this *ProductSku) HasStocks() bool

func (*ProductSku) IsStandardSku

func (this *ProductSku) IsStandardSku() bool

type ProductSkuGenerator

type ProductSkuGenerator struct {
	eel.ServiceBase
}

func NewProductSkuGenerator

func NewProductSkuGenerator(ctx context.Context) *ProductSkuGenerator

func (*ProductSkuGenerator) FillSkusForProducts

func (this *ProductSkuGenerator) FillSkusForProducts(products []*Product, isEnableSkuProperty bool)

type ProductUsableImoney

type ProductUsableImoney struct {
	eel.EntityBase
	Id         int
	ProductId  int
	ImoneyCode string
	IsEnabled  bool
}

func NewProductUsableImoney

func NewProductUsableImoney(
	ctx context.Context,
	productId int,
	imoneyCode string,
) *ProductUsableImoney

工厂方法

func NewProductUsableImoneyFromModel

func NewProductUsableImoneyFromModel(ctx context.Context, model *m_product.ProductUsableImoney) *ProductUsableImoney

根据model构建对象

func (*ProductUsableImoney) Disable

func (this *ProductUsableImoney) Disable()

func (*ProductUsableImoney) Enable

func (this *ProductUsableImoney) Enable()

func (*ProductUsableImoney) Update

func (this *ProductUsableImoney) Update(
	productId int,
	imoneyCode string,
) error

Update 更新对象

type RDistributionResult

type RDistributionResult struct {
	PlatformProfit float64       `json:"platform_profit"`
	ChannelProfit  float64       `json:"channel_profit"`
	SalesmanProfit float64       `json:"salesman_profit"`
	PoolProduct    *RPoolProduct `json:"pool_product"`
}

type RLintProductCategory

type RLintProductCategory struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type RPlatformProductApplication

type RPlatformProductApplication struct {
	Id            int                            `json:"id"`
	CorpId        int                            `json:"corp_id"`
	PoolProductId int                            `json:"pool_product_id"`
	Product       *RProductBaseInfo              `json:"product"`
	Status        string                         `json:"status"`
	AuditRecords  []*RPlatformProductAuditRecord `json:"audit_records"`
	CreatedAt     string                         `json:"created_at"`
}

type RPlatformProductAuditRecord

type RPlatformProductAuditRecord struct {
	Id        int    `json:"id"`
	Result    string `json:"result"`
	Reason    string `json:"reason"`
	CreatedAt string `json:"created_at"`
}

type RPoolProduct

type RPoolProduct struct {
	Id                       int                    `json:"id"`
	CorpId                   int                    `json:"corp_id"`
	Type                     string                 `json:"type"`
	BaseInfo                 *RProductBaseInfo      `json:"base_info"`
	LogisticsInfo            *RProductLogisticsInfo `json:"logistics_info"`
	Medias                   []*RProductMedia       `json:"medias"`
	Skus                     []*RProductSku         `json:"skus"`
	Labels                   []*RProductLabel       `json:"labels"`
	Category                 *RLintProductCategory  `json:"category"`
	VisitInfo                *RVisitInfo            `json:"visit_info"`
	SoldCount                int                    `json:"sold_count"`
	IsDeleted                bool                   `json:"is_deleted"`
	Status                   string                 `json:"status"`
	PlatformProductStatus    string                 `json:"platform_product_status"`
	IsDistributionByPlatform bool                   `json:"is_distribution_by_platform"`
	IsDistributionByCorp     bool                   `json:"is_distribution_by_corp"`
	CreatedAt                string                 `json:"created_at"`
	OffshelfPlan             *RProductOffshelfPlan  `json:"offshelf_plan"`
}

type RProduct

type RProduct struct {
	Id        int               `json:"id"`
	BaseInfo  *RProductBaseInfo `json:"base_info"`
	IsDeleted bool              `json:"is_deleted"`
	CreatedAt string            `json:"created_at"`
}

type RProductApplication

type RProductApplication struct {
	Id            int                    `json:"id"`
	CorpId        int                    `json:"corp_id"`
	PoolProductId int                    `json:"pool_product_id"`
	Product       *RProductBaseInfo      `json:"product"`
	Status        string                 `json:"status"`
	AuditRecords  []*RProductAuditRecord `json:"audit_records"`
	CreatedAt     string                 `json:"created_at"`
}

type RProductAuditRecord

type RProductAuditRecord struct {
	Id        int    `json:"id"`
	Result    string `json:"result"`
	Reason    string `json:"reason"`
	CreatedAt string `json:"created_at"`
}

type RProductBaseInfo

type RProductBaseInfo struct {
	Id             int    `json:"id"`
	Name           string `json:"name"`
	Type           string `json:"type"`
	CreateType     string `json:"create_type"`
	PromotionTitle string `json:"promotion_title"`
	Code           string `json:"code"`
	Detail         string `json:"detail"`
	ShelveType     string `json:"shelve_type"`
	DisplayIndex   int    `json:"display_index"`
	Thumbnail      string `json:"thumbnail"`
}

type RProductCategory

type RProductCategory struct {
	Id           int    `json:"id"`
	Name         string `json:"name"`
	NodeType     string `json:"type"`
	ProductCount int    `json:"product_count"`
	DisplayIndex int    `json:"display_index"`
	IsEnabled    bool   `json:"is_enabled"`
	CreatedAt    string `json:"created_at"`
}

type RProductCategoryTreeNode

type RProductCategoryTreeNode struct {
	Id            int                         `json:"id"`
	Name          string                      `json:"name"`
	FatherId      int                         `json:"father_id"`
	Level         int                         `json:"level"`
	SubCategories []*RProductCategoryTreeNode `json:"sub_categories"`
}

type RProductCommission

type RProductCommission struct {
	Rate  float64 `json:"rate"`
	Level string  `json:"level"`
}

type RProductLabel

type RProductLabel struct {
	Id        int    `json:"id"`
	Name      string `json:"name"`
	IsEnabled bool   `json:"is_enabled"`
	CreatedAt string `json:"created_at"`
}

type RProductLogisticsInfo

type RProductLogisticsInfo struct {
	PostageType         string `json:"postage_type"`
	UnifiedPostageMoney int    `json:"unified_postage_money"`
	//PostageConfig *postage.RPostageConfig `json:"postage_config"`
	LimitZoneType     int         `json:"limit_zone_type"`
	LimitZoneTypeCode string      `json:"limit_zone_type_code"`
	LimitZoneId       int         `json:"limit_zone_id"`
	LimitZoneAreas    interface{} `json:"limit_zone_areas"`
}

type RProductMedia

type RProductMedia struct {
	Id   int    `json:"id"`
	Type string `json:"type"`
	Url  string `json:"url"`
}

type RProductOffshelfPlan

type RProductOffshelfPlan struct {
	OffshelfAt string `json:"offshelf_at"`
}

type RProductProperty

type RProductProperty struct {
	Id        int                      `json:"id"`
	CorpId    int                      `json:"corp_id"`
	Name      string                   `json:"name"`
	IsDeleted bool                     `json:"is_deleted"`
	Values    []*RProductPropertyValue `json:"values"`
	CreatedAt string                   `json:"created_at"`
}

type RProductPropertyValue

type RProductPropertyValue struct {
	Id           int    `json:"id"`
	PropertyId   int    `json:"property_id"`
	PropertyName string `json:"property_name"`
	Text         string `json:"text"`
	Image        string `json:"image"`
}

type RProductSku

type RProductSku struct {
	Id             int                      `json:"id"`
	Name           string                   `json:"name"`
	DisplayName    string                   `json:"display_name"`
	Code           string                   `json:"code"`
	Price          int                      `json:"price"`
	CostPrice      int                      `json:"cost_price"`
	Stocks         int                      `json:"stocks"`
	PropertyValues []*RProductPropertyValue `json:"property_values"`
}

type RProductUsableImoney

type RProductUsableImoney struct {
	Id         int    `json:"id"`
	UserId     int    `json:"user_id"`
	ProductId  int    `json:"product_id"`
	ImoneyCode string `json:"imoney_code"`
	IsEnabled  bool   `json:"is_enabled"`
	CreatedAt  string `json:"created_at"`
}

type RVisitInfo

type RVisitInfo struct {
	UserCount int `json:"user_count"`
	ViewCount int `json:"view_count"`
}

type UpdateProductService

type UpdateProductService struct {
	eel.ServiceBase
}

func NewUpdateProductService

func NewUpdateProductService(ctx context.Context) *UpdateProductService

func (*UpdateProductService) Update

func (this *UpdateProductService) Update(productId int, strBaseInfo string, strSkuInfos string, strMediaInfo string, strLogisticsInfo string)

Jump to

Keyboard shortcuts

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