point

package
v0.0.0-...-06e3151 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncodePointProductService

type EncodePointProductService struct {
	eel.ServiceBase
}

func NewEncodePointProductService

func NewEncodePointProductService(ctx context.Context) *EncodePointProductService

func (*EncodePointProductService) Encode

func (this *EncodePointProductService) Encode(pointProduct *PointProduct) *RPointProduct

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

func (*EncodePointProductService) EncodeMany

func (this *EncodePointProductService) EncodeMany(pointProducts []*PointProduct) []*RPointProduct

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

type FillPointProductService

type FillPointProductService struct {
	eel.ServiceBase
}

func NewFillPointProductService

func NewFillPointProductService(ctx context.Context) *FillPointProductService

func (*FillPointProductService) Fill

func (this *FillPointProductService) Fill(pointProducts []*PointProduct, option eel.FillOption)

type PointProduct

type PointProduct struct {
	eel.EntityBase
	Id     int
	CorpId int

	PointPrice int
	MoneyPrice int
	IsEnabled  bool
	BuyLimit   int

	ProductId int
	Product   *product.Product

	StartTime time.Time
	EndTime   time.Time

	CreatedAt time.Time
}

func NewPointProduct

func NewPointProduct(
	ctx context.Context,
	corp business.ICorp,
	productId int,
	pointPrice int,
	moneyPrice int,
	buyLimit int,
	startTime time.Time,
	endTime time.Time,
) *PointProduct

func NewPointProductFromModel

func NewPointProductFromModel(ctx context.Context, model *m_point.PointProduct) *PointProduct

根据model构建对象

func (*PointProduct) Delete

func (this *PointProduct) Delete() error

func (*PointProduct) Disable

func (this *PointProduct) Disable()

func (*PointProduct) Enable

func (this *PointProduct) Enable()

func (*PointProduct) Update

func (this *PointProduct) Update(
	pointPrice int,
	moneyPrice int,
	buyLimit int,
	startTime time.Time,
	endTime time.Time,
)

type PointProductRepository

type PointProductRepository struct {
	eel.RepositoryBase
}

func NewPointProductRepository

func NewPointProductRepository(ctx context.Context) *PointProductRepository

func (*PointProductRepository) GetAllPointProductsForCorp

func (this *PointProductRepository) GetAllPointProductsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*PointProduct, eel.INextPageInfo)

GetAllPointProductsForCorp 获得所有PointProduct对象集合

func (*PointProductRepository) GetEnabledPointProductsForCorp

func (this *PointProductRepository) GetEnabledPointProductsForCorp(corp business.ICorp, page *eel.PageInfo, filters eel.Map) ([]*PointProduct, eel.INextPageInfo)

GetEnabledPointProductsForCorp 获得启用的PointProduct对象集合

func (*PointProductRepository) GetPagedPointProducts

func (this *PointProductRepository) GetPagedPointProducts(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PointProduct, eel.INextPageInfo)

func (*PointProductRepository) GetPointProduct

func (this *PointProductRepository) GetPointProduct(id int) *PointProduct

GetPointProduct 根据id和corp获得PointProduct对象

func (*PointProductRepository) GetPointProductByProductIds

func (this *PointProductRepository) GetPointProductByProductIds(ids []int) []*PointProduct

func (*PointProductRepository) GetPointProductInCorp

func (this *PointProductRepository) GetPointProductInCorp(corp business.ICorp, id int) *PointProduct

GetPointProductInCorp 根据id和corp获得PointProduct对象

func (*PointProductRepository) GetPointProducts

func (this *PointProductRepository) GetPointProducts(filters eel.Map, orderExprs ...string) []*PointProduct

type RPointProduct

type RPointProduct struct {
	Id         int       `json:"id"`
	CorpId     int       `json:"corp_id"`
	ProductId  int       `json:"product_id"`
	PointPrice int       `json:"point_price"`
	MoneyPrice int       `json:"money_price"`
	IsEnabled  bool      `json:"is_enabled"`
	BuyLimit   int       `json:"buy_limit"`
	Product    *RProduct `json:"product"`
	StartTime  string    `json:"start_time"`
	EndTime    string    `json:"end_time"`
	CreatedAt  string    `json:"created_at"`
}

type RProduct

type RProduct struct {
	Id         int    `json:"id"`
	SupplierId int    `json:"supplier_id"`
	Name       string `json:"name"`
	Thumbnail  string `json:"thumbnail"`
}

Jump to

Keyboard shortcuts

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