更新【私信】相关proto定义
This commit is contained in:
440
grpc_api/bilibili/im/interfaces/v1.proto
Normal file
440
grpc_api/bilibili/im/interfaces/v1.proto
Normal file
@@ -0,0 +1,440 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "bilibili/im/type.proto";
|
||||
|
||||
package bilibili.im.interfaces.v1;
|
||||
|
||||
//私信
|
||||
service ImInterface {
|
||||
//未读私信数
|
||||
rpc singleUnread (ReqSingleUnread) returns (RspSingleUnread);
|
||||
|
||||
//会话详情
|
||||
rpc sessionDetail (ReqSessionDetail) returns (bilibili.im.type.SessionInfo);
|
||||
|
||||
//拉取会话记录列表
|
||||
rpc getSessions (ReqGetSessions) returns (RspSessions);
|
||||
|
||||
//拉取最近私信分享列表
|
||||
rpc shareList (ReqShareList) returns (RspShareList);
|
||||
|
||||
//发送消息
|
||||
rpc sendMsg (ReqSendMsg) returns (RspSendMsg);
|
||||
|
||||
//删除会话记录
|
||||
rpc removeSession (ReqRemoveSession) returns (DummyRsp);
|
||||
|
||||
//置顶聊天
|
||||
rpc setTop (ReqSetTop) returns (DummyRsp);
|
||||
|
||||
//
|
||||
rpc ackAssisMsg (ReqAckAssisMsg) returns (DummyRsp);
|
||||
|
||||
//
|
||||
rpc ackSessions (ReqAckSessions) returns (RspSessions);
|
||||
|
||||
//
|
||||
rpc batchRmSessions (ReqBatRmSess) returns (DummyRsp);
|
||||
|
||||
//
|
||||
rpc batchSessDetail (ReqSessionDetails) returns (RspSessionDetails);
|
||||
|
||||
//
|
||||
rpc getSpecificSessions (ReqGetSpecificSessions) returns (RspSessions);
|
||||
|
||||
//
|
||||
rpc groupAssisMsg (ReqGroupAssisMsg) returns (RspSessionMsg);
|
||||
|
||||
//
|
||||
rpc myGroupUnread (DummyReq) returns (RspMyGroupUnread);
|
||||
|
||||
//
|
||||
rpc newSessions (ReqNewSessions) returns (RspSessions);
|
||||
|
||||
//
|
||||
rpc specificSingleUnread (ReqSpecificSingleUnread) returns (RspSpecificSingleUnread);
|
||||
|
||||
//
|
||||
rpc syncAck (ReqSyncAck) returns (RspSyncAck);
|
||||
|
||||
//
|
||||
rpc syncFetchSessionMsgs (ReqSessionMsg) returns (RspSessionMsg);
|
||||
|
||||
//
|
||||
rpc syncRelation (ReqRelationSync) returns (RspRelationSync);
|
||||
|
||||
//
|
||||
rpc updateAck (ReqUpdateAck) returns (DummyRsp);
|
||||
|
||||
//
|
||||
rpc updateUnflwRead (DummyReq) returns (DummyRsp);
|
||||
}
|
||||
|
||||
//发送消息-请求
|
||||
message ReqSendMsg {
|
||||
//
|
||||
bilibili.im.type.Msg msg = 1;
|
||||
|
||||
//
|
||||
string cookie = 2;
|
||||
|
||||
//
|
||||
string cookie2 = 3;
|
||||
|
||||
//
|
||||
int32 errorCode = 4;
|
||||
|
||||
//
|
||||
string devId = 5;
|
||||
}
|
||||
|
||||
//发送消息-回复
|
||||
message RspSendMsg {
|
||||
//
|
||||
uint64 msgKey = 1;
|
||||
|
||||
//
|
||||
repeated EmotionInfo eInfos = 2;
|
||||
|
||||
//
|
||||
string msgContent = 3;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message DummyReq {
|
||||
//
|
||||
uint32 idl = 1;
|
||||
}
|
||||
|
||||
//-回复
|
||||
message DummyRsp {
|
||||
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqAckAssisMsg {
|
||||
//
|
||||
uint64 ackSeqno = 1;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqAckSessions {
|
||||
//
|
||||
uint64 beginTs = 1;
|
||||
|
||||
//
|
||||
uint32 endTs = 2;
|
||||
|
||||
//
|
||||
uint32 size = 3;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqBatRmSess {
|
||||
|
||||
}
|
||||
|
||||
//拉取会话记录列表-请求
|
||||
message ReqGetSessions {
|
||||
//
|
||||
uint64 beginTs = 1;
|
||||
|
||||
//
|
||||
uint64 endTs = 2;
|
||||
|
||||
//
|
||||
uint32 size = 3;
|
||||
|
||||
//
|
||||
uint32 sessionType = 4;
|
||||
|
||||
//
|
||||
uint32 unfollowFold = 5;
|
||||
|
||||
//
|
||||
uint32 groupFold = 6;
|
||||
|
||||
//
|
||||
uint32 sortRule = 7;
|
||||
|
||||
//
|
||||
uint32 teenagerMode = 8;
|
||||
|
||||
//
|
||||
uint32 lessonsMode = 9;
|
||||
}
|
||||
|
||||
//拉取会话记录列表-回复
|
||||
message RspSessions {
|
||||
//
|
||||
repeated bilibili.im.type.SessionInfo sessionList = 1;
|
||||
|
||||
//
|
||||
uint32 hasMore = 2;
|
||||
|
||||
//
|
||||
bool antiDisturbCleaning = 3;
|
||||
|
||||
//
|
||||
int32 isAddressListEmpty = 4;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqGetSpecificSessions {
|
||||
//
|
||||
repeated SimpleSession talkerSessions = 1;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqGroupAssisMsg {
|
||||
//
|
||||
uint64 clientSeqno = 1;
|
||||
|
||||
//
|
||||
uint32 size = 2;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqNewSessions {
|
||||
//
|
||||
uint64 beginTs = 1;
|
||||
|
||||
//
|
||||
uint32 size = 2;
|
||||
|
||||
//
|
||||
uint32 teenagerMode = 3;
|
||||
|
||||
//
|
||||
uint32 lessonsMode = 4;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqRelationSync {
|
||||
//
|
||||
uint64 clientRelationOplogSeqno = 1;
|
||||
}
|
||||
|
||||
//删除会话记录-请求
|
||||
message ReqRemoveSession {
|
||||
//
|
||||
uint64 talkerId = 1;
|
||||
|
||||
//
|
||||
uint32 sessionType = 2;
|
||||
}
|
||||
|
||||
//会话详情-请求
|
||||
message ReqSessionDetail {
|
||||
//
|
||||
uint64 talkerId = 1;
|
||||
|
||||
//
|
||||
uint32 sessionType = 2;
|
||||
|
||||
//
|
||||
uint64 uid = 3;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqSessionDetails {
|
||||
//
|
||||
repeated ReqSessionDetail sessIds = 1;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqSessionMsg {
|
||||
//
|
||||
uint64 talkerId = 1;
|
||||
|
||||
//
|
||||
int32 sessionType = 2;
|
||||
|
||||
//
|
||||
uint64 endSeqno = 3;
|
||||
|
||||
//
|
||||
uint64 beginSeqno = 4;
|
||||
|
||||
//
|
||||
int32 size = 5;
|
||||
|
||||
//
|
||||
int32 order = 6;
|
||||
|
||||
//
|
||||
string devId = 7;
|
||||
}
|
||||
|
||||
//置顶聊天-请求
|
||||
message ReqSetTop {
|
||||
//
|
||||
uint64 talkerId = 1;
|
||||
|
||||
//
|
||||
uint32 sessionType = 2;
|
||||
|
||||
//
|
||||
uint32 opType = 3;
|
||||
}
|
||||
|
||||
//拉取最近私信分享列表-请求
|
||||
message ReqShareList {
|
||||
//
|
||||
int32 size = 1;
|
||||
}
|
||||
|
||||
//拉取最近私信分享列表-回复
|
||||
message RspShareList {
|
||||
//最近会话列表
|
||||
repeated ShareSessionInfo sessionList = 1;
|
||||
|
||||
//
|
||||
int32 isAddressListEmpty = 2;
|
||||
}
|
||||
|
||||
//未读私信数-请求
|
||||
message ReqSingleUnread {
|
||||
//
|
||||
uint32 unreadType = 1;
|
||||
|
||||
//
|
||||
uint32 showUnfollowList = 2;
|
||||
}
|
||||
|
||||
//未读私信数-回复
|
||||
message RspSingleUnread {
|
||||
//未关注用户私信数
|
||||
uint64 unfollowUnread = 1;
|
||||
|
||||
//已关注用户私信数
|
||||
uint64 followUnread = 2;
|
||||
|
||||
//
|
||||
uint32 unfollowPushMsg = 3;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqSpecificSingleUnread {
|
||||
//
|
||||
repeated SimpleSession talkerSessions = 1;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqSyncAck {
|
||||
//
|
||||
uint64 clientSeqno = 1;
|
||||
}
|
||||
|
||||
//-请求
|
||||
message ReqUpdateAck {
|
||||
//
|
||||
uint64 talkerId = 1;
|
||||
|
||||
//
|
||||
uint32 sessionType = 2;
|
||||
|
||||
//
|
||||
uint64 ackSeqno = 3;
|
||||
}
|
||||
|
||||
//-回复
|
||||
message RspMyGroupUnread {
|
||||
//
|
||||
uint32 unreadCount = 1;
|
||||
}
|
||||
|
||||
//-回复
|
||||
message RspRelationSync {
|
||||
//
|
||||
int32 full = 1;
|
||||
|
||||
//
|
||||
repeated bilibili.im.type.RelationLog relationLogs = 2;
|
||||
|
||||
//
|
||||
repeated bilibili.im.type.FriendRelation friendList = 3;
|
||||
|
||||
//
|
||||
uint64 serverRelationOplogSeqno = 4;
|
||||
|
||||
//
|
||||
repeated bilibili.im.type.GroupRelation groupList = 5;
|
||||
}
|
||||
|
||||
//-回复
|
||||
message RspSessionDetails {
|
||||
//
|
||||
repeated bilibili.im.type.SessionInfo sessInfos = 1;
|
||||
}
|
||||
|
||||
//-回复
|
||||
message RspSessionMsg {
|
||||
//
|
||||
repeated bilibili.im.type.Msg messages = 1;
|
||||
|
||||
//
|
||||
int32 hasMore = 2;
|
||||
|
||||
//
|
||||
uint64 minSeqno = 3;
|
||||
|
||||
//
|
||||
uint64 maxSeqno = 4;
|
||||
|
||||
//
|
||||
repeated EmotionInfo eInfos = 5;
|
||||
}
|
||||
|
||||
//-回复
|
||||
message RspSpecificSingleUnread {
|
||||
//
|
||||
map <uint64,uint64> talkerUnreadCnt = 1;
|
||||
|
||||
//
|
||||
uint64 allUnreadCnt = 2;
|
||||
}
|
||||
|
||||
//-回复
|
||||
message RspSyncAck {
|
||||
|
||||
}
|
||||
|
||||
//会话信息,用于私信分享
|
||||
message ShareSessionInfo {
|
||||
//
|
||||
uint64 talkerId = 1;
|
||||
|
||||
//
|
||||
string talkerUname = 2;
|
||||
|
||||
//
|
||||
string talkerIcon = 3;
|
||||
|
||||
//
|
||||
int32 officialType = 4;
|
||||
}
|
||||
|
||||
//
|
||||
message SimpleSession {
|
||||
//
|
||||
uint64 talkerId = 1;
|
||||
|
||||
//
|
||||
uint32 sessionType = 2;
|
||||
}
|
||||
|
||||
//
|
||||
message EmotionInfo {
|
||||
//
|
||||
string text = 1;
|
||||
|
||||
//
|
||||
string url = 2;
|
||||
|
||||
//
|
||||
int32 size = 3;
|
||||
|
||||
//
|
||||
string gifUrl = 4;
|
||||
}
|
||||
244
grpc_api/bilibili/im/type.proto
Normal file
244
grpc_api/bilibili/im/type.proto
Normal file
@@ -0,0 +1,244 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bilibili.im.type;
|
||||
|
||||
//消息类型
|
||||
enum MsgType {
|
||||
//基础消息类型
|
||||
EN_INVALID_MSG_TYPE = 0; //空空的~
|
||||
EN_MSG_TYPE_TEXT = 1; //文本消息
|
||||
EN_MSG_TYPE_PIC = 2; //图片消息
|
||||
EN_MSG_TYPE_AUDIO = 3; //语音消息
|
||||
EN_MSG_TYPE_SHARE = 4; //分享消息
|
||||
EN_MSG_TYPE_DRAW_BACK = 5; //撤回消息
|
||||
EN_MSG_TYPE_CUSTOM_FACE = 6; //自定义表情
|
||||
EN_MSG_TYPE_SHARE_V2 = 7; //分享v2消息
|
||||
EN_MSG_TYPE_SYS_CANCEL = 8; //系统撤销
|
||||
EN_MSG_TYPE_MINI_PROGRAM = 9; //小程序
|
||||
//扩展消息类型
|
||||
EN_MSG_TYPE_NOTIFY_MSG = 10; //业务通知
|
||||
EN_MSG_TYPE_VIDEO_CARD = 11; //视频卡片
|
||||
EN_MSG_TYPE_ARTICLE_CARD = 12; //专栏卡片
|
||||
EN_MSG_TYPE_PICTURE_CARD = 13; //图片卡
|
||||
EN_MSG_TYPE_COMMON_SHARE_CARD = 14; //异形卡
|
||||
EN_MSG_TYPE_BIZ_MSG_TYPE = 50; //
|
||||
//功能类系统消息类型
|
||||
EN_MSG_TYPE_GROUP_MEMBER_CHANGED = 101; //群成员变更
|
||||
EN_MSG_TYPE_GROUP_STATUS_CHANGED = 102; //群状态变更
|
||||
EN_MSG_TYPE_GROUP_DYNAMIC_CHANGED = 103; //群动态变更
|
||||
EN_MSG_TYPE_GROUP_LIST_CHANGED = 104; //群列表变更
|
||||
EM_MSG_TYPE_FRIEND_LIST_CHANGED = 105; //好友列表变更
|
||||
EN_MSG_TYPE_GROUP_DETAIL_CHANGED = 106; //群详情发生变化
|
||||
EN_MSG_TYPE_GROUP_MEMBER_ROLE_CHANGED = 107; //群成员角色发生变化
|
||||
EN_MSG_TYPE_NOTICE_WATCH_LIST = 108; //
|
||||
EN_MSG_TYPE_NOTIFY_NEW_REPLY_RECIEVED = 109; //消息系统,收到新的reply
|
||||
EN_MSG_TYPE_NOTIFY_NEW_AT_RECIEVED = 110; //
|
||||
EN_MSG_TYPE_NOTIFY_NEW_PRAISE_RECIEVED = 111; //
|
||||
EN_MSG_TYPE_NOTIFY_NEW_UP_RECIEVED = 112; //
|
||||
EN_MSG_TYPE_NOTIFY_NEW_REPLY_RECIEVED_V2 = 113; //
|
||||
EN_MSG_TYPE_NOTIFY_NEW_AT_RECIEVED_V2 = 114; //
|
||||
EN_MSG_TYPE_NOTIFY_NEW_PRAISE_RECIEVED_V2 = 115; //
|
||||
EN_MSG_TYPE_GROUP_DETAIL_CHANGED_MULTI = 116; //群详情发生变化,多端同步版本需要即时消息,无需落地
|
||||
EN_MSG_TYPE_GROUP_MEMBER_ROLE_CHANGED_MULTI = 117; //群成员角色发生变化,多端同步版本需要即时消息,无需落地
|
||||
EN_MSG_TYPE_NOTIFY_ANTI_DISTURB = 118; //
|
||||
//系统通知栏消息类型
|
||||
EN_MSG_TYPE_SYS_GROUP_DISSOLVED = 201; //群解散
|
||||
EN_MSG_TYPE_SYS_GROUP_JOINED = 202; //入群
|
||||
EN_MSG_TYPE_SYS_GROUP_MEMBER_EXITED = 203; //成员主动退群
|
||||
EN_MSG_TYPE_SYS_GROUP_ADMIN_FIRED = 204; //房管被撤
|
||||
EN_MSG_TYPE_SYS_GROUP_MEMBER_KICKED = 205; //成员被T
|
||||
EN_MSG_TYPE_SYS_GROUP_ADMIN_KICK_OFF = 206; //管理T人
|
||||
EN_MSG_TYPE_SYS_GROUP_ADMIN_DUTY = 207; //管理上任
|
||||
EN_MSG_TYPE_SYS_GROUP_AUTO_CREATED = 208; //自动创建
|
||||
EN_MSG_TYPE_SYS_FRIEND_APPLY = 210; //好友申请
|
||||
EN_MSG_TYPE_SYS_FRIEND_APPLY_ACK = 211; //好友申请通过
|
||||
EN_MSG_TYPE_SYS_GROUP_APPLY_FOR_JOINING = 212; //用户加群申请
|
||||
EN_MSG_TYPE_SYS_GROUP_ADMIN_ACCEPTED_USER_APPLY = 213; //通知管理员,有其他管理员已经同意用户加群
|
||||
//聊天窗口通知消息类型
|
||||
EN_MSG_TYPE_CHAT_MEMBER_JOINED = 301; //入群
|
||||
EN_MSG_TYPE_CHAT_MEMBER_EXITED = 302; //退群
|
||||
EN_MSG_TYPE_CHAT_GROUP_FREEZED = 303; //冻结
|
||||
EN_MSG_TYPE_CHAT_GROUP_DISSOLVED = 304; //解散
|
||||
EN_MSG_TYPE_CHAT_GROUP_CREATED = 305; //开通应援团
|
||||
EN_MSG_TYPE_CHAT_POPUP_SESSION = 306; //弹出会话
|
||||
}
|
||||
|
||||
//
|
||||
message SessionInfo {
|
||||
//
|
||||
uint64 talkerId = 1;
|
||||
|
||||
//
|
||||
uint32 sessionType = 2;
|
||||
|
||||
//
|
||||
uint64 atSeqno = 3;
|
||||
|
||||
//
|
||||
uint64 topTs = 4;
|
||||
|
||||
//
|
||||
string groupName = 5;
|
||||
|
||||
//
|
||||
string groupCover = 6;
|
||||
|
||||
//
|
||||
uint32 isFollow = 7;
|
||||
|
||||
//
|
||||
uint32 isDnd = 8;
|
||||
|
||||
//
|
||||
uint64 ackSeqno = 9;
|
||||
|
||||
//
|
||||
uint64 ackTs = 10;
|
||||
|
||||
//
|
||||
uint64 sessionTs = 11;
|
||||
|
||||
//
|
||||
uint32 unreadCount = 12;
|
||||
|
||||
//
|
||||
Msg lastMsg = 13;
|
||||
|
||||
//
|
||||
uint32 groupType = 14;
|
||||
|
||||
//
|
||||
uint32 canFold = 15;
|
||||
|
||||
//
|
||||
uint32 status = 16;
|
||||
|
||||
//
|
||||
uint64 maxSeqno = 17;
|
||||
|
||||
//
|
||||
uint32 newPushMsg = 18;
|
||||
|
||||
//
|
||||
uint32 setting = 19;
|
||||
|
||||
//
|
||||
uint32 isGuardian = 20;
|
||||
}
|
||||
|
||||
//
|
||||
message Msg {
|
||||
//
|
||||
uint64 senderUid = 1;
|
||||
|
||||
//
|
||||
int32 receiverType = 2;
|
||||
|
||||
//
|
||||
uint64 receiverId = 3;
|
||||
|
||||
//
|
||||
uint64 cliMsgId = 4;
|
||||
|
||||
//
|
||||
int32 msgType = 5;
|
||||
|
||||
//
|
||||
string content = 6;
|
||||
|
||||
//
|
||||
uint64 msgSeqno = 7;
|
||||
|
||||
//
|
||||
uint64 timestamp = 8;
|
||||
|
||||
//
|
||||
repeated uint64 atUids = 9;
|
||||
|
||||
//
|
||||
repeated uint64 recverIds = 10;
|
||||
|
||||
//
|
||||
uint64 msgKey = 11;
|
||||
|
||||
//
|
||||
uint32 msgStatus = 12;
|
||||
|
||||
//
|
||||
bool sysCancel = 13;
|
||||
|
||||
//
|
||||
string notifyCode = 14;
|
||||
|
||||
//
|
||||
uint32 msgSource = 15;
|
||||
|
||||
//
|
||||
int32 newFaceVersion = 16;
|
||||
}
|
||||
|
||||
//
|
||||
message RelationLog {
|
||||
//
|
||||
int32 logType = 1;
|
||||
|
||||
//
|
||||
uint64 oplogSeqno = 2;
|
||||
|
||||
//
|
||||
FriendRelation friendRelation = 3;
|
||||
|
||||
//
|
||||
GroupRelation groupRelation = 4;
|
||||
}
|
||||
|
||||
//
|
||||
message FriendRelation {
|
||||
//
|
||||
uint64 uid = 1;
|
||||
|
||||
//
|
||||
string userName = 2;
|
||||
|
||||
//
|
||||
string face = 3;
|
||||
|
||||
//
|
||||
uint32 vipLevel = 4;
|
||||
}
|
||||
|
||||
//
|
||||
message GroupRelation {
|
||||
//
|
||||
uint64 groupId = 1;
|
||||
|
||||
//
|
||||
uint64 ownerUid = 2;
|
||||
|
||||
//
|
||||
uint32 groupType = 3;
|
||||
|
||||
//
|
||||
uint32 groupLevel = 4;
|
||||
|
||||
//
|
||||
string groupCover = 5;
|
||||
|
||||
//
|
||||
string groupName = 6;
|
||||
|
||||
//
|
||||
string groupNotice = 7;
|
||||
|
||||
//
|
||||
int32 status = 8;
|
||||
|
||||
//
|
||||
int32 memberRole = 9;
|
||||
|
||||
//
|
||||
string fansMedalName = 10;
|
||||
|
||||
//
|
||||
uint64 roomId = 11;
|
||||
}
|
||||
Reference in New Issue
Block a user