syntax = "proto3"; package hyapp.events.luckygift.v1; option go_package = "hyapp.local/api/proto/events/luckygift/v1;luckygifteventsv1"; // EventEnvelope 是 lucky-gift-service 发布 owner outbox 事实的稳定信封。 // occurred_at_ms 固定为抽奖事实创建时的 Unix epoch milliseconds;MQ 实际发送时间不改变业务发生时间。 message EventEnvelope { string event_id = 1; string event_type = 2; string app_code = 3; // draw_id 是本次送礼命令的聚合中奖标识;批量子抽明细仍只保存在 lucky owner 数据库,不能放大 MQ 负载。 string draw_id = 4; int64 occurred_at_ms = 5; bytes body = 6; } // LuckyGiftDrawn 表达钱包返奖已经 granted 的幸运礼物中奖事实。 // lucky-gift-service 必须先完成 wallet-service 入账和本地 granted 收敛,再发布本事件; // room-service 与 activity-service 只从该事实派生房内 IM 和区域飘屏,不能反向改变抽奖或账务状态。 message LuckyGiftDrawn { string draw_id = 1; string command_id = 2; string room_id = 3; string pool_id = 4; string gift_id = 5; int32 gift_count = 6; int64 sender_user_id = 7; int64 target_user_id = 8; // 展示资料是送礼入口固化的快照;消费者不应为了飘屏高频同步反查 user-service。 string sender_name = 9; string sender_avatar = 10; string sender_display_user_id = 11; string sender_pretty_display_user_id = 12; // visible_region_id 是房间可见区域,区域播报不能用客户端 IP 或服务所在地推断。 int64 visible_region_id = 13; int64 country_id = 14; int64 coin_spent = 15; int64 rule_version = 16; string experience_pool = 17; string selected_tier_id = 18; int64 multiplier_ppm = 19; int64 base_reward_coins = 20; int64 effective_reward_coins = 21; bool stage_feedback = 22; bool high_multiplier = 23; // reward_status 在本事件中只能是 granted;保留字段是为了下游 JSON 与现有 Flutter 协议同名映射。 string reward_status = 24; string wallet_transaction_id = 25; // 两个时间均为 UTC Unix epoch milliseconds:抽奖发生时间与钱包返奖确认时间不能混用。 int64 draw_created_at_ms = 26; int64 reward_granted_at_ms = 27; }