From 990bb68919e68595e45eb071529292a569e4e417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E6=98=93=E5=A7=90QwQ?= <45892418+SocialSisterYi@users.noreply.github.com> Date: Sat, 17 Sep 2022 23:53:09 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E3=80=90gRPC=20API=E3=80=91=20proto?= =?UTF-8?q?=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bilibili/community/service/dm/v1/dm.proto | 214 ++++++++++++++---- .../main/community/reply/v1/reply.proto | 102 +++++---- 2 files changed, 225 insertions(+), 91 deletions(-) diff --git a/grpc_api/bilibili/community/service/dm/v1/dm.proto b/grpc_api/bilibili/community/service/dm/v1/dm.proto index 533353a..9673a01 100644 --- a/grpc_api/bilibili/community/service/dm/v1/dm.proto +++ b/grpc_api/bilibili/community/service/dm/v1/dm.proto @@ -7,7 +7,7 @@ service DM { // 获取分段弹幕 rpc DmSegMobile (DmSegMobileReq) returns (DmSegMobileReply); // 客户端弹幕元数据 字幕、分段、防挡蒙版等 - rpc DmView (DmViewReq) returns (DmViewReply); + rpc DmView(DmViewReq) returns (DmViewReply); // 修改弹幕配置 rpc DmPlayerConfig (DmPlayerConfigReq) returns (Response); // ott弹幕列表 @@ -15,7 +15,7 @@ service DM { // SDK弹幕列表 rpc DmSegSDK(DmSegSDKReq) returns(DmSegSDKReply); // - rpc DmExpoReport (DmExpoReportReq) returns (DmExpoReportRes); + rpc DmExpoReport(DmExpoReportReq) returns (DmExpoReportRes); } // @@ -42,6 +42,27 @@ message Bubble { string url = 2; } +// +enum BubbleType { + BubbleTypeNone = 0; // + BubbleTypeClickButton = 1; // + BubbleTypeDmSettingPanel = 2; // +} + +// +message BubbleV2 { + // + string text = 1; + // + string url = 2; + // + BubbleType bubble_type = 3; + // + bool exposure_once = 4; + // + ExposureType exposure_type = 5; +} + // message Button { // @@ -91,6 +112,16 @@ enum CheckboxType { CheckboxTypeColorDM = 2; // } +// +message CheckBoxV2 { + // + string text = 1; + // + int32 type = 2; + // + bool default_value = 3; +} + // message ClickButton { // @@ -109,6 +140,26 @@ message ClickButton { Bubble bubble = 7; } +// +message ClickButtonV2 { + // + repeated string portrait_text = 1; + // + repeated string landscape_text = 2; + // + repeated string portrait_text_focus = 3; + // + repeated string landscape_text_focus = 4; + // + int32 render_type = 5; + // + bool text_input_post = 6; + // + bool exposure_once = 7; + // + int32 exposure_type = 8; +} + // 互动弹幕条目信息 message CommandDm { // 弹幕id @@ -145,7 +196,7 @@ message DanmakuElem { int64 id = 1; // 弹幕出现位置(单位ms) int32 progress = 2; - // 弹幕类型 + // 弹幕类型 1 2 3:普通弹幕 4:底部弹幕 5:顶部弹幕 6:逆向弹幕 7:高级弹幕 8:代码弹幕 9:BAS弹幕(pool必须为2) int32 mode = 3; // 弹幕字号 int32 fontsize = 4; @@ -157,11 +208,11 @@ message DanmakuElem { string content = 7; // 发送时间 int64 ctime = 8; - // 权重 区间:[1,10] + // 权重 用于屏蔽等级 区间:[1,10] int32 weight = 9; // 动作 string action = 10; - // 弹幕池 + // 弹幕池 0:普通池 1:字幕池 2:特殊池(代码/BAS弹幕) int32 pool = 11; // 弹幕dmid str string idStr = 12; @@ -237,6 +288,12 @@ message DanmuPlayerConfig { map player_danmaku_ai_recommended_level_v2_map = 22; // } +// +message DanmuPlayerConfigPanel { + // + string selection_text = 1; +} + // 弹幕显示区域自动配置 message DanmuPlayerDynamicConfig { // 时间 @@ -253,6 +310,8 @@ message DanmuPlayerViewConfig { DanmuPlayerConfig danmuku_player_config = 2; // 弹幕显示区域自动配置列表 repeated DanmuPlayerDynamicConfig danmuku_player_dynamic_config = 3; + // + DanmuPlayerConfigPanel danmuku_player_config_panel = 4; } // web端用户弹幕配置 @@ -300,9 +359,7 @@ message DmExpoReportReq { } // -message DmExpoReportRes { - -} +message DmExpoReportRes {} // 修改弹幕配置-请求 message DmPlayerConfigReq { @@ -453,6 +510,8 @@ message DmViewReply { repeated PostPanel post_panel = 17; // repeated string activity_meta = 18; + // + repeated PostPanelV2 post_panel2 = 19; } // 客户端弹幕元数据-请求 @@ -471,6 +530,7 @@ message DmViewReq { } // web端弹幕元数据-响应 +// https://api.bilibili.com/x/v2/dm/web/view message DmWebViewReply { // 是否已关闭弹幕 // 0:未关闭 1:已关闭 @@ -509,6 +569,12 @@ message ExpoReport { bool should_report_at_end = 1; } +// +enum ExposureType { + ExposureTypeNone = 0; // + ExposureTypeDMSend = 1; // +} + // message Expression { // @@ -525,6 +591,12 @@ message Expressions { repeated Expression data = 1; } +// 是否开启弹幕 +message InlinePlayerDanmakuSwitch { + // + bool value = 1; +} + // message Label { // @@ -533,6 +605,18 @@ message Label { repeated string content = 2; } +// +message LabelV2 { + // + string title = 1; + // + repeated string content = 2; + // + bool exposure_once = 3; + // + int32 exposure_type = 4; +} + // message Period { // @@ -541,44 +625,24 @@ message Period { int64 end = 2; } -// 是否开启弹幕 -message InlinePlayerDanmakuSwitch {bool value = 1;} -// 智能云屏蔽等级 -message PlayerDanmakuAiRecommendedLevel {bool value = 1;} -// -message PlayerDanmakuAiRecommendedLevelV2 {int32 value = 1;} -// 是否开启智能云屏蔽 -message PlayerDanmakuAiRecommendedSwitch {bool value = 1;} -// 是否屏蔽底端弹幕 -message PlayerDanmakuBlockbottom {bool value = 1;} -// 是否屏蔽彩色弹幕 -message PlayerDanmakuBlockcolorful {bool value = 1;} -// 是否屏蔽重复弹幕 -message PlayerDanmakuBlockrepeat {bool value = 1;} -// 是否屏蔽滚动弹幕 -message PlayerDanmakuBlockscroll {bool value = 1;} -// 是否屏蔽高级弹幕 -message PlayerDanmakuBlockspecial {bool value = 1;} -// 是否屏蔽顶端弹幕 -message PlayerDanmakuBlocktop {bool value = 1;} -// 弹幕显示区域 -message PlayerDanmakuDomain {float value = 1;} -// 是否开启屏蔽列表 -message PlayerDanmakuEnableblocklist {bool value = 1;} -// 弹幕不透明度 -message PlayerDanmakuOpacity {float value = 1;} -// 弹幕缩放比例 -message PlayerDanmakuScalingfactor {float value = 1;} -// -message PlayerDanmakuSeniorModeSwitch {int32 value = 1;} -// 弹幕速度 -message PlayerDanmakuSpeed {int32 value = 1;} -// 是否开启弹幕 -message PlayerDanmakuSwitch {bool value = 1;bool canIgnore = 2;} -// 是否记录弹幕开关设置 -message PlayerDanmakuSwitchSave {bool value = 1;} -// 是否使用推荐弹幕设置 -message PlayerDanmakuUseDefaultConfig {bool value = 1;} +message PlayerDanmakuAiRecommendedLevel {bool value = 1;} // 智能云屏蔽等级 +message PlayerDanmakuAiRecommendedLevelV2 {int32 value = 1;} // +message PlayerDanmakuAiRecommendedSwitch {bool value = 1;} // 是否开启智能云屏蔽 +message PlayerDanmakuBlockbottom {bool value = 1;} // 是否屏蔽底端弹幕 +message PlayerDanmakuBlockcolorful {bool value = 1;} // 是否屏蔽彩色弹幕 +message PlayerDanmakuBlockrepeat {bool value = 1;} // 是否屏蔽重复弹幕 +message PlayerDanmakuBlockscroll {bool value = 1;} // 是否屏蔽滚动弹幕 +message PlayerDanmakuBlockspecial {bool value = 1;} // 是否屏蔽高级弹幕 +message PlayerDanmakuBlocktop {bool value = 1;} // 是否屏蔽顶端弹幕 +message PlayerDanmakuDomain {float value = 1;} // 弹幕显示区域 +message PlayerDanmakuEnableblocklist {bool value = 1;} // 是否开启屏蔽列表 +message PlayerDanmakuOpacity {float value = 1;} // 弹幕不透明度 +message PlayerDanmakuScalingfactor {float value = 1;} // 弹幕缩放比例 +message PlayerDanmakuSeniorModeSwitch {int32 value = 1;} // +message PlayerDanmakuSpeed {int32 value = 1;} // 弹幕速度 +message PlayerDanmakuSwitch {bool value = 1; bool can_ignore = 2;} // 是否开启弹幕 +message PlayerDanmakuSwitchSave {bool value = 1;} // 是否记录弹幕开关设置 +message PlayerDanmakuUseDefaultConfig {bool value = 1;} // 是否使用推荐弹幕设置 // message PostPanel { @@ -612,6 +676,30 @@ enum PostPanelBizType { PostPanelBizTypeRecommend = 5; // } +// +message PostPanelV2 { + // + int64 start = 1; + // + int64 end = 2; + // + int32 biz_type = 3; + // + ClickButtonV2 click_button = 4; + // + TextInputV2 text_input = 5; + // + CheckBoxV2 check_box = 6; + // + ToastV2 toast = 7; + // + BubbleV2 bubble = 8; + // + LabelV2 label = 9; + // + int32 post_status = 10; +} + // enum PostStatus { PostStatusNormal = 0; // @@ -695,6 +783,22 @@ message TextInput { Label label = 8; } +// +message TextInputV2 { + // + repeated string portrait_placeholder = 1; + // + repeated string landscape_placeholder = 2; + // + RenderType render_type = 3; + // + bool placeholder_post = 4; + // + repeated Avatar avatar = 5; + // + int32 text_input_limit = 6; +} + // message Toast { // @@ -707,12 +811,30 @@ message Toast { Button button = 4; } +// +message ToastButtonV2 { + // + string text = 1; + // + int32 action = 2; +} + // enum ToastFunctionType { ToastFunctionTypeNone = 0; // ToastFunctionTypePostPanel = 1; // } +// +message ToastV2 { + // + string text = 1; + // + int32 duration = 2; + // + ToastButtonV2 toast_button_v2 = 3; +} + // 字幕作者信息 message UserInfo { // 用户mid diff --git a/grpc_api/bilibili/main/community/reply/v1/reply.proto b/grpc_api/bilibili/main/community/reply/v1/reply.proto index be3b731..6ed267e 100644 --- a/grpc_api/bilibili/main/community/reply/v1/reply.proto +++ b/grpc_api/bilibili/main/community/reply/v1/reply.proto @@ -22,7 +22,7 @@ service Reply { rpc AtSearch(AtSearchReq) returns (AtSearchReply); // 查询单条评论接口 rpc ReplyInfo(ReplyInfoReq) returns (ReplyInfoReply); - // + // 用户回调上报接口 rpc UserCallback(UserCallbackReq) returns (UserCallbackReply); // 评论分享材料接口 rpc ShareRepliesInfo(ShareRepliesInfoReq) returns (ShareRepliesInfoResp); @@ -344,16 +344,28 @@ message MainListReq { // 用户信息 message Member { - // - message Region { - // - int32 type = 1; - // - string icon = 2; - // - int32 show_status = 3; + // 地区类型 + enum RegionType { + DEFAULT = 0; // 默认 + MAINLAND = 1; // 大陆地区 + GAT = 2; // } // + enum ShowStatus { + SHOWDEFAULT = 0; // 默认 + ZOOMINMAINLAND = 1; // + RAW = 2; // + } + // NFT地区 + message Region { + // 地区类型 + RegionType type = 1; + // 角标url + string icon = 2; + // + ShowStatus show_status = 3; + } + // NFT信息 message NftInteraction { // string itype = 1; @@ -361,7 +373,7 @@ message Member { string metadata_url = 2; // string nft_id = 3; - // + // NFT地区 Region region = 4; } /**********基础信息**********/ @@ -430,11 +442,11 @@ message Member { int64 fans_guard_level = 29; // int32 face_nft = 30; - // + // 是否NFT头像 int32 face_nft_new = 31; - // + // 是否为硬核会员 int32 is_senior_member = 32; - // + // NFT信息 NftInteraction nft_interaction = 33; // string fans_guard_icon = 34; @@ -522,22 +534,28 @@ message MemberV2 { // int64 level_bg_color = 11; } - // + // 地区类型 enum RegionType { - DEFAULT = 0; // - MAINLAND = 1; // + DEFAULT = 0; // 默认 + MAINLAND = 1; // 大陆地区 GAT = 2; // } // + enum ShowStatus { + SHOWDEFAULT = 0; // + ZOOMINMAINLAND = 1; // + RAW = 2; // + } + // NFT地区 message Region { - // + // 地区类型 RegionType type = 1; - // + // 角标url string icon = 2; // - int32 show_status = 3; + ShowStatus show_status = 3; } - // + // NFT信息 message Interaction { // string itype = 1; @@ -545,7 +563,7 @@ message MemberV2 { string metadata_url = 2; // string nft_id = 3; - // + // NFT地区 Region region = 4; } @@ -563,17 +581,11 @@ message MemberV2 { } // 契约 message Contractor { - // + // 是否和up签订契约 bool is_contractor = 1; - // + // 契约显示文案 string contract_desc = 2; } - // - enum ShowStatus { - SHOWDEFAULT = 0; // - ZOOMINMAINLAND = 1; // - RAW = 2; // - } // 基本信息 Basic basic = 1; // 认证信息 @@ -594,10 +606,10 @@ message MemberV2 { // 排序方式 enum Mode { - DEFAULT = 0; // - UNSPECIFIED = 1; // 默认排序 + DEFAULT = 0; // + UNSPECIFIED = 1; // 默认排序 MAIN_LIST_TIME = 2; // 按时间 - MAIN_LIST_HOT = 3; // 按热度 + MAIN_LIST_HOT = 3; // 按热度 } // @@ -714,7 +726,7 @@ message ReplyCardLabel { string label_color_night = 5; // string image = 6; - // + // 标签类型 0:UP主觉得很赞 1:妙评 int32 type = 7; // 背景url string background = 8; @@ -775,7 +787,7 @@ message ReplyControl { string sub_reply_entry_text = 20; // 子评论数文案 "相关回复共x条" string sub_reply_title_text = 21; - // + // 契约显示文案 string contract_desc = 22; // 发布时间文案 "x天前发布" string time_desc = 23; @@ -856,13 +868,13 @@ message RichText { // 笔记 message RichTextNote { - // + // 预览文本 string summary = 1; - // + // 笔记预览图片url列表 repeated string images = 2; - // + // 笔记页面url string click_url = 3; - // + // 发布日期 YYYY-mm-dd string last_mtime_text = 4; } @@ -1146,11 +1158,11 @@ message Url { string app_name = 5; // string app_package_name = 6; - // 上报id + // 点击上报数据 string click_report = 7; // 是否半屏打开 bool is_half_screen = 8; - // + // 展现上报数据 string exposure_report = 9; // 扩展字段 Extra extra = 10; @@ -1169,20 +1181,20 @@ enum UserCallbackAction { Dismiss = 0; // } -// +// 用户回调上报-响应 message UserCallbackReply {} -// +// 用户回调上报-请求 message UserCallbackReq { - // + // 用户mid int64 mid = 1; // UserCallbackScene scene = 2; // UserCallbackAction action = 3; - // + // 目标评论区id int64 oid = 4; - // + // 目标评论区业务type int64 type = 5; }