Versions in this module Expand all Collapse all v0 v0.7.0 Mar 26, 2023 v0.6.0 Jan 18, 2023 v0.5.0 Jan 5, 2023 v0.4.10 Jan 1, 2024 Changes in this version + var ErrBrandIsUsed = domain.NewError("err_product_brand_is_used", "品牌被模型\"%s\"使用,无法删除") + var ErrNoSuchBrand = domain.NewError("err_product_no_such_brand", "品牌不存在") type AttrValue + Id int64 type ICategory + GetModel func() promodel.IProductModel v0.4.9 Feb 10, 2022 v0.4.8 Jan 21, 2022 v0.4.4 Jan 20, 2022 v0.4.3 Dec 17, 2021 v0.4.2 Dec 16, 2021 v0.4.1 Dec 15, 2021 v0.4.0 Dec 15, 2021 Changes in this version + var C_OptionDescribe = "describe" + var C_OptionViewName = "viewName" + var ErrCategoryContainGoods = domain.NewError("err_category_contain_goods", "分类包含商品,无法删除") + var ErrCategoryCycleReference = domain.NewError("err_category_cycle_reference", "分类上级循环引用") + var ErrCategoryFloorShow = domain.NewError("err_category_floor_show", "非一级分类不能设置首页显示") + var ErrDescribeLength = domain.NewError("err_item_describe_length", "商品描述至少20个字符") + var ErrHasChildCategories = domain.NewError("err_has_child_categories", "分类包含子分类,无法删除") + var ErrIncorrectCategoryType = domain.NewError("err_category_incorrect_type", "分类类型不允许修改") + var ErrItemIncorrect = domain.NewError("err_item_incorrect", "商品已被违规下架") + var ErrItemNameLength = domain.NewError("err_item_name_length", "商品标题至少10个字") + var ErrNilRejectRemark = domain.NewError("err_item_nil_reject_remark", "原因不能为空") + var ErrNoBrand = domain.NewError("err_product_no_brand", "未设置商品品牌") + var ErrNoSuchAttr = domain.NewError("err_product_no_such_attr", "产品属性不存在") + var ErrNoSuchCategory = domain.NewError("err_category_not_exist", "分类不存在") + var ErrNoSuchProduct = domain.NewError("err_product_no_such_product", "产品不存在") + var ErrNotBeReview = domain.NewError("err_not_be_review", "商品还未通过审核") + var ErrNotUploadImage = domain.NewError("err_goods_not_upload_image", "请上传商品图片") + var ErrReadonlyCategory = domain.NewError("err_readonly_category", "无权修改系统分类") + var ErrVendor = domain.NewError("err_not_be_review", "商品供应商不正确") + var ErrVirtualCatNoUrl = domain.NewError("err_category_virtual_no_url", "虚拟分类必须设置跳转链接") + type AttrValue struct + AttrData string + AttrId int64 + AttrName string + AttrWord string + ID int64 + ProductId int64 + type Category struct + CatUrl string + Children []*Category + CreateTime int64 + Enabled int + FloorShow int + Icon string + IconPoint string + Id int + Level int + ModelId int + Name string + ParentId int + Priority int + RedirectUrl string + SortNum int + VirtualCat int + type CategoryList []*Category + func (c CategoryList) Len() int + func (c CategoryList) Less(i, j int) bool + func (c CategoryList) Swap(i, j int) + type ICategory interface + GetChildes func() []int + GetDomainId func() int + GetOption func() domain.IOptionStore + GetValue func() *Category + Save func() (int, error) + SetValue func(*Category) error + type ICategoryRepo interface + CheckContainGoods func(vendorId int64, catId int) bool + DeleteCategory func(vendorId int64, catId int) error + GetCategories func(mchId int) []*Category + GetCategory func(mchId, id int) *Category + GetRelationBrands func(idArr []int) []*promodel.ProductBrand + GlobCatService func() IGlobCatService + SaveCategory func(*Category) (int, error) + type IGlobCatService interface + CategoryTree func(parentId int) *Category + CreateCategory func(*Category) ICategory + DeleteCategory func(id int) error + GetCategories func() []ICategory + GetCategory func(id int) ICategory + ReadOnly func() bool + RelationBrands func(catId int) []*promodel.ProductBrand + type IProduct interface + Attr func() []*AttrValue + Destroy func() error + GetAggregateRootId func() int64 + GetValue func() Product + Save func() (int64, error) + SetAttr func(attr []*AttrValue) error + SetDescribe func(describe string) error + SetValue func(v *Product) error + type IProductRepo interface + BatchDeleteAttr func(where string, v ...interface{}) (int64, error) + CreateProduct func(*Product) IProduct + DeleteAttr func(primary interface{}) error + DeleteProduct func(productId int64) error + GetAttr func(primary interface{}) *AttrValue + GetPagedOnShelvesProduct func(supplierId int64, catIds []int, start, end int) (total int, goods []*Product) + GetProduct func(id int64) IProduct + GetProductSaleNum func(productId int64) int + GetProductValue func(itemId int64) *Product + GetProductsById func(ids ...int32) ([]*Product, error) + SaveAttr func(v *AttrValue) (int, error) + SaveProduct func(*Product) (int, error) + SelectAttr func(where string, v ...interface{}) []*AttrValue + type Product struct + Attrs []*AttrValue + BrandId int32 + CatId int32 + Code string + CreateTime int64 + Description string + Id int64 + Image string + Name string + Remark string + SortNum int32 + State int32 + UpdateTime int64 + VendorId int64