You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.9 KiB
52 lines
1.9 KiB
syntax = "proto3";
|
|
package message;
|
|
option go_package = "message";
|
|
|
|
message douyin_message_chat_request {
|
|
int64 to_user_id = 1; // 对方用户id
|
|
int64 user_id = 2; // 发出动作的user id
|
|
int64 pre_msg_time = 3; // 上次最新消息的时间
|
|
}
|
|
|
|
message douyin_message_chat_response {
|
|
int32 status_code = 1; // 状态码,0-成功,其他-失败
|
|
string status_msg = 2; // 返回状态描述
|
|
repeated Message message_list = 3; // 消息列表
|
|
}
|
|
|
|
message Message {
|
|
int64 id = 1; // 消息id
|
|
int64 to_user_id = 2; // 该消息接收者的id
|
|
int64 from_user_id =3; // 该消息发送者的id
|
|
string content = 4; // 消息内容
|
|
int64 create_time = 5; // 消息创建时间
|
|
}
|
|
|
|
message douyin_message_action_request {
|
|
int64 to_user_id = 1; // 对方用户id
|
|
int64 user_id = 2; // 发消息的user id
|
|
int32 action_type = 3; // 1-发送消息
|
|
string content = 4; // 消息内容
|
|
}
|
|
|
|
message douyin_message_action_response {
|
|
int32 status_code = 1; // 状态码,0-成功,其他-失败
|
|
string status_msg = 2; // 返回状态描述
|
|
}
|
|
|
|
message douyin_friend_list_message_request {
|
|
int64 user_id = 1; // 要判断的主要用户
|
|
repeated int64 friend_id_list = 2; // 要判断的好友id列表
|
|
}
|
|
|
|
message douyin_friend_list_message_response {
|
|
int32 status_code = 1; // 状态码,0-成功,其他-失败
|
|
string status_msg = 2; // 返回状态描述
|
|
map<int64, Message> result = 3; // key 为好友id,value 为和该好友的最新聊天消息
|
|
}
|
|
|
|
service MessageService {
|
|
rpc MessageChat(douyin_message_chat_request) returns (douyin_message_chat_response); // 聊天记录
|
|
rpc MessageAction(douyin_message_action_request) returns (douyin_message_action_response); // 消息操作
|
|
rpc MessageFriendList(douyin_friend_list_message_request) returns (douyin_friend_list_message_response); // 最新消息
|
|
}
|
|
|