syntax = "proto2";

package OneToOneCallResult;

option java_package = "com.miaole.live.protocol.response";
option java_outer_classname = "OneToOneCallResult";

message OneToOneCallInfo {
  optional string callId = 1; // 通话ID
  optional string orderId = 2; // 通话订单ID
  optional string channelId = 3; // RTC频道ID
  optional string callerId = 4; // 发起方用户ID
  optional string calleeId = 5; // 被叫方用户ID
  optional string callType = 6; // 通话类型：VOICE=语音，VIDEO=视讯
  optional string callStatus = 7; // 通话状态：CALLING/WAIT_RTC_ACCEPT/ACCEPTED/REJECTED/CANCELED/TIMEOUT/HANGUP
  optional string payerUserId = 8; // 金币扣费方用户ID
  optional string incomeUserId = 9; // 钻石收益方用户ID
  optional int32 coinPerMinute = 10; // 当前通话类型金币价格
  optional int32 diamondPer15Seconds = 11; // 当前通话类型每15秒钻石收益
  optional int32 durationSeconds = 12; // 当前真实接通秒数
  optional int32 estimatedCoinAmount = 13; // 当前预估金币消耗
  optional int32 estimatedDiamondAmount = 14; // 当前预估钻石收益
  optional int32 inviteTimeoutSeconds = 15; // 邀请超时秒数
  optional int32 rtcAcceptTimeoutSeconds = 16; // RTC接通等待超时秒数
  optional int32 heartbeatIntervalSeconds = 17; // 客户端心跳间隔秒数
  optional int32 heartbeatTimeoutSeconds = 18; // 心跳超时秒数
  optional int64 acceptTime = 19; // 接通时间，毫秒时间戳
  optional int64 endTime = 20; // 结束时间，毫秒时间戳
  optional bool freeCallCardUsed = 21; // 是否已选择并预占免费通话卡（发起成功后即可展示）
  optional int32 freeCallSeconds = 22; // 免费通话覆盖秒数
  optional int32 freeCallDiamondPer15Seconds = 23; // 免费阶段每15秒钻石收益
}

message OneToOneCallStatusBroadcast {
  optional string callId = 1; // 通话ID
  optional string orderId = 2; // 通话订单ID
  optional string channelId = 3; // RTC频道ID
  optional string callType = 4; // 通话类型：VOICE=语音，VIDEO=视讯
  optional string callStatus = 5; // 通话状态：CALLING/WAIT_RTC_ACCEPT/ACCEPTED/REJECTED/CANCELED/TIMEOUT/HANGUP
  optional string callerId = 6; // 发起方用户ID
  optional string calleeId = 7; // 被叫方用户ID
  optional string payerUserId = 8; // 金币扣费方用户ID
  optional string incomeUserId = 9; // 钻石收益方用户ID
  optional int32 durationSeconds = 10; // 真实接通秒数
  optional int32 coinAmount = 11; // 当前已扣金币
  optional int32 diamondAmount = 12; // 当前预估或已结算钻石收益
  optional string endReason = 13; // 结束原因
  optional int64 acceptTime = 14; // 接通时间，毫秒时间戳
  optional int64 endTime = 15; // 结束时间，毫秒时间戳
  optional bool freeCallCardUsed = 16; // 是否选择使用免费通话卡（未接通前即可展示）
  optional int32 freeCallSeconds = 17; // 免费通话覆盖秒数
  optional int32 freeCallDiamondPer15Seconds = 18; // 免费阶段每15秒钻石收益
}

// 1v1通话内文字聊天广播，只有通话双方会收到。
message OneToOneCallChatBroadcast {
  optional string callId = 1; // 通话ID
  optional string senderId = 2; // 发送方用户ID
  optional string receiverId = 3; // 接收方用户ID
  optional string content = 4; // 审核通过后的文字内容
  optional int64 sendTime = 5; // 发送时间，毫秒时间戳
}

message OneToOneCallBillingInfo {
  optional string targetUserId = 1; // 目标用户ID
  optional string callBillingMode = 2; // 当前用户视角：START_CALL=发起通话消耗金币，INVITE_CALL=邀请通话获得钻石
  optional string payerUserId = 3; // 金币扣费方用户ID
  optional string incomeUserId = 4; // 钻石收益方用户ID
  optional int32 voiceCoinPerMinute = 5; // 语音通话每分钟消耗金币数
  optional int32 videoCoinPerMinute = 6; // 视频通话每分钟消耗金币数
  optional int32 voiceDiamondPerNSeconds = 7; // 语音通话每N秒预计获得钻石数
  optional int32 videoDiamondPerNSeconds = 8; // 视频通话每N秒预计获得钻石数
  optional int32 incomeIntervalSeconds = 9; // 收益展示周期N，默认15秒
  optional bool hasFreeCallCard = 10; // 是否有免费通话卡
}
