85 lines
2.1 KiB
Go
85 lines
2.1 KiB
Go
package resource
|
|
|
|
type UserResourceEntitlement struct {
|
|
AppCode string
|
|
EntitlementID string
|
|
UserID int64
|
|
ResourceID int64
|
|
Resource Resource
|
|
Status string
|
|
Quantity int64
|
|
RemainingQuantity int64
|
|
EffectiveAtMS int64
|
|
ExpiresAtMS int64
|
|
SourceGrantID string
|
|
SourceSnapshotID string
|
|
ResourceSnapshotHash string
|
|
ResourceSnapshotJSON string
|
|
GiftSnapshotHash string
|
|
GiftSnapshotJSON string
|
|
PinnedGiftConfigs []GiftConfig
|
|
CreatedAtMS int64
|
|
UpdatedAtMS int64
|
|
Equipped bool
|
|
}
|
|
|
|
type ListUserResourcesQuery struct {
|
|
AppCode string
|
|
UserID int64
|
|
ResourceType string
|
|
ActiveOnly bool
|
|
}
|
|
|
|
type RevokeUserResourceCommand struct {
|
|
RequestID string
|
|
AppCode string
|
|
UserID int64
|
|
EntitlementID string
|
|
Reason string
|
|
OperatorUserID int64
|
|
}
|
|
|
|
type EquipUserResourceCommand struct {
|
|
// RequestID 只用于链路追踪;不能作为客户端网络重试的业务幂等键。
|
|
RequestID string
|
|
// CommandID 是装备状态变更的持久幂等键。同键不同 payload 必须返回 IDEMPOTENCY_CONFLICT。
|
|
CommandID string
|
|
AppCode string
|
|
UserID int64
|
|
ResourceID int64
|
|
EntitlementID string
|
|
}
|
|
|
|
// VipBenefitRequirement 描述一个资源由 tiered VIP 权益解锁的最低门槛。
|
|
// 同一资源若被多个权益引用,装备时满足任一 active effective benefit 即可。
|
|
type VipBenefitRequirement struct {
|
|
BenefitCode string
|
|
RequiredLevel int32
|
|
ResourceType string
|
|
}
|
|
|
|
type UnequipUserResourceCommand struct {
|
|
// RequestID 仅在 vip_trial_card 委托专用卸下流程时用于发布完整 VIP 状态变更事件。
|
|
RequestID string
|
|
AppCode string
|
|
UserID int64
|
|
ResourceType string
|
|
}
|
|
|
|
type UnequipUserResourceResult struct {
|
|
ResourceType string
|
|
Unequipped bool
|
|
UpdatedAtMS int64
|
|
}
|
|
|
|
type BatchGetUserEquippedResourcesQuery struct {
|
|
AppCode string
|
|
UserIDs []int64
|
|
ResourceTypes []string
|
|
}
|
|
|
|
type UserEquippedResources struct {
|
|
UserID int64
|
|
Resources []UserResourceEntitlement
|
|
}
|