更新大量【proto定义】并勘误
This commit is contained in:
30
grpc_api/bilibili/broadcast/message/editor/notify.proto
Normal file
30
grpc_api/bilibili/broadcast/message/editor/notify.proto
Normal file
@@ -0,0 +1,30 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.editor;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
//
|
||||
service OperationNotify {
|
||||
//
|
||||
rpc OperationNotify(google.protobuf.Empty) returns (stream Notify);
|
||||
}
|
||||
|
||||
message Notify {
|
||||
// 消息唯一标示
|
||||
int64 msg_id = 1;
|
||||
// 消息类型
|
||||
int32 msg_type = 2;
|
||||
// 接收方uid
|
||||
int64 receiver_uid = 3;
|
||||
//接收方类型
|
||||
int32 receiver_type = 4;
|
||||
// 故事的版本
|
||||
int64 story_version = 5;
|
||||
// 操作结果的hash值
|
||||
int64 op_hash = 6;
|
||||
// 操作产生用户的uid
|
||||
int64 op_sender = 7;
|
||||
// patch内容
|
||||
string op_content = 8;
|
||||
}
|
||||
8
grpc_api/bilibili/broadcast/message/esports/notify.proto
Normal file
8
grpc_api/bilibili/broadcast/message/esports/notify.proto
Normal file
@@ -0,0 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.esports;
|
||||
|
||||
message Notify {
|
||||
// cid
|
||||
int64 cid = 1;
|
||||
}
|
||||
18
grpc_api/bilibili/broadcast/message/fission/notify.proto
Normal file
18
grpc_api/bilibili/broadcast/message/fission/notify.proto
Normal file
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.fission;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
//
|
||||
service Fission {
|
||||
//
|
||||
rpc GameNotify(google.protobuf.Empty) returns (stream GameNotifyReply);
|
||||
}
|
||||
|
||||
message GameNotifyReply {
|
||||
// 类型字段
|
||||
uint32 type = 1;
|
||||
// 数据字段
|
||||
string data = 2;
|
||||
}
|
||||
99
grpc_api/bilibili/broadcast/message/im/notify.proto
Normal file
99
grpc_api/bilibili/broadcast/message/im/notify.proto
Normal file
@@ -0,0 +1,99 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.im;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
//
|
||||
service Notify {
|
||||
//
|
||||
rpc WatchNotify(google.protobuf.Empty) returns (stream NotifyRsp);
|
||||
}
|
||||
|
||||
//
|
||||
enum PLType {
|
||||
//
|
||||
EN_PAYLOAD_NORMAL = 0;
|
||||
//
|
||||
EN_PAYLOAD_BASE64 = 1;
|
||||
}
|
||||
|
||||
//
|
||||
enum CmdId {
|
||||
// 非法cmd
|
||||
EN_CMD_ID_INVALID = 0;
|
||||
// 服务端主动发起
|
||||
EN_CMD_ID_MSG_NOTIFY = 1;
|
||||
//
|
||||
EN_CMD_ID_KICK_OUT = 2;
|
||||
}
|
||||
|
||||
//
|
||||
message NotifyRsp {
|
||||
//
|
||||
uint64 uid=1;
|
||||
// 命令id
|
||||
uint64 cmd=2;
|
||||
//
|
||||
bytes payload=3;
|
||||
//
|
||||
PLType payload_type=4;
|
||||
}
|
||||
|
||||
//
|
||||
message Msg {
|
||||
// 发送方uid
|
||||
uint64 sender_uid = 1;
|
||||
// 接收方类型
|
||||
int32 receiver_type = 2;
|
||||
// 接收方id
|
||||
uint64 receiver_id = 3;
|
||||
// 客户端的序列id 用于服务端去重
|
||||
uint64 cli_msg_id = 4;
|
||||
// 消息类型
|
||||
int32 msg_type = 5;
|
||||
// 消息内容
|
||||
string content = 6;
|
||||
// 服务端的序列号
|
||||
uint64 msg_seqno = 7;
|
||||
// 消息发送时间(服务端时间)
|
||||
uint64 timestamp = 8;
|
||||
// at用户列表
|
||||
repeated uint64 at_uids = 9;
|
||||
// 多人消息
|
||||
repeated uint64 recver_ids = 10;
|
||||
// 消息唯一标示
|
||||
uint64 msg_key = 11;
|
||||
// 消息状态
|
||||
uint32 msg_status = 12;
|
||||
// 是否为系统撤销
|
||||
bool sys_cancel = 13;
|
||||
// 是否是多聊消息 目前群通知管理员的部分通知属于该类消息
|
||||
uint32 is_multi_chat = 14;
|
||||
// 表示撤回的消息的session_seqno 用以后续的比较 实现未读数的正确显示
|
||||
uint64 withdraw_seqno = 15;
|
||||
// 通知码
|
||||
string notify_code =16;
|
||||
// 消息来源
|
||||
uint32 msg_source = 17;
|
||||
}
|
||||
|
||||
//
|
||||
message NotifyInfo {
|
||||
//
|
||||
uint32 msg_type = 1;
|
||||
//
|
||||
uint64 talker_id = 2;
|
||||
//
|
||||
uint32 session_type =3;
|
||||
}
|
||||
|
||||
//
|
||||
message ReqServerNotify {
|
||||
// 最新序列号
|
||||
uint64 lastest_seqno = 1;
|
||||
// 即时消息 该类消息主要用于系统通知 当客户端sync msg时 不会sync到此类消息
|
||||
Msg instant_msg = 2;
|
||||
//
|
||||
NotifyInfo notify_info = 3;
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.main;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
//
|
||||
service NativePage {
|
||||
//
|
||||
//
|
||||
rpc watchNotify (google.protobuf.Empty) returns (NativePageEvent);
|
||||
}
|
||||
|
||||
//
|
||||
service Resource {
|
||||
//
|
||||
//
|
||||
rpc topActivity (google.protobuf.Empty) returns (TopActivityReply);
|
||||
}
|
||||
//
|
||||
message NativePageEvent {
|
||||
//
|
||||
int64 pageID = 1;
|
||||
|
||||
//
|
||||
repeated EventItem items = 2;
|
||||
}
|
||||
|
||||
//
|
||||
message TopActivityReply {
|
||||
//
|
||||
TopOnline online = 1;
|
||||
|
||||
//
|
||||
string hash = 2;
|
||||
}
|
||||
|
||||
//
|
||||
message Animate {
|
||||
//
|
||||
string icon = 1;
|
||||
|
||||
//
|
||||
string json = 2;
|
||||
|
||||
//
|
||||
string svg = 3;
|
||||
|
||||
//
|
||||
int32 loop = 4;
|
||||
}
|
||||
|
||||
//
|
||||
message CommandDm {
|
||||
//
|
||||
int64 id = 1;
|
||||
|
||||
//
|
||||
int64 oid = 2;
|
||||
|
||||
//
|
||||
int64 mid = 3;
|
||||
|
||||
//
|
||||
int32 type = 4;
|
||||
|
||||
//
|
||||
string command = 5;
|
||||
|
||||
//
|
||||
string content = 6;
|
||||
|
||||
//
|
||||
int32 state = 7;
|
||||
|
||||
//
|
||||
int32 progress = 8;
|
||||
|
||||
//
|
||||
string ctime = 9;
|
||||
|
||||
//
|
||||
string mtime = 10;
|
||||
|
||||
//
|
||||
string extra = 11;
|
||||
|
||||
//
|
||||
string idStr = 12;
|
||||
}
|
||||
|
||||
//
|
||||
message DanmakuElem {
|
||||
//
|
||||
int64 id = 1;
|
||||
|
||||
//
|
||||
int32 progress = 2;
|
||||
|
||||
//
|
||||
int32 mode = 3;
|
||||
|
||||
//
|
||||
int32 fontsize = 4;
|
||||
|
||||
//
|
||||
uint32 color = 5;
|
||||
|
||||
//
|
||||
string midHash = 6;
|
||||
|
||||
//
|
||||
string content = 7;
|
||||
|
||||
//
|
||||
int64 ctime = 8;
|
||||
|
||||
//
|
||||
string action = 9;
|
||||
|
||||
//
|
||||
int32 pool = 10;
|
||||
|
||||
//
|
||||
string idStr = 11;
|
||||
}
|
||||
|
||||
//
|
||||
message DanmukuEvent {
|
||||
//
|
||||
DanmakuElem elems = 1;
|
||||
}
|
||||
|
||||
//
|
||||
message EventItem {
|
||||
//
|
||||
int64 itemID = 1;
|
||||
|
||||
//
|
||||
string type = 2;
|
||||
|
||||
//
|
||||
int64 num = 3;
|
||||
|
||||
//
|
||||
string displayNum = 4;
|
||||
|
||||
//
|
||||
string webKey = 5;
|
||||
|
||||
//
|
||||
int64 dimension = 6;
|
||||
}
|
||||
|
||||
//
|
||||
message RedDot {
|
||||
//
|
||||
int32 type = 1;
|
||||
|
||||
//
|
||||
int32 number = 2;
|
||||
}
|
||||
|
||||
//
|
||||
message TopOnline {
|
||||
//
|
||||
int32 type = 1;
|
||||
|
||||
//
|
||||
string icon = 2;
|
||||
|
||||
//
|
||||
string uri = 3;
|
||||
|
||||
//
|
||||
string uniqueId = 4;
|
||||
|
||||
//
|
||||
Animate animate = 5;
|
||||
|
||||
//
|
||||
RedDot redDot = 6;
|
||||
|
||||
//
|
||||
string name = 7;
|
||||
|
||||
//
|
||||
int64 interval = 8;
|
||||
}
|
||||
63
grpc_api/bilibili/broadcast/message/main/dm.proto
Normal file
63
grpc_api/bilibili/broadcast/message/main/dm.proto
Normal file
@@ -0,0 +1,63 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.main;
|
||||
|
||||
// 实时弹幕事件
|
||||
message DanmukuEvent {
|
||||
// 弹幕列表
|
||||
repeated DanmakuElem elems = 1;
|
||||
}
|
||||
|
||||
// 弹幕条目
|
||||
message DanmakuElem {
|
||||
// 弹幕dmid
|
||||
int64 id = 1;
|
||||
// 弹幕出现位置(单位为ms)
|
||||
int32 progress = 2;
|
||||
// 弹幕类型
|
||||
int32 mode = 3;
|
||||
// 弹幕字号
|
||||
int32 fontsize = 4;
|
||||
// 弹幕颜色
|
||||
uint32 color = 5;
|
||||
// 发送着mid hash
|
||||
string mid_hash = 6;
|
||||
// 弹幕正文
|
||||
string content = 7;
|
||||
// 发送时间
|
||||
int64 ctime = 8;
|
||||
// 弹幕动作
|
||||
string action = 9;
|
||||
// 弹幕池
|
||||
int32 pool = 10;
|
||||
// 弹幕id str
|
||||
string id_str = 11;
|
||||
}
|
||||
|
||||
// 互动弹幕
|
||||
message CommandDm {
|
||||
// 弹幕id
|
||||
int64 id = 1;
|
||||
// 对象视频cid
|
||||
int64 oid = 2;
|
||||
// 发送者mid
|
||||
int64 mid = 3;
|
||||
//
|
||||
int32 type = 4;
|
||||
// 互动弹幕指令
|
||||
string command = 5;
|
||||
// 互动弹幕正文
|
||||
string content = 6;
|
||||
// 弹幕状态
|
||||
int32 state = 7;
|
||||
// 出现时间
|
||||
int32 progress = 8;
|
||||
// 创建时间
|
||||
string ctime = 9;
|
||||
// 发布时间
|
||||
string mtime = 10;
|
||||
// 扩展json数据
|
||||
string extra = 11;
|
||||
// 弹幕id str类型
|
||||
string idStr = 12;
|
||||
}
|
||||
36
grpc_api/bilibili/broadcast/message/main/native.proto
Normal file
36
grpc_api/bilibili/broadcast/message/main/native.proto
Normal file
@@ -0,0 +1,36 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.main;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
//
|
||||
service NativePage {
|
||||
//
|
||||
rpc WatchNotify(google.protobuf.Empty) returns (stream NativePageEvent);
|
||||
}
|
||||
|
||||
//
|
||||
message NativePageEvent {
|
||||
// Native页ID
|
||||
int64 PageID = 1;
|
||||
//
|
||||
repeated EventItem Items = 2;
|
||||
}
|
||||
|
||||
//
|
||||
message EventItem {
|
||||
// 组件标识
|
||||
int64 ItemID = 1;
|
||||
// 组件类型
|
||||
string Type = 2;
|
||||
// 进度条数值
|
||||
int64 Num = 3;
|
||||
// 进度条展示数值
|
||||
string DisplayNum = 4;
|
||||
// h5的组件标识
|
||||
string WebKey = 5;
|
||||
// 活动统计维度
|
||||
// 0:用户维度 1:规则维度
|
||||
int64 dimension = 6;
|
||||
}
|
||||
61
grpc_api/bilibili/broadcast/message/main/resource.proto
Normal file
61
grpc_api/bilibili/broadcast/message/main/resource.proto
Normal file
@@ -0,0 +1,61 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.main;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
//
|
||||
service Resource {
|
||||
//
|
||||
rpc TopActivity(google.protobuf.Empty) returns (stream TopActivityReply);
|
||||
}
|
||||
|
||||
//
|
||||
message TopActivityReply {
|
||||
// 当前生效的资源
|
||||
TopOnline online = 1;
|
||||
// 对online内容进行hash和上次结果一样则不重新加载
|
||||
string hash = 2;
|
||||
}
|
||||
|
||||
// 当前生效的资源
|
||||
message TopOnline {
|
||||
// 活动类型
|
||||
// 1:七日活动 2:后台配置
|
||||
int32 type = 1;
|
||||
// 图标
|
||||
string icon = 2;
|
||||
// 跳转链接
|
||||
string uri = 3;
|
||||
// 资源状态标识(后台配置)
|
||||
string unique_id = 4;
|
||||
// 动画资源
|
||||
Animate animate = 5;
|
||||
// 红点
|
||||
RedDot red_dot = 6;
|
||||
// 活动名称
|
||||
string name = 7;
|
||||
// 轮询间隔 单位秒
|
||||
int64 interval = 8;
|
||||
}
|
||||
|
||||
// 动画资源
|
||||
message Animate {
|
||||
// 动效结束展示icon
|
||||
string icon = 1;
|
||||
// 7日活动动画
|
||||
string json = 2;
|
||||
// s10活动svg动画
|
||||
string svg = 3;
|
||||
// 循环次数(默认0不返回 表示无限循环)
|
||||
int32 loop = 4;
|
||||
}
|
||||
|
||||
// 红点
|
||||
message RedDot {
|
||||
// 红点类型
|
||||
// 1:纯红点 2:数字红点
|
||||
int32 type = 1;
|
||||
// 如果是数字红点 显示的数字
|
||||
int32 number = 2;
|
||||
}
|
||||
11
grpc_api/bilibili/broadcast/message/note/sync.proto
Normal file
11
grpc_api/bilibili/broadcast/message/note/sync.proto
Normal file
@@ -0,0 +1,11 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.note;
|
||||
|
||||
//
|
||||
message Sync {
|
||||
// 笔记id
|
||||
int64 note_id = 1;
|
||||
// 唯一标示
|
||||
string hash = 2;
|
||||
}
|
||||
228
grpc_api/bilibili/broadcast/message/ogv/freya.proto
Normal file
228
grpc_api/bilibili/broadcast/message/ogv/freya.proto
Normal file
@@ -0,0 +1,228 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.ogv;
|
||||
|
||||
// 播放状态
|
||||
enum PlayStatus {
|
||||
// 暂停
|
||||
Pause = 0;
|
||||
// 播放
|
||||
Play = 1;
|
||||
// 终止
|
||||
End = 2;
|
||||
}
|
||||
|
||||
// 房间类型
|
||||
enum RoomType {
|
||||
// 私密
|
||||
Private = 0;
|
||||
// 公开
|
||||
Open = 1;
|
||||
}
|
||||
|
||||
// 信息通知发送领域
|
||||
enum MessageDomain {
|
||||
// 默认
|
||||
DefaultDomain = 0;
|
||||
// 房间用户
|
||||
RoomMid = 1;
|
||||
// 系统通知
|
||||
SystemInfo = 2;
|
||||
}
|
||||
|
||||
// 通知信息类型
|
||||
enum MessageType {
|
||||
// 默认
|
||||
DefaultType = 0;
|
||||
// 房间用户
|
||||
ChatMessage = 1;
|
||||
// 系统通知
|
||||
SystemMessage = 2;
|
||||
}
|
||||
|
||||
// 触发通知类型
|
||||
enum TriggerType {
|
||||
// 默认
|
||||
DefaultTrigger = 0;
|
||||
// 关注、取消关注
|
||||
Relation = 1;
|
||||
}
|
||||
|
||||
// 房间人员变更事件
|
||||
message RoomMemberChangeEvent {
|
||||
// 房间id
|
||||
int64 room_id = 1;
|
||||
// 房主id
|
||||
int64 owner_id = 2;
|
||||
// 房间成员列表
|
||||
repeated UserInfoProto members = 3;
|
||||
// 提示信息
|
||||
MessageProto message = 4;
|
||||
}
|
||||
|
||||
// 播放进度同步事件
|
||||
message ProgressSyncEvent {
|
||||
// 房间id
|
||||
int64 room_id = 1;
|
||||
// 播放中的season_id
|
||||
int64 season_id = 2;
|
||||
// 播放中的episode_id
|
||||
int64 episode_id = 3;
|
||||
// 播放状态
|
||||
PlayStatus status = 4;
|
||||
// 房主播放进度
|
||||
int64 progress = 5;
|
||||
// 提示信息
|
||||
MessageProto message = 6;
|
||||
}
|
||||
|
||||
// 房间状态更新
|
||||
message RoomUpdateEvent {
|
||||
// 房间id
|
||||
int64 room_id = 1;
|
||||
// 房间变更状态
|
||||
RoomType type = 2;
|
||||
// 提示信息
|
||||
MessageProto message = 3;
|
||||
}
|
||||
|
||||
// 房间销毁通知
|
||||
message RoomDestroyEvent {
|
||||
// 房间id
|
||||
int64 room_id = 1;
|
||||
// 提示信息
|
||||
MessageProto message = 4;
|
||||
}
|
||||
|
||||
// 房间触发通知
|
||||
message RoomTriggerEvent {
|
||||
// 操作人
|
||||
int64 mid = 1;
|
||||
// 提示信息
|
||||
MessageProto message = 2;
|
||||
// 触发类型
|
||||
TriggerType trigger = 3;
|
||||
}
|
||||
|
||||
//用户信息
|
||||
message UserInfoProto {
|
||||
// 用户id
|
||||
int64 mid = 1;
|
||||
// 用户头像url
|
||||
string face = 2;
|
||||
// 昵称
|
||||
string nickname = 3;
|
||||
// 等级
|
||||
int32 level = 4;
|
||||
// 签名
|
||||
string sign = 5;
|
||||
// 大会员信息
|
||||
VipProto vip = 6;
|
||||
// 身份认证信息
|
||||
OfficialProto official = 7;
|
||||
// 挂件信息
|
||||
PendantProto pendant = 8;
|
||||
// 设备buvid
|
||||
string buvid = 9;
|
||||
}
|
||||
|
||||
//通知信息
|
||||
message MessageProto {
|
||||
// 可带占位符匹配的消息体 ep "还没有其他小伙伴,[去邀请>]<https://big.bilibili.com/mobile/giftIndex?mid=123>"
|
||||
string content = 1;
|
||||
// 消息体类型
|
||||
// 0:json格式的文本消息 1:支持全文本可点(破冰)
|
||||
int32 content_type = 2;
|
||||
}
|
||||
|
||||
//大会员信息
|
||||
message VipProto {
|
||||
int32 type = 1;
|
||||
int32 status = 2;
|
||||
int64 due_date = 3;
|
||||
int32 vip_pay_type = 4;
|
||||
int32 theme_type = 5;
|
||||
// 大会员角标
|
||||
// 0:无角标 1:粉色大会员角标 2:绿色小会员角标
|
||||
int32 avatar_subscript = 6;
|
||||
// 昵称色值,可能为空,色值示例:#FFFB9E60
|
||||
string nickname_color = 7;
|
||||
}
|
||||
|
||||
//认证信息
|
||||
message OfficialProto {
|
||||
int32 role = 1;
|
||||
string title = 2;
|
||||
string desc = 3;
|
||||
int32 type = 4;
|
||||
}
|
||||
|
||||
//挂件信息
|
||||
message PendantProto {
|
||||
int32 pid = 1;
|
||||
string name = 2;
|
||||
string image = 3;
|
||||
int64 expire = 4;
|
||||
string image_enhance = 5;
|
||||
}
|
||||
|
||||
// 通用信息通知
|
||||
message MessageEvent {
|
||||
// 房间id
|
||||
int64 room_id = 1;
|
||||
// 消息id
|
||||
int64 msg_id = 2;
|
||||
// 消息发送服务端时间 时间戳 单位秒
|
||||
int64 ts = 3;
|
||||
// 信息通知发送主体id
|
||||
int64 oid = 4;
|
||||
// 信息通知发送领域
|
||||
MessageDomain domain = 5;
|
||||
// 通知信息类型
|
||||
MessageType type = 6;
|
||||
// 提示信息
|
||||
MessageProto message = 7;
|
||||
// 消息发送用户信息
|
||||
UserInfoProto user = 8;
|
||||
// 消息id str类型
|
||||
string msg_id2 = 9;
|
||||
}
|
||||
|
||||
// 聊天信息清除通知
|
||||
message RemoveChatEvent {
|
||||
// 房间id
|
||||
int64 room_id = 1;
|
||||
// 撤回的聊天信息id
|
||||
int64 msg_id = 2;
|
||||
// 提示信息
|
||||
MessageProto message = 3;
|
||||
}
|
||||
|
||||
// "一起看"房间事件
|
||||
message FreyaEventBody {
|
||||
// 房间id
|
||||
int64 room_id = 1;
|
||||
// 接收事件消息的白名单用户
|
||||
repeated int64 white_mid = 2;
|
||||
// 不处理信息的黑名单用户 优先级低于白名单 当白名单有数据时 忽略黑名单
|
||||
repeated int64 ignore_mid = 3;
|
||||
//命令类型
|
||||
oneof event {
|
||||
// 房间人员变更事件
|
||||
RoomMemberChangeEvent member_change = 4;
|
||||
// 播放进度同步事件
|
||||
ProgressSyncEvent progress = 5;
|
||||
// 房间状态更新
|
||||
RoomUpdateEvent room_update = 6;
|
||||
// 通用信息通知
|
||||
MessageEvent message = 7;
|
||||
// 聊天信息清除通知
|
||||
RemoveChatEvent remove_chat = 8;
|
||||
// 房间销毁通知
|
||||
RoomDestroyEvent room_destroy = 9;
|
||||
// 房间触发通知
|
||||
RoomTriggerEvent room_trigger = 10;
|
||||
}
|
||||
// 消息序列号
|
||||
int64 sequence_id = 100;
|
||||
}
|
||||
44
grpc_api/bilibili/broadcast/message/ogv/live.proto
Normal file
44
grpc_api/bilibili/broadcast/message/ogv/live.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.ogv;
|
||||
|
||||
// 开播事件
|
||||
message LiveStartEvent {}
|
||||
|
||||
// 直播中止事件
|
||||
message LiveEndEvent {}
|
||||
|
||||
// 在线人数事件
|
||||
message LiveOnlineEvent {
|
||||
//在线人数
|
||||
int64 online = 1;
|
||||
}
|
||||
|
||||
// 变更通知
|
||||
message LiveUpdateEvent {
|
||||
// 直播后状态
|
||||
// 1:下线 2:转点播
|
||||
int32 after_premiere_type = 1;
|
||||
// 直播开始绝对时间 单位ms
|
||||
int64 start_time = 2;
|
||||
// id
|
||||
string id = 3;
|
||||
// 服务端播放进度,未打散,负数表示距离开播时间,正数表示已开播时间,单位:毫秒
|
||||
// 用户实际播放进度:progress - delay_time
|
||||
int64 progress = 4;
|
||||
}
|
||||
|
||||
// 直播间事件
|
||||
message CMDBody {
|
||||
//命令类型
|
||||
oneof event {
|
||||
// 开播事件
|
||||
LiveStartEvent start = 1;
|
||||
// 直播中止事件
|
||||
LiveEndEvent emergency = 2;
|
||||
// 在线人数事件
|
||||
LiveOnlineEvent online = 3;
|
||||
// 变更通知
|
||||
LiveUpdateEvent update = 4;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.ticket;
|
||||
|
||||
//
|
||||
enum RoomStatus {
|
||||
// 暂停:
|
||||
Pause = 0;
|
||||
// 播放:
|
||||
Play = 1;
|
||||
// 终止:
|
||||
End = 2;
|
||||
}
|
||||
|
||||
// 推送选项
|
||||
message RoomEvent {
|
||||
// RoomStatus 类型
|
||||
RoomStatus room_status = 1;
|
||||
//
|
||||
string room_message = 2;
|
||||
}
|
||||
77
grpc_api/bilibili/broadcast/message/tv/proj.proto
Normal file
77
grpc_api/bilibili/broadcast/message/tv/proj.proto
Normal file
@@ -0,0 +1,77 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.message.tv;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
//
|
||||
service Tv {
|
||||
// 投屏
|
||||
rpc Proj(google.protobuf.Empty) returns (stream ProjReply);
|
||||
// 直播状态
|
||||
rpc LiveStatus(google.protobuf.Empty) returns (stream LiveStatusNotify);
|
||||
// 赛事比分通知
|
||||
rpc Esports(google.protobuf.Empty) returns (stream EsportsNotify);
|
||||
// 直播插卡
|
||||
rpc Publicity(google.protobuf.Empty) returns (stream PublicityNotify);
|
||||
// 直转点
|
||||
rpc LiveSkip(google.protobuf.Empty) returns (stream LiveSkipNotify);
|
||||
}
|
||||
|
||||
// 投屏
|
||||
message ProjReply {
|
||||
// 投屏命令
|
||||
// 1:起播 2:快进 3:快退 4:seek播放进度 5:暂停 6:暂停恢复
|
||||
int64 cmd_type = 1;
|
||||
// 用户id
|
||||
int64 mid = 2;
|
||||
// 稿件id
|
||||
int64 aid = 3;
|
||||
// 视频id
|
||||
int64 cid = 4;
|
||||
// 视频类型
|
||||
// 0:ugc 1:pgc 2:pugv
|
||||
int64 video_type = 5;
|
||||
// 单集id,pgc和pugv需要传
|
||||
int64 ep_id = 6;
|
||||
// 剧集id
|
||||
int64 season_id = 7;
|
||||
// seek 的位置,cmd位seek时有值,单位秒
|
||||
int64 seek_ts = 8;
|
||||
// 其他指令对应内容
|
||||
string extra = 9;
|
||||
}
|
||||
|
||||
// 直播状态
|
||||
message LiveStatusNotify {
|
||||
// 直播状态
|
||||
// 1:开播 2:关播 3:截流 4:截流恢复
|
||||
int64 status = 1;
|
||||
// 文案
|
||||
string msg = 2;
|
||||
// 直播房间号
|
||||
int64 cid = 3;
|
||||
}
|
||||
|
||||
//
|
||||
message EsportsNotify {
|
||||
// 直播房间号
|
||||
int64 cid = 1;
|
||||
}
|
||||
|
||||
// 直播插卡
|
||||
message PublicityNotify {
|
||||
// 插卡id
|
||||
int64 publicity_id = 1;
|
||||
// 直播房间号
|
||||
int64 room_id = 2;
|
||||
// 直播间状态
|
||||
// 0:未开播 1:直播中 2:轮播中
|
||||
int64 status = 3;
|
||||
}
|
||||
|
||||
// 直转点
|
||||
message LiveSkipNotify {
|
||||
// 直播id
|
||||
int64 live_id = 1;
|
||||
}
|
||||
96
grpc_api/bilibili/broadcast/v1/broadcast.proto
Normal file
96
grpc_api/bilibili/broadcast/v1/broadcast.proto
Normal file
@@ -0,0 +1,96 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.v1;
|
||||
|
||||
import "bilibili/rpc/status.proto";
|
||||
import "google/protobuf/any.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
// broadcast操作,对应每个target_path
|
||||
service Broadcast {
|
||||
// 用户鉴权
|
||||
rpc Auth(AuthReq) returns (AuthResp);
|
||||
// 心跳保活:成功心跳为4分45秒,重试心跳为30s,三次收不到进行重连(不超过5分45)
|
||||
rpc Heartbeat(HeartbeatReq) returns (HeartbeatResp);
|
||||
// 订阅target_path
|
||||
rpc Subscribe(TargetPath) returns (google.protobuf.Empty);
|
||||
// 取消订阅target_path
|
||||
rpc Unsubscribe(TargetPath) returns (google.protobuf.Empty);
|
||||
// 消息回执
|
||||
rpc MessageAck(MessageAckReq) returns (google.protobuf.Empty);
|
||||
}
|
||||
|
||||
// broadcast连接隧道
|
||||
service BroadcastTunnel {
|
||||
// 创建双向stream连接隧道
|
||||
rpc CreateTunnel(stream BroadcastFrame) returns (stream BroadcastFrame);
|
||||
}
|
||||
|
||||
// 鉴权请求,通过authorization验证绑定用户mid
|
||||
message AuthReq {
|
||||
// 冷启动id,算法uuid,重新起启会变
|
||||
string guid = 1;
|
||||
// 连接id,算法uuid,重连会变
|
||||
string conn_id = 2;
|
||||
// 最后收到的消息id,用于过虑重连后获取未读的消息
|
||||
int64 last_msg_id = 3;
|
||||
}
|
||||
// 鉴权返回
|
||||
message AuthResp {}
|
||||
|
||||
// 心跳请求
|
||||
message HeartbeatReq{}
|
||||
// 心跳返回
|
||||
message HeartbeatResp{}
|
||||
|
||||
// target_path
|
||||
message TargetPath {
|
||||
// 需要订阅的target_paths
|
||||
repeated string target_paths = 1;
|
||||
}
|
||||
|
||||
// 消息回执
|
||||
message MessageAckReq {
|
||||
// 消息id
|
||||
int64 ack_id = 1;
|
||||
// ack来源,由业务指定用于埋点跟踪
|
||||
string ack_origin = 2;
|
||||
// 消息对应的target_path,方便业务区分和监控统计
|
||||
string target_path = 3;
|
||||
}
|
||||
|
||||
// message_id:
|
||||
// client: 本次连接唯一的消息id,可用于回执
|
||||
// server: 唯一消息id,可用于上报或者回执
|
||||
// sequence:
|
||||
// client: 客户端应该每次请求时frame seq++,会返回对应的对称req/resp
|
||||
// server: 服务端下行消息,只会返回默认值:0
|
||||
message FrameOption {
|
||||
// 消息id
|
||||
int64 message_id = 1;
|
||||
// frame序号
|
||||
int64 sequence = 2;
|
||||
// 是否进行消息回执(发出MessageAckReq)
|
||||
// downstream 上只有服务端设置为true,客户端响应
|
||||
// upstream 上只有客户端设置为true,服务端响应
|
||||
// 响应帧禁止设置is_ack,协议上禁止循环
|
||||
// 通常只有业务帧才可能设置is_ack, 因为协议栈(例如心跳、鉴权)另有响应约定
|
||||
bool is_ack = 3;
|
||||
// 业务状态码
|
||||
bilibili.rpc.Status status = 4;
|
||||
// 业务ack来源, 仅downstream时候由服务端填写.
|
||||
string ack_origin = 5;
|
||||
}
|
||||
|
||||
// target_path:
|
||||
// "/" Service-Name "/" {method name} 参考 gRPC Request Path
|
||||
message BroadcastFrame {
|
||||
// 请求消息信息
|
||||
FrameOption options = 1;
|
||||
// 业务target_path
|
||||
string target_path = 2;
|
||||
// 业务pb内容
|
||||
google.protobuf.Any body = 3;
|
||||
}
|
||||
|
||||
|
||||
19
grpc_api/bilibili/broadcast/v1/laser.proto
Normal file
19
grpc_api/bilibili/broadcast/v1/laser.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.v1;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
// Laser
|
||||
service Laser {
|
||||
// 监听上报事件
|
||||
rpc WatchLogUploadEvent(google.protobuf.Empty) returns (stream LaserLogUploadResp);
|
||||
}
|
||||
|
||||
// 服务端下发日志上报事件
|
||||
message LaserLogUploadResp {
|
||||
// 任务id
|
||||
int64 taskid = 1;
|
||||
// 下发时间
|
||||
string date = 2;
|
||||
}
|
||||
13
grpc_api/bilibili/broadcast/v1/mod.proto
Normal file
13
grpc_api/bilibili/broadcast/v1/mod.proto
Normal file
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.v1;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
message ModResourceResp {}
|
||||
|
||||
// ModManager
|
||||
service ModManager {
|
||||
//
|
||||
rpc WatchResource(google.protobuf.Empty) returns (stream ModResourceResp);
|
||||
}
|
||||
126
grpc_api/bilibili/broadcast/v1/push.proto
Normal file
126
grpc_api/bilibili/broadcast/v1/push.proto
Normal file
@@ -0,0 +1,126 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.v1;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
// Push
|
||||
service Push {
|
||||
rpc WatchMessage(google.protobuf.Empty) returns (stream PushMessageResp);
|
||||
}
|
||||
|
||||
//
|
||||
message PushMessageResp {
|
||||
// 业务类型
|
||||
enum Biz {
|
||||
// 未知
|
||||
BIZ_UNKNOWN = 0;
|
||||
// 视频
|
||||
BIZ_VIDEO = 1;
|
||||
// 直播
|
||||
BIZ_LIVE = 2;
|
||||
// 活动
|
||||
BIZ_ACTIVITY = 3;
|
||||
}
|
||||
// 消息类型
|
||||
enum Type {
|
||||
// 未知
|
||||
TYPE_UNKNOWN = 0;
|
||||
// 默认
|
||||
TYPE_DEFAULT = 1;
|
||||
// 热门
|
||||
TYPE_HOT = 2;
|
||||
// 实时
|
||||
TYPE_REALTIME = 3;
|
||||
// 推荐
|
||||
TYPE_RECOMMEND = 4;
|
||||
}
|
||||
// 展示未知
|
||||
enum Position {
|
||||
// 未知
|
||||
POS_UNKNOWN = 0;
|
||||
// 顶部
|
||||
POS_TOP = 1;
|
||||
}
|
||||
// Deprecated: 推送任务id,使用string
|
||||
int64 old_taskid = 1;
|
||||
// 业务
|
||||
// 1:是视频 2:是直播 3:是活动
|
||||
Biz biz = 2;
|
||||
// 类型
|
||||
// 1:是默认 2:是热门 3:是实时 4:是推荐
|
||||
Type type = 3;
|
||||
// 主标题
|
||||
string title = 4;
|
||||
// 副标题
|
||||
string summary = 5;
|
||||
// 图片地址
|
||||
string img = 6;
|
||||
// 跳转地址
|
||||
string link = 7;
|
||||
// 展示位置,1是顶部
|
||||
Position position = 8;
|
||||
// 展示时长(单位:秒),默认3秒
|
||||
int32 duration = 9;
|
||||
// 失效时间
|
||||
int64 expire = 10;
|
||||
// 推送任务id
|
||||
string taskid = 11;
|
||||
// 应用内推送黑名单
|
||||
// UGC: ugc-video-detail
|
||||
// PGC: pgc-video-detail
|
||||
// 一起看: pgc-video-detail-theater
|
||||
// 直播: live-room-detail
|
||||
// Story: ugc-video-detail-vertical
|
||||
// 播单黑名单 playlist-video-detail
|
||||
repeated PageBlackList page_blackList = 12;
|
||||
// 预留pvid
|
||||
repeated PageView page_view = 13;
|
||||
// 跳转资源
|
||||
TargetResource target_resource = 14;
|
||||
}
|
||||
|
||||
//
|
||||
message PageBlackList {
|
||||
//
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
//
|
||||
message PageView {
|
||||
//
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
//
|
||||
enum LinkType {
|
||||
// 未知
|
||||
LINK_TYPE_UNKNOWN = 0;
|
||||
// 番剧
|
||||
LINK_TYPE_BANGUMI = 1;
|
||||
// 视频
|
||||
LINK_TYPE_VIDEO = 2;
|
||||
// 直播
|
||||
LINK_TYPE_LIVE = 3;
|
||||
}
|
||||
|
||||
//
|
||||
message TargetResource {
|
||||
//直播: roomid
|
||||
//UGC: avid
|
||||
//PGC: seasonid
|
||||
//Story: avid
|
||||
//举个例子
|
||||
//Type: LINK_TYPE_BANGUMI (番剧)
|
||||
//Resource: {"seasonid":"123"}
|
||||
//
|
||||
//Type: LINK_TYPE_VIDEO (视频)
|
||||
//Resource: {"avid":"123"}
|
||||
//
|
||||
//Type: LINK_TYPE_LIVE (直播)
|
||||
//Resource: {"roomid":"123"}
|
||||
//
|
||||
LinkType Type = 1;
|
||||
//
|
||||
map<string,string> Resource = 2;
|
||||
}
|
||||
72
grpc_api/bilibili/broadcast/v1/room.proto
Normal file
72
grpc_api/bilibili/broadcast/v1/room.proto
Normal file
@@ -0,0 +1,72 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.v1;
|
||||
|
||||
import "bilibili/rpc/status.proto";
|
||||
import "google/protobuf/any.proto";
|
||||
|
||||
//
|
||||
service BroadcastRoom {
|
||||
//
|
||||
rpc Enter(stream RoomReq) returns (stream RoomResp);
|
||||
}
|
||||
|
||||
//
|
||||
message RoomJoinEvent {}
|
||||
|
||||
//
|
||||
message RoomLeaveEvent {}
|
||||
|
||||
//
|
||||
message RoomOnlineEvent {
|
||||
//
|
||||
int32 online = 1;
|
||||
}
|
||||
|
||||
//
|
||||
message RoomMessageEvent {
|
||||
//
|
||||
string target_path = 1;
|
||||
//
|
||||
google.protobuf.Any body = 2;
|
||||
}
|
||||
|
||||
//
|
||||
message RoomErrorEvent {
|
||||
//
|
||||
bilibili.rpc.Status status = 1;
|
||||
}
|
||||
|
||||
//
|
||||
message RoomReq {
|
||||
// {type}://{room_id}
|
||||
string id = 1;
|
||||
oneof event {
|
||||
//
|
||||
RoomJoinEvent join = 2;
|
||||
//
|
||||
RoomLeaveEvent leave = 3;
|
||||
//
|
||||
RoomOnlineEvent online = 4;
|
||||
//
|
||||
RoomMessageEvent msg = 5;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
message RoomResp {
|
||||
// {type}://{room_id}
|
||||
string id = 1;
|
||||
oneof event {
|
||||
//
|
||||
RoomJoinEvent join = 2;
|
||||
//
|
||||
RoomLeaveEvent leave = 3;
|
||||
//
|
||||
RoomOnlineEvent online = 4;
|
||||
//
|
||||
RoomMessageEvent msg = 5;
|
||||
//
|
||||
RoomErrorEvent err = 6;
|
||||
}
|
||||
}
|
||||
26
grpc_api/bilibili/broadcast/v1/test.proto
Normal file
26
grpc_api/bilibili/broadcast/v1/test.proto
Normal file
@@ -0,0 +1,26 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.v1;
|
||||
|
||||
import "google/protobuf/any.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
// 服务端下发的测试专用消息,客户端debug/release包都会通过弹窗响应该消息
|
||||
// 后端平台 必须 限制该消息只能针对单个用户发送
|
||||
|
||||
// Test
|
||||
service Test {
|
||||
// 监听上报事件
|
||||
rpc WatchTestEvent(google.protobuf.Empty) returns (stream TestResp);
|
||||
}
|
||||
|
||||
message TestResp {
|
||||
// 任务id
|
||||
int64 taskid = 1 [json_name="taskid"];
|
||||
// 时间戳
|
||||
int64 timestamp = 2 [json_name="timestamp"];
|
||||
// 消息
|
||||
string message = 3 [json_name="message"];
|
||||
// 扩展
|
||||
google.protobuf.Any extra = 4;
|
||||
}
|
||||
21
grpc_api/bilibili/broadcast/v2/laser.proto
Normal file
21
grpc_api/bilibili/broadcast/v2/laser.proto
Normal file
@@ -0,0 +1,21 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.broadcast.v2;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
// Laser
|
||||
service Laser {
|
||||
// 监听Laser事件
|
||||
rpc WatchEvent(google.protobuf.Empty) returns (stream LaserEventResp);
|
||||
}
|
||||
|
||||
// 服务端下发Laser事件
|
||||
message LaserEventResp {
|
||||
// 任务id
|
||||
int64 taskid = 1;
|
||||
// 指令名
|
||||
string action = 2;
|
||||
// 指令参数json字符串
|
||||
string params = 3;
|
||||
}
|
||||
Reference in New Issue
Block a user