Documentation ¶
Index ¶
- func GenerateLogForRule(corp business.ICorp, user business.IUser, orderBid string, rule *PointRule, ...) *m_point.PointLog
- func InitSystemRulesForCorp(ctx context.Context, corp business.ICorp)
- func RecordPointLog(ctx context.Context, corp business.ICorp, user business.IUser, orderBid string, ...)
- type EncodePointLogService
- type EncodePointRuleService
- type FillPointLogService
- type FillPointRuleService
- type Order
- type PointLog
- type PointLogRepository
- func (this *PointLogRepository) GetPagedPointLogs(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PointLog, eel.INextPageInfo)
- func (this *PointLogRepository) GetPagedPointLogsForCorp(corp business.ICorp, filters eel.Map, page *eel.PageInfo) ([]*PointLog, eel.INextPageInfo)
- func (this *PointLogRepository) GetPagedPointLogsForUserInCorp(corp business.ICorp, user business.IUser, filters eel.Map, page *eel.PageInfo) ([]*PointLog, eel.INextPageInfo)
- func (this *PointLogRepository) GetPointLogs(filters eel.Map, orderExprs ...string) []*PointLog
- func (this *PointLogRepository) GetPointLogsForUserInCorp(corp business.ICorp, user business.IUser, filters eel.Map) []*PointLog
- type PointRule
- func (this *PointRule) Delete() error
- func (this *PointRule) GetStageText() string
- func (this *PointRule) GetTypeText() string
- func (this *PointRule) IsActive() bool
- func (this *PointRule) IsMaxPerDayRule() bool
- func (this *PointRule) IsOutputRule() bool
- func (this *PointRule) IsPreconditionRule() bool
- func (this *PointRule) IsTradeRule() bool
- func (this *PointRule) Update(ruleType string, data interface{}, point int)
- type PointRuleFactory
- type PointRuleRepository
- func (this *PointRuleRepository) GetPagedPointRules(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PointRule, eel.INextPageInfo)
- func (this *PointRuleRepository) GetPagedPointRulesForCorp(corp business.ICorp, filters eel.Map, page *eel.PageInfo) ([]*PointRule, eel.INextPageInfo)
- func (this *PointRuleRepository) GetPointRuleInCorp(corp business.ICorp, ruleId int) *PointRule
- func (this *PointRuleRepository) GetPointRules(filters eel.Map, orderExprs ...string) []*PointRule
- type PointService
- func (this *PointService) GetPendingTradingCountForUser(user business.IUser) int
- func (this *PointService) GetTodayPointForUserInCorp(corp business.ICorp, user business.IUser) int
- func (this *PointService) RecordTradeForUser(user business.IUser) error
- func (this *PointService) ResetPendingTradeCountForUser(user business.IUser) error
- type RPointLog
- type RPointRule
- type RuleEngine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateLogForRule ¶
Types ¶
type EncodePointLogService ¶
type EncodePointLogService struct {
eel.ServiceBase
}
func NewEncodePointLogService ¶
func NewEncodePointLogService(ctx context.Context) *EncodePointLogService
func (*EncodePointLogService) Encode ¶
func (this *EncodePointLogService) Encode(log *PointLog) *RPointLog
func (*EncodePointLogService) EncodeMany ¶
func (this *EncodePointLogService) EncodeMany(logs []*PointLog) []*RPointLog
type EncodePointRuleService ¶
type EncodePointRuleService struct {
eel.ServiceBase
}
func NewEncodePointRuleService ¶
func NewEncodePointRuleService(ctx context.Context) *EncodePointRuleService
func (*EncodePointRuleService) Encode ¶
func (this *EncodePointRuleService) Encode(rule *PointRule) *RPointRule
func (*EncodePointRuleService) EncodeMany ¶
func (this *EncodePointRuleService) EncodeMany(rules []*PointRule) []*RPointRule
type FillPointLogService ¶
type FillPointLogService struct {
eel.ServiceBase
}
func NewFillPointLogService ¶
func NewFillPointLogService(ctx context.Context) *FillPointLogService
func (*FillPointLogService) Fill ¶
func (this *FillPointLogService) Fill(logs []*PointLog, option eel.FillOption)
func (*FillPointLogService) FillOne ¶
func (this *FillPointLogService) FillOne(log *PointLog, option eel.FillOption)
type FillPointRuleService ¶
type FillPointRuleService struct {
eel.ServiceBase
}
func NewFillPointRuleService ¶
func NewFillPointRuleService(ctx context.Context) *FillPointRuleService
func (*FillPointRuleService) Fill ¶
func (this *FillPointRuleService) Fill(rules []*PointRule, option eel.FillOption)
func (*FillPointRuleService) FillOne ¶
func (this *FillPointRuleService) FillOne(rule *PointRule, option eel.FillOption)
type PointLog ¶
type PointLogRepository ¶
type PointLogRepository struct {
eel.ServiceBase
}
func NewPointLogRepository ¶
func NewPointLogRepository(ctx context.Context) *PointLogRepository
func (*PointLogRepository) GetPagedPointLogs ¶
func (this *PointLogRepository) GetPagedPointLogs(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PointLog, eel.INextPageInfo)
func (*PointLogRepository) GetPagedPointLogsForCorp ¶
func (this *PointLogRepository) GetPagedPointLogsForCorp(corp business.ICorp, filters eel.Map, page *eel.PageInfo) ([]*PointLog, eel.INextPageInfo)
func (*PointLogRepository) GetPagedPointLogsForUserInCorp ¶
func (*PointLogRepository) GetPointLogs ¶
func (this *PointLogRepository) GetPointLogs(filters eel.Map, orderExprs ...string) []*PointLog
func (*PointLogRepository) GetPointLogsForUserInCorp ¶
type PointRule ¶
type PointRule struct { eel.EntityBase Id int Type int Stage int CorpId int Name string Detail string Data map[string]interface{} // 规则业务数据 Point int // 奖励积分值 IsForAllProduct bool IsSystemRule bool IsEnabled bool IsDeleted bool CreatedAt time.Time UpdatedAt time.Time }
func NewPointRuleFromModel ¶
func (*PointRule) GetStageText ¶
func (*PointRule) GetTypeText ¶
func (*PointRule) IsMaxPerDayRule ¶
func (*PointRule) IsOutputRule ¶
func (*PointRule) IsPreconditionRule ¶
func (*PointRule) IsTradeRule ¶
type PointRuleFactory ¶
type PointRuleFactory struct {
eel.ServiceBase
}
func NewPointRuleFactory ¶
func NewPointRuleFactory(ctx context.Context) *PointRuleFactory
func (*PointRuleFactory) CreateRuleForCorp ¶
func (*PointRuleFactory) InitSystemRulesForCorp ¶
func (this *PointRuleFactory) InitSystemRulesForCorp(corp business.ICorp)
type PointRuleRepository ¶
type PointRuleRepository struct {
eel.ServiceBase
}
func NewPointRuleRepository ¶
func NewPointRuleRepository(ctx context.Context) *PointRuleRepository
func (*PointRuleRepository) GetPagedPointRules ¶
func (this *PointRuleRepository) GetPagedPointRules(filters eel.Map, page *eel.PageInfo, orderExprs ...string) ([]*PointRule, eel.INextPageInfo)
func (*PointRuleRepository) GetPagedPointRulesForCorp ¶
func (this *PointRuleRepository) GetPagedPointRulesForCorp(corp business.ICorp, filters eel.Map, page *eel.PageInfo) ([]*PointRule, eel.INextPageInfo)
func (*PointRuleRepository) GetPointRuleInCorp ¶
func (this *PointRuleRepository) GetPointRuleInCorp(corp business.ICorp, ruleId int) *PointRule
func (*PointRuleRepository) GetPointRules ¶
func (this *PointRuleRepository) GetPointRules(filters eel.Map, orderExprs ...string) []*PointRule
type PointService ¶
type PointService struct {
eel.ServiceBase
}
func NewPointService ¶
func NewPointService(ctx context.Context) *PointService
func (*PointService) GetPendingTradingCountForUser ¶
func (this *PointService) GetPendingTradingCountForUser(user business.IUser) int
GetPendingTradingCountForUser : 获取user的未处理消费记录
func (*PointService) GetTodayPointForUserInCorp ¶
GetTodayPointForUserInCorp : 获得当天user在corp中领取的积分累积值
func (*PointService) RecordTradeForUser ¶
func (this *PointService) RecordTradeForUser(user business.IUser) error
RecordTradeForUser : 记录user的一次消费
func (*PointService) ResetPendingTradeCountForUser ¶
func (this *PointService) ResetPendingTradeCountForUser(user business.IUser) error
ResetPendingTradeCountForUser : 记录user的未处理消费记录
type RPointRule ¶
type RPointRule struct { Id int `json:"id"` CorpId int `json:"corp_id"` Type string `json:"type"` Stage string `json:"stage"` IsSystemRule bool `json:"is_system_rule"` Name string `json:"name"` Detail string `json:"detail"` Data interface{} `json:"data"` Point int `json:"point"` IsEnabled bool `json:"is_enabled"` IsDeleted bool `json:"is_deleted"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type RuleEngine ¶
type RuleEngine struct {
eel.ServiceBase
}
func NewRuleEngine ¶
func NewRuleEngine(ctx context.Context) *RuleEngine
func (*RuleEngine) RunForCorp ¶
Click to show internal directories.
Click to hide internal directories.