2026-06-11 18:40:20 +08:00

209 lines
5.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package task
const (
TypeDaily = "daily"
TypeExclusive = "exclusive"
SectionDaily = "daily"
SectionExclusive = "exclusive"
CycleLifetime = "lifetime"
AudienceAll = "all"
AudienceNewbie = "newbie"
ActionNone = "none"
ActionRoom = "room"
ActionRoomRandom = "room_random"
ActionRoomWindow = "room_window"
ActionRoomRandomWindow = "room_random_window"
ActionRoomGame = "room_game"
ActionRoomRandomGame = "room_random_game"
ActionExploreGame = "explore_game"
ActionWallet = "wallet"
ActionGiftPanel = "gift_panel"
ActionGiftPanelSpecific = "gift_panel_specific"
MetricGameSpendCoin = "game_spend_coin"
MetricGameDicePlayCount = "game_dice_play_count"
MetricGameRockPlayCount = "game_rock_play_count"
MetricGiftSpendCoin = "gift_spend_coin"
MetricGiftSendCount = "gift_send_count"
MetricLuckyGiftSpendCoin = "lucky_gift_spend_coin"
MetricLuckyGiftSendCount = "lucky_gift_send_count"
MetricRechargeCoin = "recharge_coin"
MetricCPRelationshipCreated = "cp_relationship_created"
MetricMicOnlineMinute = "mic_online_minute"
MetricMoodPublishCount = "mood_publish_count"
StatusDraft = "draft"
StatusActive = "active"
StatusPaused = "paused"
StatusArchived = "archived"
StatusInProgress = "in_progress"
StatusCompleted = "completed"
StatusClaimed = "claimed"
StatusExpired = "expired"
ClaimStatusPending = "pending"
ClaimStatusGranted = "granted"
ClaimStatusFailed = "failed"
EventStatusConsumed = "consumed"
EventStatusSkipped = "skipped"
EventStatusFailed = "failed"
)
// Definition 是 task_definitions 的当前版本读模型App 查询只读这张表和用户进度表。
type Definition struct {
AppCode string
TaskID string
TaskType string
Category string
MetricType string
Title string
Description string
AudienceType string
IconKey string
IconURL string
ActionType string
ActionParam string
ActionPayloadJSON string
DimensionFilterJSON string
TargetValue int64
TargetUnit string
RewardCoinAmount int64
Status string
SortOrder int32
Version int64
CurrentVersionID int64
EffectiveFromMS int64
EffectiveToMS int64
CreatedByAdminID int64
UpdatedByAdminID int64
CreatedAtMS int64
UpdatedAtMS int64
}
// Progress 是 user_task_progress 的用户维度状态target/reward 使用创建进度时的任务快照。
type Progress struct {
AppCode string
UserID int64
TaskID string
TaskVersionID int64
CycleKey string
ProgressValue int64
TargetValue int64
RewardCoinAmount int64
Status string
CompletedAtMS int64
ClaimedAtMS int64
UpdatedAtMS int64
}
// Item 是 App 任务列表返回前的领域快照。
type Item struct {
Definition
ProgressValue int64
UserStatus string
Claimable bool
TaskDay string
ServerTimeMS int64
NextRefreshAtMS int64
}
// Section 是 daily/exclusive 的固定分区。
type Section struct {
Section string
Items []Item
ServerTimeMS int64
NextRefreshAtMS int64
}
// ListResult 是 App 任务页的完整只读结果。
type ListResult struct {
Sections []Section
ServerTimeMS int64
NextRefreshAtMS int64
}
// DefinitionQuery 是后台任务配置列表筛选条件。
type DefinitionQuery struct {
TaskType string
Category string
Status string
Keyword string
Page int32
PageSize int32
}
// DefinitionCommand 是后台创建/编辑任务定义的命令快照。
type DefinitionCommand struct {
TaskID string
TaskType string
Category string
MetricType string
Title string
Description string
AudienceType string
IconKey string
IconURL string
ActionType string
ActionParam string
ActionPayloadJSON string
DimensionFilterJSON string
TargetValue int64
TargetUnit string
RewardCoinAmount int64
Status string
SortOrder int32
EffectiveFromMS int64
EffectiveToMS int64
OperatorAdminID int64
}
// Event 是由 wallet/user/room outbox 派生的任务进度事实。
type Event struct {
EventID string
EventType string
SourceService string
UserID int64
MetricType string
Value int64
OccurredAtMS int64
DimensionsJSON string
}
// EventResult 表达事件消费幂等结果。
type EventResult struct {
EventID string
Status string
MatchedTaskCount int32
}
// ClaimCommand 是用户领取任务奖励的幂等命令。
type ClaimCommand struct {
UserID int64
TaskID string
TaskType string
CycleKey string
CommandID string
}
// Claim 是 task_reward_claims 的领奖事实。
type Claim struct {
ClaimID string
CommandID string
UserID int64
TaskID string
TaskType string
CycleKey string
RewardCoinAmount int64
WalletCommandID string
WalletTransactionID string
Status string
FailureReason string
CreatedAtMS int64
UpdatedAtMS int64
}