repo

package
v0.0.0-...-fc93c80 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitField

func InitField(db *gorm.DB) error

InitField 全字段更新,初始化那些字段不更新,那些字段需要更新

Types

type BrandRepo

type BrandRepo struct {
	*db2.GenericDao[entity.Brand, uint64]
}

BrandRepo 商品品牌表

func NewBrandRepo

func NewBrandRepo(conn *gorm.DB) *BrandRepo

NewBrandRepo 创建

func (BrandRepo) Create

func (r BrandRepo) Create(ctx context.Context, brand *entity.Brand) error

Create 创建商品品牌表

func (BrandRepo) DeleteByID

func (r BrandRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除商品品牌表

func (BrandRepo) GetByDBOption

func (r BrandRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) (entity.Brands, uint32, error)

GetByDBOption 根据动态条件查询商品品牌表

func (BrandRepo) GetByID

func (r BrandRepo) GetByID(ctx context.Context, id uint64) (*entity.Brand, error)

GetByID 根据主键ID查询商品品牌表

func (BrandRepo) GetByIDs

func (r BrandRepo) GetByIDs(ctx context.Context, ids []uint64) (entity.Brands, error)

GetByIDs 根据主键ID批量查询商品品牌表

func (BrandRepo) Update

func (r BrandRepo) Update(ctx context.Context, brand *entity.Brand) error

Update 修改商品品牌表

func (BrandRepo) WithByName

func (r BrandRepo) WithByName(name string) db2.DBOption

func (BrandRepo) WithByShowStatus

func (r BrandRepo) WithByShowStatus(showStatus uint8) db2.DBOption

type CompanyAddressRepo

type CompanyAddressRepo struct {
	*db2.GenericDao[entity.CompanyAddress, uint64]
}

CompanyAddressRepo 公司收发货地址

func NewCompanyAddressRepo

func NewCompanyAddressRepo(conn *gorm.DB) *CompanyAddressRepo

NewCompanyAddressRepo 创建

func (CompanyAddressRepo) Create

func (r CompanyAddressRepo) Create(ctx context.Context, companyAddress *entity.CompanyAddress) error

Create 创建公司收发货地址

func (CompanyAddressRepo) DeleteByID

func (r CompanyAddressRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除公司收发货地址

func (CompanyAddressRepo) GetByDBOption

func (r CompanyAddressRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.CompanyAddress, uint32, error)

GetByDBOption 根据动态条件查询公司收发货地址

func (CompanyAddressRepo) GetByID

GetByID 根据主键ID查询公司收发货地址

func (CompanyAddressRepo) GetByIDs

GetByIDs 根据主键ID查询公司收发货地址

func (CompanyAddressRepo) Update

func (r CompanyAddressRepo) Update(ctx context.Context, companyAddress *entity.CompanyAddress) error

Update 修改公司收发货地址

type HomeAdvertiseRepo

type HomeAdvertiseRepo struct {
	*db.GenericDao[entity.HomeAdvertise, uint64]
}

HomeAdvertiseRepo 首页轮播广告表

func NewHomeAdvertiseRepo

func NewHomeAdvertiseRepo(conn *gorm.DB) *HomeAdvertiseRepo

NewHomeAdvertiseRepo 创建

func (HomeAdvertiseRepo) Create

func (r HomeAdvertiseRepo) Create(ctx context.Context, homeAdvertise *entity.HomeAdvertise) error

Create 创建首页轮播广告表

func (HomeAdvertiseRepo) DeleteByID

func (r HomeAdvertiseRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除首页轮播广告表

func (HomeAdvertiseRepo) GetByDBOption

func (r HomeAdvertiseRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db.DBOption) ([]*entity.HomeAdvertise, uint32, error)

GetByDBOption 根据动态条件查询首页轮播广告表

func (HomeAdvertiseRepo) GetByID

GetByID 根据主键ID查询首页轮播广告表

func (HomeAdvertiseRepo) Update

func (r HomeAdvertiseRepo) Update(ctx context.Context, homeAdvertise *entity.HomeAdvertise) error

Update 修改首页轮播广告表

type JsonDynamicConfigRepo

type JsonDynamicConfigRepo struct {
	*db.GenericDao[entity.JsonDynamicConfig, uint64]
}

JsonDynamicConfigRepo JSON动态配置

func NewJsonDynamicConfigRepo

func NewJsonDynamicConfigRepo(conn *gorm.DB) *JsonDynamicConfigRepo

NewJsonDynamicConfigRepo 创建

func (JsonDynamicConfigRepo) Create

func (r JsonDynamicConfigRepo) Create(ctx context.Context, jsonDynamicConfig *entity.JsonDynamicConfig) error

Create 创建JSON动态配置

func (JsonDynamicConfigRepo) DeleteByID

func (r JsonDynamicConfigRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除JSON动态配置

func (JsonDynamicConfigRepo) GetByDBOption

func (r JsonDynamicConfigRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db.DBOption) ([]*entity.JsonDynamicConfig, uint32, error)

GetByDBOption 根据动态条件查询JSON动态配置

func (JsonDynamicConfigRepo) GetByID

GetByID 根据主键ID查询JSON动态配置

func (JsonDynamicConfigRepo) Update

func (r JsonDynamicConfigRepo) Update(ctx context.Context, jsonDynamicConfig *entity.JsonDynamicConfig) error

Update 修改JSON动态配置

type MemberPriceRepo

type MemberPriceRepo struct {
	*db2.GenericDao[entity.MemberPrice, uint64]
}

MemberPriceRepo 商品会员价格

func NewMemberPriceRepo

func NewMemberPriceRepo(conn *gorm.DB) *MemberPriceRepo

NewMemberPriceRepo 创建

func (MemberPriceRepo) BatchCreateWithTX

func (r MemberPriceRepo) BatchCreateWithTX(ctx context.Context, productID uint64, memberPrices []*entity.MemberPrice) error

BatchCreateWithTX 创建商品会员价格

func (MemberPriceRepo) Create

func (r MemberPriceRepo) Create(ctx context.Context, pmsMemberPrice *entity.MemberPrice) error

Create 创建商品会员价格表

func (MemberPriceRepo) DeleteByID

func (r MemberPriceRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除商品会员价格

func (MemberPriceRepo) DeleteByProductIDWithTX

func (r MemberPriceRepo) DeleteByProductIDWithTX(ctx context.Context, productID uint64) error

DeleteByProductIDWithTX 根据商品ID删除记录

func (MemberPriceRepo) GetByDBOption

func (r MemberPriceRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.MemberPrice, uint32, error)

GetByDBOption 根据动态条件查询商品会员价格

func (MemberPriceRepo) GetByID

func (r MemberPriceRepo) GetByID(ctx context.Context, id uint64) (*entity.MemberPrice, error)

GetByID 根据主键ID查询商品会员价格

func (MemberPriceRepo) GetByProductID

func (r MemberPriceRepo) GetByProductID(ctx context.Context, productID uint64) ([]*entity.MemberPrice, error)

GetByProductID 根据商品ID查询商品会员价格

func (MemberPriceRepo) Update

func (r MemberPriceRepo) Update(ctx context.Context, pmsMemberPrice *entity.MemberPrice) error

Update 修改商品会员价格

type OrderItemRepo

type OrderItemRepo struct {
	*db2.GenericDao[entity.OrderItem, uint64]
}

OrderItemRepo 订单商品信息

func NewOrderItemRepo

func NewOrderItemRepo(conn *gorm.DB) *OrderItemRepo

NewOrderItemRepo 创建

func (OrderItemRepo) Create

func (r OrderItemRepo) Create(ctx context.Context, orderItem *entity.OrderItem) error

Create 创建订单商品信息

func (OrderItemRepo) DeleteByID

func (r OrderItemRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除订单商品信息

func (OrderItemRepo) GetByDBOption

func (r OrderItemRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.OrderItem, uint32, error)

GetByDBOption 根据动态条件查询订单商品信息

func (OrderItemRepo) GetByID

func (r OrderItemRepo) GetByID(ctx context.Context, id uint64) (*entity.OrderItem, error)

GetByID 根据主键ID查询订单商品信息

func (OrderItemRepo) GetByOrderID

func (r OrderItemRepo) GetByOrderID(ctx context.Context, orderID uint64) (entity.OrderItems, error)

GetByOrderID 根据订单ID查询订单商品信息

func (OrderItemRepo) Update

func (r OrderItemRepo) Update(ctx context.Context, orderItem *entity.OrderItem) error

Update 修改订单商品信息

type OrderOperateHistoryRepo

type OrderOperateHistoryRepo struct {
	*db2.GenericDao[entity.OrderOperateHistory, uint64]
}

OrderOperateHistoryRepo 订单商品信息

func NewOrderOperateHistoryRepo

func NewOrderOperateHistoryRepo(conn *gorm.DB) *OrderOperateHistoryRepo

NewOrderOperateHistoryRepo 创建

func (OrderOperateHistoryRepo) Create

func (r OrderOperateHistoryRepo) Create(ctx context.Context, orderOperateHistory *entity.OrderOperateHistory) error

Create 创建订单操作历史记录

func (OrderOperateHistoryRepo) DeleteByID

func (r OrderOperateHistoryRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除订单操作历史记录

func (OrderOperateHistoryRepo) GetByDBOption

func (r OrderOperateHistoryRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.OrderOperateHistory, uint32, error)

GetByDBOption 根据动态条件查询订单商品信息

func (OrderOperateHistoryRepo) GetByID

GetByID 根据主键ID查询订单操作历史记录

func (OrderOperateHistoryRepo) GetByOrderID

GetByOrderID 根据订单ID查询操作历史记录

func (OrderOperateHistoryRepo) Update

func (r OrderOperateHistoryRepo) Update(ctx context.Context, orderOperateHistory *entity.OrderOperateHistory) error

Update 修改订单操作历史记录

type OrderRepo

type OrderRepo struct {
	*db2.GenericDao[entity.Order, uint64]
}

OrderRepo 订单

func NewOrderRepo

func NewOrderRepo(conn *gorm.DB) *OrderRepo

NewOrderRepo 创建

func (OrderRepo) Create

func (r OrderRepo) Create(ctx context.Context, order *entity.Order) error

Create 创建订单

func (OrderRepo) DeleteByID

func (r OrderRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除订单

func (OrderRepo) GetByDBOption

func (r OrderRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.Order, uint32, error)

GetByDBOption 根据动态条件查询订单

func (OrderRepo) GetByID

func (r OrderRepo) GetByID(ctx context.Context, id uint64) (*entity.Order, error)

GetByID 根据主键ID查询订单

func (OrderRepo) Update

func (r OrderRepo) Update(ctx context.Context, order *entity.Order) error

Update 修改订单

func (OrderRepo) WithByID

func (r OrderRepo) WithByID(id uint64) db2.DBOption

type OrderReturnApplyRepo

type OrderReturnApplyRepo struct {
	*db2.GenericDao[entity.OrderReturnApply, uint64]
}

OrderReturnApplyRepo 订单退货申请

func NewOrderReturnApplyRepo

func NewOrderReturnApplyRepo(conn *gorm.DB) *OrderReturnApplyRepo

NewOrderReturnApplyRepo 创建

func (OrderReturnApplyRepo) Create

func (r OrderReturnApplyRepo) Create(ctx context.Context, orderReturnApply *entity.OrderReturnApply) error

Create 创建订单退货申请

func (OrderReturnApplyRepo) DeleteByID

func (r OrderReturnApplyRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除订单退货申请

func (OrderReturnApplyRepo) GetByDBOption

func (r OrderReturnApplyRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.OrderReturnApply, uint32, error)

GetByDBOption 根据动态条件查询订单退货申请

func (OrderReturnApplyRepo) GetByID

GetByID 根据主键ID查询订单退货申请

func (OrderReturnApplyRepo) Update

func (r OrderReturnApplyRepo) Update(ctx context.Context, orderReturnApply *entity.OrderReturnApply) error

Update 修改订单退货申请

func (OrderReturnApplyRepo) WithByID

func (r OrderReturnApplyRepo) WithByID(id uint64) db2.DBOption

func (OrderReturnApplyRepo) WithByStatus

func (r OrderReturnApplyRepo) WithByStatus(status uint8) db2.DBOption

type OrderReturnReasonRepo

type OrderReturnReasonRepo struct {
	*db2.GenericDao[entity.OrderReturnReason, uint64]
}

OrderReturnReasonRepo 退货原因

func NewOrderReturnReasonRepo

func NewOrderReturnReasonRepo(conn *gorm.DB) *OrderReturnReasonRepo

NewOrderReturnReasonRepo 创建

func (OrderReturnReasonRepo) Create

func (r OrderReturnReasonRepo) Create(ctx context.Context, orderReturnReason *entity.OrderReturnReason) error

Create 创建退货原因

func (OrderReturnReasonRepo) DeleteByID

func (r OrderReturnReasonRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除退货原因

func (OrderReturnReasonRepo) GetByDBOption

func (r OrderReturnReasonRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.OrderReturnReason, uint32, error)

GetByDBOption 根据动态条件查询退货原因

func (OrderReturnReasonRepo) GetByID

GetByID 根据主键ID查询退货原因

func (OrderReturnReasonRepo) Update

func (r OrderReturnReasonRepo) Update(ctx context.Context, orderReturnReason *entity.OrderReturnReason) error

Update 修改退货原因

func (OrderReturnReasonRepo) WithByID

func (r OrderReturnReasonRepo) WithByID(id uint64) db2.DBOption

type PmsProductCategoryAttributeRelationRepo

type PmsProductCategoryAttributeRelationRepo struct {
	*db2.GenericDao[entity.ProductCategoryAttributeRelation, uint64]
}

PmsProductCategoryAttributeRelationRepo 产品的分类和属性的关系表,用于设置分类筛选条件(只支持一级分类)

func NewProductCategoryAttributeRelationRepo

func NewProductCategoryAttributeRelationRepo(conn *gorm.DB) *PmsProductCategoryAttributeRelationRepo

NewProductCategoryAttributeRelationRepo 创建

func (PmsProductCategoryAttributeRelationRepo) BatchCreateWithTX

func (p PmsProductCategoryAttributeRelationRepo) BatchCreateWithTX(ctx context.Context, productCategoryID uint64, attributeIds []uint64) error

BatchCreateWithTX 批量插入商品分类与筛选属性关系表 attributeIds 商品分类id productAttributeIDList 相关商品筛选属性id集合(pms_product_attribute#id type=1)

func (PmsProductCategoryAttributeRelationRepo) Create

Create 创建

func (PmsProductCategoryAttributeRelationRepo) CreateWithTX

CreateWithTX 创建

func (PmsProductCategoryAttributeRelationRepo) DeleteByID

DeleteByID 根据主键ID删除

func (PmsProductCategoryAttributeRelationRepo) DeleteByProductCategoryIDWithTX

func (p PmsProductCategoryAttributeRelationRepo) DeleteByProductCategoryIDWithTX(ctx context.Context, productCategoryID uint64) error

func (PmsProductCategoryAttributeRelationRepo) GetByID

GetByID 根据主键ID查询

func (PmsProductCategoryAttributeRelationRepo) Update

Update 修改商品

type PrefrenceAreaProductRelationRepo

type PrefrenceAreaProductRelationRepo struct {
	*db2.GenericDao[entity.PrefrenceAreaProductRelation, uint64]
}

PrefrenceAreaProductRelationRepo 优选专区和产品关系表

func NewPrefrenceAreaProductRelationRepo

func NewPrefrenceAreaProductRelationRepo(conn *gorm.DB) *PrefrenceAreaProductRelationRepo

NewPrefrenceAreaProductRelationRepo 创建

func (PrefrenceAreaProductRelationRepo) BatchCreateWithTX

func (r PrefrenceAreaProductRelationRepo) BatchCreateWithTX(ctx context.Context, productID uint64, prefrenceAreaProductRelations []*entity.PrefrenceAreaProductRelation) error

BatchCreateWithTX 创建优选专区和产品关系

func (PrefrenceAreaProductRelationRepo) Create

func (r PrefrenceAreaProductRelationRepo) Create(ctx context.Context, prefrenceAreaProductRelation *entity.PrefrenceAreaProductRelation) error

Create 创建优选专区和产品关系表

func (PrefrenceAreaProductRelationRepo) DeleteByID

DeleteByID 根据主键ID删除优选专区和产品关系表

func (PrefrenceAreaProductRelationRepo) DeleteByProductIDWithTX

func (r PrefrenceAreaProductRelationRepo) DeleteByProductIDWithTX(ctx context.Context, productID uint64) error

DeleteByProductIDWithTX 根据商品ID删除记录

func (PrefrenceAreaProductRelationRepo) GetByDBOption

GetByDBOption 根据动态条件查询优选专区和产品关系

func (PrefrenceAreaProductRelationRepo) GetByID

GetByID 根据主键ID查询优选专区和产品关系表

func (PrefrenceAreaProductRelationRepo) GetByProductID

GetByProductID 根据商品ID查询优选专区和产品关系

func (PrefrenceAreaProductRelationRepo) Update

func (r PrefrenceAreaProductRelationRepo) Update(ctx context.Context, prefrenceAreaProductRelation *entity.PrefrenceAreaProductRelation) error

Update 修改优选专区和产品关系表

type PrefrenceAreaRepo

type PrefrenceAreaRepo struct {
	*db2.GenericDao[entity.PrefrenceArea, uint64]
}

PrefrenceAreaRepo 优选专区

func NewPrefrenceAreaRepo

func NewPrefrenceAreaRepo(conn *gorm.DB) *PrefrenceAreaRepo

NewPrefrenceAreaRepo 创建

func (PrefrenceAreaRepo) Create

func (r PrefrenceAreaRepo) Create(ctx context.Context, prefrenceArea *entity.PrefrenceArea) error

Create 创建优选专区

func (PrefrenceAreaRepo) DeleteByID

func (r PrefrenceAreaRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除优选专区

func (PrefrenceAreaRepo) GetByDBOption

func (r PrefrenceAreaRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.PrefrenceArea, uint32, error)

GetByDBOption 根据动态条件查询优选专区

func (PrefrenceAreaRepo) GetByID

GetByID 根据主键ID查询优选专区

func (PrefrenceAreaRepo) Update

func (r PrefrenceAreaRepo) Update(ctx context.Context, prefrenceArea *entity.PrefrenceArea) error

Update 修改优选专区

type ProductAttributeCategoryRepo

type ProductAttributeCategoryRepo struct {
	*db2.GenericDao[entity.ProductAttributeCategory, uint64]
}

ProductAttributeCategoryRepo 产品属性分类表

func NewProductAttributeCategoryRepo

func NewProductAttributeCategoryRepo(conn *gorm.DB) *ProductAttributeCategoryRepo

NewProductAttributeCategoryRepo 创建

func (ProductAttributeCategoryRepo) Create

func (r ProductAttributeCategoryRepo) Create(ctx context.Context, productAttributeCategory *entity.ProductAttributeCategory) error

Create 创建产品属性分类表

func (ProductAttributeCategoryRepo) DeleteByID

DeleteByID 根据主键ID删除产品属性分类表

func (ProductAttributeCategoryRepo) GetByDBOption

func (r ProductAttributeCategoryRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.ProductAttributeCategory, uint32, error)

GetByDBOption 根据动态条件查询产品属性分类表

func (ProductAttributeCategoryRepo) GetByID

GetByID 根据主键ID查询产品属性分类表

func (ProductAttributeCategoryRepo) Update

func (r ProductAttributeCategoryRepo) Update(ctx context.Context, productAttributeCategory *entity.ProductAttributeCategory) error

Update 修改产品属性分类表

func (ProductAttributeCategoryRepo) WithByName

func (r ProductAttributeCategoryRepo) WithByName(name string) db2.DBOption

type ProductAttributeRepo

type ProductAttributeRepo struct {
	*db.GenericDao[entity.ProductAttribute, uint64]
}

ProductAttributeRepo 商品属性参数表

func NewProductAttributeRepo

func NewProductAttributeRepo(conn *gorm.DB) *ProductAttributeRepo

NewProductAttributeRepo 创建

func (ProductAttributeRepo) Create

func (r ProductAttributeRepo) Create(ctx context.Context, productAttribute *entity.ProductAttribute) error

Create 创建商品属性参数表

func (ProductAttributeRepo) DeleteByID

func (r ProductAttributeRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除商品属性参数表

func (ProductAttributeRepo) GetByDBOption

func (r ProductAttributeRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db.DBOption) ([]*entity.ProductAttribute, uint32, error)

GetByDBOption 根据动态条件查询商品属性参数表

func (ProductAttributeRepo) GetByID

GetByID 根据主键ID查询商品属性参数表

func (ProductAttributeRepo) Update

func (r ProductAttributeRepo) Update(ctx context.Context, productAttribute *entity.ProductAttribute) error

Update 修改商品属性参数表

func (ProductAttributeRepo) WithByName

func (r ProductAttributeRepo) WithByName(name string) db.DBOption

func (ProductAttributeRepo) WithByProductAttributeCategoryID

func (r ProductAttributeRepo) WithByProductAttributeCategoryID(productAttributeCategoryID uint32) db.DBOption

func (ProductAttributeRepo) WithByType

func (r ProductAttributeRepo) WithByType(tpe uint32) db.DBOption

type ProductAttributeValueRepo

type ProductAttributeValueRepo struct {
	*db2.GenericDao[entity.ProductAttributeValue, uint64]
}

ProductAttributeValueRepo 产品参数信息

func NewProductAttributeValueRepo

func NewProductAttributeValueRepo(conn *gorm.DB) *ProductAttributeValueRepo

NewProductAttributeValueRepo 创建

func (ProductAttributeValueRepo) BatchCreateWithTX

func (r ProductAttributeValueRepo) BatchCreateWithTX(ctx context.Context, productID uint64, productAttributeValues []*entity.ProductAttributeValue) error

BatchCreateWithTX 创建产品参数信息

func (ProductAttributeValueRepo) Create

func (r ProductAttributeValueRepo) Create(ctx context.Context, productAttributeValue *entity.ProductAttributeValue) error

Create 创建产品参数信息

func (ProductAttributeValueRepo) DeleteByID

func (r ProductAttributeValueRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除产品参数信息

func (ProductAttributeValueRepo) DeleteByProductIDWithTX

func (r ProductAttributeValueRepo) DeleteByProductIDWithTX(ctx context.Context, productID uint64) error

DeleteByProductIDWithTX 根据商品ID删除记录

func (ProductAttributeValueRepo) GetByDBOption

func (r ProductAttributeValueRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.ProductAttributeValue, uint32, error)

GetByDBOption 根据动态条件查询产品参数信息

func (ProductAttributeValueRepo) GetByID

GetByID 根据主键ID查询产品参数信息

func (ProductAttributeValueRepo) GetByProductID

func (r ProductAttributeValueRepo) GetByProductID(ctx context.Context, productID uint64) ([]*entity.ProductAttributeValue, error)

GetByProductID 根据商品ID查询产品参数信息

func (ProductAttributeValueRepo) Update

func (r ProductAttributeValueRepo) Update(ctx context.Context, productAttributeValue *entity.ProductAttributeValue) error

Update 修改产品参数信息

type ProductCategoryRepo

type ProductCategoryRepo struct {
	*db2.GenericDao[entity.ProductCategory, uint64]
}

ProductCategoryRepo 商品分类表

func NewProductCategoryRepo

func NewProductCategoryRepo(conn *gorm.DB) *ProductCategoryRepo

NewProductCategoryRepo 创建

func (ProductCategoryRepo) Create

func (p ProductCategoryRepo) Create(ctx context.Context, productCategory *entity.ProductCategory) error

Create 创建商品分类

func (ProductCategoryRepo) CreateWithTX

func (p ProductCategoryRepo) CreateWithTX(ctx context.Context, productCategory *entity.ProductCategory) error

CreateWithTX 创建商品分类

func (ProductCategoryRepo) DeleteByID

func (p ProductCategoryRepo) DeleteByID(ctx context.Context, categoryID uint64) error

DeleteByID 根据主键ID删除商品分类

func (ProductCategoryRepo) GetByDBOption

func (p ProductCategoryRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.ProductCategory, uint32, error)

GetByDBOption 根据动态条件查询商品分类

func (ProductCategoryRepo) GetByID

GetByID 根据主键ID查询商品分类

func (ProductCategoryRepo) GetByIDs

GetByIDs 根据主键ID查询商品分类

func (ProductCategoryRepo) Update

func (p ProductCategoryRepo) Update(ctx context.Context, productCategory *entity.ProductCategory) error

Update 修改商品分类

func (ProductCategoryRepo) UpdateFieldByID

func (p ProductCategoryRepo) UpdateFieldByID(ctx context.Context, category *entity.ProductCategory, fields ...string) error

UpdateFieldByID 根据ID修改

func (ProductCategoryRepo) UpdateProductCategoryNavStatus

func (p ProductCategoryRepo) UpdateProductCategoryNavStatus(ctx context.Context, categoryIDs []uint64, navStatus uint32) error

UpdateProductCategoryNavStatus 修改导航栏显示状态

func (ProductCategoryRepo) UpdateProductCategoryShowStatus

func (p ProductCategoryRepo) UpdateProductCategoryShowStatus(ctx context.Context, categoryIDs []uint64, showStatus uint32) error

UpdateProductCategoryShowStatus 修改显示状态

func (ProductCategoryRepo) UpdateWithTX

func (p ProductCategoryRepo) UpdateWithTX(ctx context.Context, productCategory *entity.ProductCategory) error

UpdateWithTX 修改商品分类

func (ProductCategoryRepo) WithByID

func (p ProductCategoryRepo) WithByID(id uint64) db2.DBOption

func (ProductCategoryRepo) WithByName

func (p ProductCategoryRepo) WithByName(name string) db2.DBOption

func (ProductCategoryRepo) WithByParentID

func (p ProductCategoryRepo) WithByParentID(parentID uint64) db2.DBOption

type ProductFullReductionRepo

type ProductFullReductionRepo struct {
	*db2.GenericDao[entity.ProductFullReduction, uint64]
}

ProductFullReductionRepo 产品满减表(只针对同商品)

func NewProductFullReductionRepo

func NewProductFullReductionRepo(conn *gorm.DB) *ProductFullReductionRepo

NewProductFullReductionRepo 创建

func (ProductFullReductionRepo) BatchCreateWithTX

func (r ProductFullReductionRepo) BatchCreateWithTX(ctx context.Context, productID uint64, productFullReductions []*entity.ProductFullReduction) error

BatchCreateWithTX 创建产品满减

func (ProductFullReductionRepo) Create

func (r ProductFullReductionRepo) Create(ctx context.Context, productFullReduction *entity.ProductFullReduction) error

Create 创建产品满减

func (ProductFullReductionRepo) DeleteByID

func (r ProductFullReductionRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除产品满减

func (ProductFullReductionRepo) DeleteByProductIDWithTX

func (r ProductFullReductionRepo) DeleteByProductIDWithTX(ctx context.Context, productID uint64) error

DeleteByProductIDWithTX 根据商品ID删除记录

func (ProductFullReductionRepo) GetByDBOption

func (r ProductFullReductionRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.ProductFullReduction, uint32, error)

GetByDBOption 根据动态条件查询产品满减

func (ProductFullReductionRepo) GetByID

GetByID 根据主键ID查询产品满减

func (ProductFullReductionRepo) GetByProductID

func (r ProductFullReductionRepo) GetByProductID(ctx context.Context, productID uint64) ([]*entity.ProductFullReduction, error)

GetByProductID 根据产品ID查询产品满减

func (ProductFullReductionRepo) Update

func (r ProductFullReductionRepo) Update(ctx context.Context, productFullReduction *entity.ProductFullReduction) error

Update 修改产品满减

type ProductLadderRepo

type ProductLadderRepo struct {
	*db.GenericDao[entity.ProductLadder, uint64]
}

ProductLadderRepo 产品阶梯价格表(只针对同商品)

func NewProductLadderRepo

func NewProductLadderRepo(conn *gorm.DB) *ProductLadderRepo

NewProductLadderRepo 创建

func (ProductLadderRepo) BatchCreateWithTX

func (r ProductLadderRepo) BatchCreateWithTX(ctx context.Context, productID uint64, productLadders []*entity.ProductLadder) error

BatchCreateWithTX 创建阶梯价格

func (ProductLadderRepo) Create

func (r ProductLadderRepo) Create(ctx context.Context, productLadder *entity.ProductLadder) error

Create 创建产品阶梯价格

func (ProductLadderRepo) DeleteByID

func (r ProductLadderRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除产品阶梯价格

func (ProductLadderRepo) DeleteByProductIDWithTX

func (r ProductLadderRepo) DeleteByProductIDWithTX(ctx context.Context, productID uint64) error

DeleteByProductIDWithTX 根据商品ID删除记录

func (ProductLadderRepo) GetByDBOption

func (r ProductLadderRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db.DBOption) ([]*entity.ProductLadder, uint32, error)

GetByDBOption 根据动态条件查询产品阶梯价格

func (ProductLadderRepo) GetByID

GetByID 根据主键ID查询产品阶梯价格

func (ProductLadderRepo) GetByProductID

func (r ProductLadderRepo) GetByProductID(ctx context.Context, productID uint64) ([]*entity.ProductLadder, error)

GetByProductID 根据商品ID查询商品阶梯价格

func (ProductLadderRepo) Update

func (r ProductLadderRepo) Update(ctx context.Context, productLadder *entity.ProductLadder) error

Update 修改产品阶梯价格

type ProductRepo

type ProductRepo struct {
	*db2.GenericDao[entity.Product, uint64]
}

ProductRepo 商品信息表

func NewProductRepo

func NewProductRepo(conn *gorm.DB) *ProductRepo

NewProductRepo 创建

func (ProductRepo) Create

func (r ProductRepo) Create(ctx context.Context, product *entity.Product) error

Create 创建商品

func (ProductRepo) CreateWithTX

func (r ProductRepo) CreateWithTX(ctx context.Context, product *entity.Product) error

CreateWithTX 创建商品

func (ProductRepo) DeleteByID

func (r ProductRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除商品

func (ProductRepo) GetByDBOption

func (r ProductRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) (entity.Products, uint32, error)

GetByDBOption 根据动态条件查询商品

func (ProductRepo) GetByID

func (r ProductRepo) GetByID(ctx context.Context, id uint64) (*entity.Product, error)

GetByID 根据主键ID查询商品

func (ProductRepo) Update

func (r ProductRepo) Update(ctx context.Context, product *entity.Product) error

Update 修改商品

func (ProductRepo) UpdateWithTX

func (r ProductRepo) UpdateWithTX(ctx context.Context, product *entity.Product) error

UpdateWithTX 修改商品

func (ProductRepo) WithByBrandID

func (r ProductRepo) WithByBrandID(brandID uint64) db2.DBOption

func (ProductRepo) WithByID

func (r ProductRepo) WithByID(id uint64) db2.DBOption

func (ProductRepo) WithByName

func (r ProductRepo) WithByName(name string) db2.DBOption

func (ProductRepo) WithByProductCategoryID

func (r ProductRepo) WithByProductCategoryID(productCategoryID uint64) db2.DBOption

func (ProductRepo) WithByProductSN

func (r ProductRepo) WithByProductSN(productSN string) db2.DBOption

func (ProductRepo) WithByPublishStatus

func (r ProductRepo) WithByPublishStatus(publishStatus uint32) db2.DBOption

func (ProductRepo) WithByVerifyStatus

func (r ProductRepo) WithByVerifyStatus(verifyStatus uint32) db2.DBOption

type RegisterFuncType

type RegisterFuncType func(db *gorm.DB) error

type SkuStockRepo

type SkuStockRepo struct {
	*db2.GenericDao[entity.SkuStock, uint64]
}

SkuStockRepo sku的库存

func NewSkuStockRepo

func NewSkuStockRepo(conn *gorm.DB) *SkuStockRepo

NewSkuStockRepo 创建

func (SkuStockRepo) BatchCreateWithTX

func (r SkuStockRepo) BatchCreateWithTX(ctx context.Context, productID uint64, skuStocks []*entity.SkuStock) error

BatchCreateWithTX 创建sku库存

func (SkuStockRepo) BatchDeleteByIDWithTX

func (r SkuStockRepo) BatchDeleteByIDWithTX(ctx context.Context, ids []uint64) error

BatchDeleteByIDWithTX 根据ID删除记录

func (SkuStockRepo) BatchUpDateByIDWithTX

func (r SkuStockRepo) BatchUpDateByIDWithTX(ctx context.Context, skuStocks []*entity.SkuStock) error

BatchUpDateByIDWithTX 根据ID修改记录

func (SkuStockRepo) BatchUpdateOrInsertSkuStock

func (r SkuStockRepo) BatchUpdateOrInsertSkuStock(ctx context.Context, stocks []*entity.SkuStock) error

BatchUpdateOrInsertSkuStock 批量插入或者更新

func (SkuStockRepo) Create

func (r SkuStockRepo) Create(ctx context.Context, skuStock *entity.SkuStock) error

Create 创建sku的库存

func (SkuStockRepo) DeleteByID

func (r SkuStockRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除sku的库存

func (SkuStockRepo) DeleteByProductIDWithTX

func (r SkuStockRepo) DeleteByProductIDWithTX(ctx context.Context, productID uint64) error

DeleteByProductIDWithTX 根据商品ID删除记录

func (SkuStockRepo) GetByDBOption

func (r SkuStockRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.SkuStock, uint32, error)

GetByDBOption 根据动态条件查询sku的库存

func (SkuStockRepo) GetByID

func (r SkuStockRepo) GetByID(ctx context.Context, id uint64) (*entity.SkuStock, error)

GetByID 根据主键ID查询sku的库存

func (SkuStockRepo) GetByProductID

func (r SkuStockRepo) GetByProductID(ctx context.Context, productID uint64) ([]*entity.SkuStock, error)

GetByProductID 根据商品ID查询sku的库存

func (SkuStockRepo) Update

func (r SkuStockRepo) Update(ctx context.Context, skuStock *entity.SkuStock) error

Update 修改sku的库存

func (SkuStockRepo) WithByProductID

func (r SkuStockRepo) WithByProductID(productID uint64) db2.DBOption

func (SkuStockRepo) WithBySkuCode

func (r SkuStockRepo) WithBySkuCode(skuCode string) db2.DBOption

type SubjectProductRelationRepo

type SubjectProductRelationRepo struct {
	*db2.GenericDao[entity.SubjectProductRelation, uint64]
}

SubjectProductRelationRepo 专题商品关系

func NewSubjectProductRelationRepo

func NewSubjectProductRelationRepo(conn *gorm.DB) *SubjectProductRelationRepo

NewSubjectProductRelationRepo 创建

func (SubjectProductRelationRepo) BatchCreateWithTX

func (r SubjectProductRelationRepo) BatchCreateWithTX(ctx context.Context, productID uint64, subjectProductRelations []*entity.SubjectProductRelation) error

BatchCreateWithTX 创建专题商品关系

func (SubjectProductRelationRepo) Create

func (r SubjectProductRelationRepo) Create(ctx context.Context, subjectProductRelation *entity.SubjectProductRelation) error

Create 创建专题商品关系

func (SubjectProductRelationRepo) DeleteByID

func (r SubjectProductRelationRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除专题商品关系

func (SubjectProductRelationRepo) DeleteByProductIDWithTX

func (r SubjectProductRelationRepo) DeleteByProductIDWithTX(ctx context.Context, productID uint64) error

DeleteByProductIDWithTX 根据商品ID删除记录

func (SubjectProductRelationRepo) GetByDBOption

func (r SubjectProductRelationRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.SubjectProductRelation, uint32, error)

GetByDBOption 根据动态条件查询专题商品关系表

func (SubjectProductRelationRepo) GetByID

GetByID 根据主键ID查询专题商品关系表

func (SubjectProductRelationRepo) GetByProductID

func (r SubjectProductRelationRepo) GetByProductID(ctx context.Context, productID uint64) ([]*entity.SubjectProductRelation, error)

GetByProductID 根据商品ID查询专题商品关系

func (SubjectProductRelationRepo) Update

func (r SubjectProductRelationRepo) Update(ctx context.Context, subjectProductRelation *entity.SubjectProductRelation) error

Update 修改专题商品关系

type SubjectRepo

type SubjectRepo struct {
	*db2.GenericDao[entity.Subject, uint64]
}

SubjectRepo 专题表

func NewSubjectRepo

func NewSubjectRepo(conn *gorm.DB) *SubjectRepo

NewSubjectRepo 创建

func (SubjectRepo) Create

func (r SubjectRepo) Create(ctx context.Context, subject *entity.Subject) error

Create 创建专题表

func (SubjectRepo) DeleteByID

func (r SubjectRepo) DeleteByID(ctx context.Context, id uint64) error

DeleteByID 根据主键ID删除专题表

func (SubjectRepo) GetByDBOption

func (r SubjectRepo) GetByDBOption(ctx context.Context, pageNum uint32, pageSize uint32, opts ...db2.DBOption) ([]*entity.Subject, uint32, error)

GetByDBOption 根据动态条件查询专题表

func (SubjectRepo) GetByID

func (r SubjectRepo) GetByID(ctx context.Context, id uint64) (*entity.Subject, error)

GetByID 根据主键ID查询专题表

func (SubjectRepo) Update

func (r SubjectRepo) Update(ctx context.Context, subject *entity.Subject) error

Update 修改专题表

Jump to

Keyboard shortcuts

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