340 lines
8.7 KiB
Protocol Buffer
340 lines
8.7 KiB
Protocol Buffer
//评论区v1接口
|
|
syntax = "proto3";
|
|
package bilibili.main.community.reply.v1;
|
|
|
|
import "google/protobuf/any.proto";
|
|
|
|
message CursorReq{
|
|
enum Mode{
|
|
DEFAULT = 0;
|
|
UNSPECIFIED = 1;
|
|
MAIN_LIST_TIME = 2;
|
|
MAIN_LIST_HOT = 3;
|
|
}
|
|
int64 next = 1;
|
|
int64 prev = 2;
|
|
Mode mode = 3; //排序模式
|
|
}
|
|
|
|
message CursorReply{
|
|
enum Mode{
|
|
DEFAULT = 0;
|
|
UNSPECIFIED = 1;
|
|
MAIN_LIST_TIME = 2;
|
|
MAIN_LIST_HOT = 3;
|
|
}
|
|
int64 next = 1;
|
|
int64 prev = 2;
|
|
bool isBegin = 3;
|
|
bool isEnd = 4;
|
|
Mode mode = 5;
|
|
}
|
|
|
|
enum SearchItemType{
|
|
DEFAULT_ITEM_TYPE = 0;
|
|
GOODS_VALUE = 1;
|
|
VIDEO_VALUE = 2;
|
|
ARTICLE_VALUE = 3;
|
|
}
|
|
|
|
message SearchItemCursorReq{
|
|
int64 next = 1;
|
|
SearchItemType itemType = 2;
|
|
}
|
|
|
|
message SearchItemCursorReply{
|
|
bool hasNext = 1;
|
|
int64 next = 2;
|
|
}
|
|
|
|
message Member{
|
|
int64 mid = 1; //UID
|
|
string name = 2; //昵称
|
|
string sex = 3; //性别
|
|
string face = 4; //头像url
|
|
int64 level = 5; //等级
|
|
int64 officialVerifyType = 6; //认证类型
|
|
int64 vipType = 7; //会员类型
|
|
int64 vipStatus = 8; //会员状态
|
|
int64 vipThemeType = 9;
|
|
string vipLabelPath = 10;
|
|
string garbPendantImage = 11; //头像框url
|
|
string garbCardImage = 12; //装扮卡url
|
|
string garbCardImageWithFocus = 13;
|
|
string garbCardJumpUrl = 14;//专属装扮页url
|
|
string garbCardNumber = 15;//专属装扮id
|
|
string garbCardFanColor = 16;//专属装扮id显示颜色
|
|
bool garbCardIsFan = 17;//是否为专属装扮卡
|
|
string fansMedalName = 18;
|
|
int64 fansMedalLevel = 19;
|
|
int64 fansMedalColor = 20;
|
|
}
|
|
|
|
message Content{
|
|
message Emote{
|
|
int64 size = 1;//表情大小 1:小 2:大
|
|
string url = 2;//标签url
|
|
}
|
|
message Topic{
|
|
string link = 1;
|
|
int64 id = 2;
|
|
}
|
|
message Url{
|
|
string title = 1; //标题
|
|
int64 state = 2;
|
|
string prefixIcon = 3; //图标url
|
|
string appUrlSchema = 4;
|
|
string appName = 5;
|
|
string appPackageName = 6;
|
|
string clickReport = 7;
|
|
}
|
|
message Vote{
|
|
int64 id = 1;
|
|
string title = 2;
|
|
int64 count = 3;
|
|
}
|
|
string message = 1; //评论正文
|
|
map<string,Member> menber = 2; //at到的用户信息
|
|
map<string,Emote> emote = 3; //表情转义
|
|
map<string,Topic> topic = 4; //话题转义
|
|
map<string,Url> url = 5; //扩展应用转义
|
|
Vote vote = 6;
|
|
}
|
|
|
|
message ReplyControl{
|
|
int64 action = 1; //操作标志 0:无 1:已点赞 2:已点踩
|
|
bool upLike = 2; //是否UP觉得很赞
|
|
bool upReply = 3; //是否存在UP回复
|
|
bool showFollowBtn = 4; //是否显示关注按钮
|
|
bool isAssist = 5;
|
|
string labelText = 6;
|
|
bool following = 7; //是否关注
|
|
bool followed = 8; //是否粉丝
|
|
bool blocked = 9;
|
|
bool hasFoldedReply = 10;
|
|
bool isFoldedReply = 11;
|
|
bool isUpTop = 12; //是否UP置顶
|
|
bool isAdminTop = 13; //是否管理置顶
|
|
bool isVoteTop = 14; //是否投票评论
|
|
int64 maxLine = 15; //最大收起行数
|
|
bool invisible = 16;
|
|
}
|
|
|
|
message ReplyInfo{
|
|
repeated ReplyInfo replies = 1; //二级评论
|
|
int64 id = 2; //rpid
|
|
int64 oid = 3; //对象id
|
|
int64 type = 4; //评论区类型id
|
|
int64 mid = 5; //发布者UID
|
|
int64 root = 6; //根评论rpid
|
|
int64 parent = 7; //父评论rpid
|
|
int64 dialog = 8; //对话评论rpid
|
|
int64 like = 9; //点赞数
|
|
int64 ctime = 10; //发布时间
|
|
int64 count = 11; //回复数
|
|
Content content = 12; //评论主体信息
|
|
Member member = 13; //评论发布者信息
|
|
ReplyControl replyControl = 14; //评论显示控制项
|
|
}
|
|
|
|
message SubjectControl{
|
|
int64 upMid = 1; //UP主UID
|
|
bool isAssist = 2;
|
|
bool readOnly = 3;
|
|
bool hasVoteAccess = 4;
|
|
bool hasLotteryAccess = 5;
|
|
bool hasFoldedReply = 6;
|
|
string bgText = 7; //空评论背景文字
|
|
bool upBlocked = 8;
|
|
bool hasActivityAccess = 9;
|
|
bool showTitle = 10;
|
|
bool showUpAction = 11;
|
|
int64 switcherType = 12;
|
|
bool inputDisable = 13;
|
|
string rootText = 14; //输入框背景文字
|
|
string childText = 15;
|
|
int64 count = 16; //评论总数
|
|
string title = 17; //评论区标题
|
|
}
|
|
|
|
message Notice{
|
|
int64 id = 1;
|
|
string content = 2;
|
|
string link = 3;
|
|
}
|
|
|
|
message Lottery{
|
|
int64 lotteryId = 1;
|
|
int64 lotteryStatus = 2;
|
|
int64 lotteryMid = 3;
|
|
int64 lotteryTime = 4;
|
|
int64 oid = 5;
|
|
int64 type = 6;
|
|
int64 ctime = 7;
|
|
Content content = 8;
|
|
Member member = 9;
|
|
ReplyControl replyControl = 10;
|
|
}
|
|
|
|
message Activity{
|
|
int64 activityId = 1;
|
|
int64 activityState = 2;
|
|
string activityPlaceholder = 3;
|
|
}
|
|
|
|
message UpSelection{
|
|
int64 pendingCount = 1;
|
|
int64 ignoreCount = 2;
|
|
}
|
|
|
|
message CM{
|
|
google.protobuf.Any sourceContent = 1;
|
|
}
|
|
|
|
message SearchItem{
|
|
message ArticleSearchItem{
|
|
string title = 1;
|
|
string upNickname = 2;
|
|
repeated string covers = 3;
|
|
}
|
|
message GoodsSearchItem{
|
|
int64 id = 1;
|
|
string name = 2;
|
|
string price = 3;
|
|
string income = 4;
|
|
string img = 5;
|
|
string label = 6;
|
|
}
|
|
message VideoSearchItem{
|
|
enum VideoItemCase{
|
|
VIDEOITEM_NOT_SET = 0;
|
|
UGC = 2;
|
|
PGC = 3;
|
|
}
|
|
message UGCVideoSearchItem{
|
|
string title = 1;
|
|
string upNickname = 2;
|
|
int64 duration = 3;
|
|
string cover = 4;
|
|
}
|
|
message PGCVideoSearchItem{
|
|
string title = 1;
|
|
string category = 2;
|
|
string cover = 3;
|
|
}
|
|
VideoItemCase type = 1;
|
|
UGCVideoSearchItem UGCVideo = 2;
|
|
PGCVideoSearchItem PGCVideo = 3;
|
|
}
|
|
enum ItemCase{
|
|
ITEM_NOT_SET = 0;
|
|
GOODS = 2;
|
|
VIDEO = 3;
|
|
ARTICLE = 4;
|
|
}
|
|
string url = 1;
|
|
GoodsSearchItem goods = 2;
|
|
VideoSearchItem video = 3;
|
|
ArticleSearchItem article = 4;
|
|
}
|
|
|
|
message SearchItemReplyExtraInfo{
|
|
string eventId = 1;
|
|
}
|
|
|
|
//评论列表
|
|
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/MainList
|
|
//请求
|
|
message MainListReq{
|
|
int64 oid = 1; //目标评论区id
|
|
int64 type = 2; //评论区类型
|
|
CursorReq cursor = 3; //页面选择
|
|
string extra = 4;
|
|
string adExtra = 5;
|
|
int64 rpid = 6;
|
|
}
|
|
//回复
|
|
message MainListReply{
|
|
CursorReply cursor = 1; //页面信息
|
|
repeated ReplyInfo replies = 2; //评论条目
|
|
SubjectControl subjectControl = 3; //评论区显示控制
|
|
ReplyInfo upTop = 4; //UP置顶评论
|
|
ReplyInfo adminTop = 5; //管理置顶评论
|
|
ReplyInfo voteTop = 6; //投票评论
|
|
Notice notice = 7;
|
|
Lottery lottery = 8; //抽奖评论
|
|
Activity activity = 9;
|
|
UpSelection upSelection = 10;
|
|
CM cm = 11;
|
|
}
|
|
|
|
//二级评论明细
|
|
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/DetailList
|
|
//请求
|
|
message DetailListReq{
|
|
enum DetailListScene{
|
|
REPLY = 0; //评论区展开
|
|
MSG_FEED = 1; //回复消息推送
|
|
}
|
|
int64 oid = 1; //目标评论区id
|
|
int64 type = 2; //评论区类型
|
|
int64 root = 3; //根评论rpid
|
|
int64 rpid = 4; //目标评论rpid
|
|
CursorReq cursor = 5; //页面选择
|
|
DetailListScene scene = 6; //来源标识
|
|
}
|
|
//回复
|
|
message DetailListReply{
|
|
CursorReply cursor = 1; //页面信息
|
|
SubjectControl subjectControl = 2; //评论区显示控制
|
|
ReplyInfo root = 3; //根评论信息(带二级评论)
|
|
Activity activity = 4;
|
|
}
|
|
|
|
//对话评论回复树
|
|
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/DialogList
|
|
//请求
|
|
message DialogListReq{
|
|
int64 oid = 1; //目标评论区id
|
|
int64 type = 2; //评论区类型
|
|
int64 root = 3; //根评论rpid
|
|
int64 rpid = 4; //目标评论rpid
|
|
CursorReq cursor = 5; //页面选择
|
|
}
|
|
//回复
|
|
message DialogListReply{
|
|
CursorReply cursor = 1; //页面信息
|
|
SubjectControl subjectControl = 2; //评论区显示控制
|
|
repeated ReplyInfo replies = 3; //评论树列表
|
|
Activity activity = 4;
|
|
}
|
|
|
|
//搜索提示信息?
|
|
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/SearchItemPreHook
|
|
//请求
|
|
message SearchItemPreHookReq{
|
|
int64 oid = 1; //目标评论区id
|
|
int64 type = 2; //评论区类型
|
|
}
|
|
//回复
|
|
message SearchItemPreHookReply{
|
|
string placeholderText = 1;
|
|
string backgroundText = 2;
|
|
repeated SearchItemType orderedType = 3;
|
|
}
|
|
|
|
//搜索评论区插入项目
|
|
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/SearchItem
|
|
//请求
|
|
message SearchItemReq{
|
|
SearchItemCursorReq cursor = 1; //页面选择
|
|
int64 oid = 2; //目标评论区id
|
|
int64 type = 3; //评论区类型
|
|
string keyword = 4; //搜索关键词
|
|
}
|
|
//回复
|
|
message SearchItemReply{
|
|
SearchItemCursorReply cursor = 1;
|
|
repeated SearchItem items = 2;
|
|
SearchItemReplyExtraInfo extra = 3;
|
|
} |