103 lines
2.3 KiB
Go
103 lines
2.3 KiB
Go
package wheel
|
||
|
||
const (
|
||
StatusDraft = "draft"
|
||
StatusActive = "active"
|
||
StatusPending = "pending"
|
||
StatusGranted = "granted"
|
||
StatusFailed = "failed"
|
||
|
||
RewardTypeCoin = "coin"
|
||
RewardTypeGift = "gift"
|
||
RewardTypeProp = "prop"
|
||
RewardTypeDress = "dress"
|
||
|
||
EventTypeWheelRewardSettlement = "WheelRewardSettlement"
|
||
)
|
||
|
||
// RuleConfig 是转盘配置的不可变版本快照。
|
||
// 金币和礼物可以配置 RTP 计值,道具/装扮即使有展示价值也必须在运行态归零。
|
||
type RuleConfig struct {
|
||
AppCode string
|
||
WheelID string
|
||
RuleVersion int64
|
||
Enabled bool
|
||
DrawPriceCoins int64
|
||
TargetRTPPPM int64
|
||
PoolRatePPM int64
|
||
SettlementWindowDraws int64
|
||
InitialPoolCoins int64
|
||
PoolReserveCoins int64
|
||
MaxSingleRTPPayout int64
|
||
EffectiveFromMS int64
|
||
CreatedByAdminID int64
|
||
CreatedAtMS int64
|
||
Tiers []Tier
|
||
}
|
||
|
||
// Tier 是一个转盘奖档;RewardType 决定发放 owner 和 RTP 计值口径。
|
||
type Tier struct {
|
||
TierID string
|
||
DisplayName string
|
||
RewardType string
|
||
RewardID string
|
||
RewardCount int64
|
||
RewardCoins int64
|
||
RTPValueCoins int64
|
||
WeightPPM int64
|
||
Enabled bool
|
||
MetadataJSON string
|
||
}
|
||
|
||
type DrawCommand struct {
|
||
CommandID string
|
||
WheelID string
|
||
UserID int64
|
||
DeviceID string
|
||
DrawCount int32
|
||
CoinSpent int64
|
||
PaidAtMS int64
|
||
VisibleRegionID int64
|
||
}
|
||
|
||
type DrawResult struct {
|
||
DrawID string
|
||
DrawIDs []string
|
||
CommandID string
|
||
WheelID string
|
||
RuleVersion int64
|
||
SelectedTierID string
|
||
RewardType string
|
||
RewardID string
|
||
RewardCount int64
|
||
RewardCoins int64
|
||
RTPValueCoins int64
|
||
RewardStatus string
|
||
RTPWindowIndex int64
|
||
ActualRTPPPM int64
|
||
CreatedAtMS int64
|
||
WalletTransactionID string
|
||
CoinBalanceAfter int64
|
||
MetadataJSON string
|
||
}
|
||
|
||
type DrawSummary struct {
|
||
WheelID string
|
||
TotalDraws int64
|
||
UniqueUsers int64
|
||
TotalSpentCoins int64
|
||
TotalRTPValueCoins int64
|
||
ActualRTPPPM int64
|
||
PendingDraws int64
|
||
GrantedDraws int64
|
||
FailedDraws int64
|
||
}
|
||
|
||
type DrawQuery struct {
|
||
WheelID string
|
||
UserID int64
|
||
Status string
|
||
Page int32
|
||
PageSize int32
|
||
}
|