Files
sctalk/doc/pb-ver3/IM.Message.proto

125 lines
2.9 KiB
Protocol Buffer

syntax = "proto3";
package IM.Message;
import "IM.BaseDefine.proto";
option java_package = "com.blt.talk.common.code.proto";
option optimize_for = LITE_RUNTIME;
//service id 0x0003
message IMMsgData{
//cmd id: 0x0301
uint64 from_user_id = 1; //消息发送方
uint64 to_session_id = 2; //消息接受方
uint64 msg_id = 3;
uint32 create_time = 4;
IM.BaseDefine.MsgType msg_type = 5;
bytes msg_data = 6;
bytes attach_data = 20;
}
message IMMsgDataAck{
//cmd id: 0x0302
uint64 user_id = 1; //发送此信令的用户id
uint64 session_id = 2;
uint64 msg_id = 3;
IM.BaseDefine.SessionType session_type = 4;
}
message IMMsgDataReadAck{
//cmd id: 0x0303
uint64 user_id = 1; //发送此信令的用户id
uint64 session_id = 2;
uint64 msg_id = 3;
IM.BaseDefine.SessionType session_type = 4;
}
message IMMsgDataReadNotify{
//cmd id: 0x0304
uint64 user_id = 1; //发送此信令的用户id
uint64 session_id = 2;
uint64 msg_id = 3;
IM.BaseDefine.SessionType session_type = 4;
}
message IMClientTimeReq{
//cmd id: 0x0305
}
message IMClientTimeRsp{
//cmd id: 0x0306
uint32 server_time = 1;
}
message IMUnreadMsgCntReq{
//cmd id: 0x0307
uint64 user_id = 1;
bytes attach_data = 20;
}
message IMUnreadMsgCntRsp{
//cmd id: 0x0308
uint64 user_id = 1;
uint32 total_cnt = 2;
repeated IM.BaseDefine.UnreadInfo unreadinfo_list = 3;
bytes attach_data = 20;
}
message IMGetMsgListReq{
//cmd id: 0x0309
uint64 user_id = 1;
IM.BaseDefine.SessionType session_type = 2;
uint64 session_id = 3;
uint64 msg_id_begin = 4;
uint32 msg_cnt = 5;
bytes attach_data = 20;
}
//对于群而言,如果消息数目返回的数值小于请求的cnt,则表示群的消息能拉取的到头了,更早的消息没有权限拉取。
//如果msg_cnt 和 msg_id_begin计算得到的最早消息id与实际返回的最早消息id不一致,说明服务器消息有缺失,需要
//客户端做一个缺失标记,避免下次再次拉取。
message IMGetMsgListRsp{
//cmd id: 0x030a
uint64 user_id = 1;
IM.BaseDefine.SessionType session_type = 2;
uint64 session_id = 3;
uint64 msg_id_begin = 4;
repeated IM.BaseDefine.MsgInfo msg_list = 5;
bytes attach_data = 20;
}
message IMGetLatestMsgIdReq{
//cmd id: 0x030b
uint64 user_id = 1;
IM.BaseDefine.SessionType session_type = 2;
uint64 session_id = 3;
bytes attach_data = 20;
}
message IMGetLatestMsgIdRsp{
//cmd id: 0x030c
uint64 user_id = 1;
IM.BaseDefine.SessionType session_type = 2;
uint64 session_id = 3;
uint64 latest_msg_id = 4;
bytes attach_data = 20;
}
message IMGetMsgByIdReq{
//cmd id: 0x030d
uint64 user_id = 1;
IM.BaseDefine.SessionType session_type = 2;
uint64 session_id = 3;
repeated uint64 msg_id_list = 4;
bytes attach_data = 20;
}
message IMGetMsgByIdRsp{
//cmd id: 0x030e
uint64 user_id = 1;
IM.BaseDefine.SessionType session_type = 2;
uint64 session_id = 3;
repeated IM.BaseDefine.MsgInfo msg_list = 4;
bytes attach_data = 20;
}