syntax = "proto2";

package RedPacketResult;

option java_package = "com.miaole.live.protocol.response";
option java_outer_classname = "RedPacketResult";

// 01 可发红包集合
message RedPacketList{
  repeated RedPacket list = 1;                                // 单个红包信息
  repeated TimeItem timeList = 2;                             // 时间选项
  optional string anchor = 3;                                 // 用户所在房间主播名称
  optional string anchorId = 4;                               // 用户所在房间主播id
}

// 单个可发红包
message RedPacket{
  optional string id = 1;                                     // 红包ID
  optional bool sendAll = 2;                                  // 是否发送全服广播
  optional int32 num = 3;                                     // 红包个数
  optional string moral = 4;                                  // 红包寓意
  optional int32 value = 5;                                   // 红包金额
  optional string checked = 6;                                // 默认选择的时间 id
  optional string contentDesc = 7;                            // 红包内 物品描述
}

// 时间选项
message TimeItem{
  optional string id = 1;                                     // 标签ID
  optional string name = 2;                                   // 标签名称
  optional int32 time = 3;                                    // 多少秒内可以抢
}

// 03 房间内红包信息
message RoomRedPacketInfo{
  optional int32 num = 1;                                     // 房间内正在进行中红包个数
  optional string redPacketId = 2;                            // 可抢红包id
  optional int32 endTime = 3;                                 // 当前红包可抢剩余时间单位秒
  optional string redPacketConfigId = 4;                      // 可抢红包配置id
}

// 05 待抢红包信息详情
message RedPacketDetail{
  optional string id = 1;                                     // 唯一ID
  optional string sender = 2;                                 // 发送者昵称
  optional string headUrl = 3;                                // 发送者头像
  optional string anchorId = 4;                               // 主播id
  optional string anchor = 5;                                 // 主播昵称
  optional string anchorHeadUrl = 6;                          // 主播头像
  optional string moral = 7;                                  // 寓意
  optional bool canOpen = 8;                                  // 是否可抢，不可抢则需要关注主播
  optional string redPacketConfigId = 9;                      // 可抢红包配置id
  optional string cpUserId = 10;                               // cp用户id
  optional string cpUserName = 11;                             // cp用户昵称
  optional string cpUserHeadUrl = 12;                          // cp用户头像
  optional string cpAnchorId = 13;                             // cp主播id
  optional string cpAnchorName = 14;                           // cp主播昵称
  optional string cpAnchorHeadUrl = 15;                        // cp主播头像
  optional int32 totalDiamond = 16;                            // 红包总价值
}

// 06 抢红包结果
message OpenRedPacketResult{
  optional bool succeed = 1;                                  // 是否成功抢到红包
  optional string sender = 2;                                 // 发送者昵称
  optional string headUrl = 3;                                // 发送者头像
  optional string giftName = 4;                               // 礼物昵称
  optional string giftId = 5;                                 // 礼物id
  optional int32 giftType = 6;                                // 礼物类型
  optional int32 value = 7;                                   // 砖石总额
  optional string text = 8;                                   // 随机感谢语
  optional string awardUrl = 9;                               // 奖励的图片url 前端优先读这个值, 没有值才根据id和type去换算资源
  optional string senderId = 10;                              // 发送者ID
  optional string redPacketConfigId = 11;                      // 可抢红包配置id
  optional int32 awardNum = 12;                               // 获得数量
}

// 07 抢红包抢完通知结果
message RedPacketNotice{
  optional int32 type = 1;                                    // 结果类型，1=抢完通知，2=时间结束通知
  optional int32 totalNum = 2;                                // 红包总个数
  optional int32 totalValue = 3;                              // 砖石总额
  optional int32 num = 4;                                     // 已抢红包个数
  optional int32 value = 5;                                   // 已抢红包总额
  optional int32 time = 6;                                    // type=1 时 标注 多少分钟被抢完
  optional int32 userNum = 7;                                 // 还有多少为用户领取了奖励
  optional string sender = 8;                                 // 发送者昵称
  optional string headUrl = 9;                                // 发送者头像
  optional string moral = 10;                                 // 寓意
  repeated UserItem userList = 11;                            // 抢红包用户
  optional string redPacketConfigId = 12;                      // 可抢红包配置id
}

// 抢红包用户
message UserItem {
  optional string userId = 1;                                 // 用户ID
  optional string name = 2;                                   // 用户昵称
  optional string headUrl = 3;                                // 用户头像
  optional int32 value = 4;                                   // 砖石总额
  optional string createTime = 5;                             // 抢红包时间
  optional string icon = 6;                                   // 奖励icon
  optional int32 awardNum = 7;                               // 获得数量
}

// 07 抢红包领取通知
message RedPacketDrawNotice{
  optional string userId = 1;                                 // 领取者id
  optional string text = 2;                                   // 提示文案
  optional string headUrl = 3;                                // 领取者头像
}

// 08 发送房间内红包信息全服广播
message RedPacketWoldNotice{
  optional string roomId = 1;                                 // 房间ID
  optional string text = 2;                                   // 提示文案
}

// 07 抢红包抢完通知结果New
message RedPacketNoticeNew{
  optional int32 type = 1;                                    // 结果类型，1=抢完通知，2=时间结束通知
  optional int32 totalNum = 2;                                // 红包总个数
  optional int32 totalValue = 3;                              // 砖石总额
  optional int32 num = 4;                                     // 已抢红包个数
  optional int32 value = 5;                                   // 已抢红包总额
  optional int32 time = 6;                                    // type=1 时 标注 多少分钟被抢完
  optional int32 userNum = 7;                                 // 还有多少为用户领取了奖励
  optional string sender = 8;                                 // 发送者昵称
  optional string headUrl = 9;                                // 发送者头像
  optional string moral = 10;                                 // 寓意
  repeated UserItem userList = 11;                            // 抢红包用户
  optional string redPacketConfigId = 12;                      // 可抢红包配置id
}

// 红包开奖结果-公频广播
message RedPacketPublishBroadcast {
  optional string redPacketId = 1;     // 全局唯一红包ID
  optional string message = 2;    // 公屏消息
  optional string awardedRankH5Url = 3;    // 结果弹窗H5链接
}