gengx
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
package im.v1;
|
||||
option go_package = "github.com/example/xingyu/proto/im/v1;imv1";
|
||||
|
||||
enum Command {
|
||||
COMMAND_UNKNOWN = 0;
|
||||
AUTH = 1; AUTH_ACK = 2; PING = 3; PONG = 4;
|
||||
SEND_MESSAGE = 10; SEND_ACK = 11; MESSAGE_PUSH = 12; DELIVERY_ACK = 13;
|
||||
READ = 14; READ_ACK = 15; RECALL = 16; RECALL_ACK = 17;
|
||||
SYNC = 18; SYNC_ACK = 19; TYPING = 20; CONVERSATION_UPDATE = 21;
|
||||
KICK = 22; ERROR = 99;
|
||||
}
|
||||
|
||||
message Envelope {
|
||||
uint32 version = 1;
|
||||
Command command = 2;
|
||||
uint64 request_id = 3;
|
||||
uint64 user_id = 4;
|
||||
string device_id = 5;
|
||||
int64 timestamp_ms = 6;
|
||||
bytes payload = 7;
|
||||
string trace_id = 8;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
package im.v1;
|
||||
option go_package = "github.com/example/xingyu/proto/im/v1;imv1";
|
||||
|
||||
enum MessageType { MESSAGE_TYPE_UNKNOWN = 0; TEXT = 1; IMAGE = 2; VOICE = 3; VIDEO = 4; LOCATION = 5; SYSTEM = 10; RECALL_NOTICE = 11; }
|
||||
message TextContent { string text = 1; repeated uint64 mention_user_ids = 2; }
|
||||
message ImageContent { uint64 media_id = 1; uint32 width = 2; uint32 height = 3; }
|
||||
message VoiceContent { uint64 media_id = 1; uint32 duration_ms = 2; }
|
||||
message Message { uint64 message_id = 1; string client_msg_id = 2; uint64 conversation_id = 3; uint64 seq = 4; uint64 sender_id = 5; MessageType type = 6; bytes content = 7; uint64 reply_to_message_id = 8; int64 created_at_ms = 9; }
|
||||
message SendMessageRequest { string client_msg_id = 1; uint64 conversation_id = 2; MessageType type = 3; bytes content = 4; uint64 reply_to_message_id = 5; }
|
||||
message SendMessageAck { string client_msg_id = 1; uint64 message_id = 2; uint64 conversation_id = 3; uint64 seq = 4; int64 server_time_ms = 5; }
|
||||
message MessagePush { Message message = 1; string origin_device_id = 2; }
|
||||
message ReadRequest { uint64 conversation_id = 1; uint64 read_seq = 2; }
|
||||
message ReadAck { uint64 conversation_id = 1; uint64 user_id = 2; uint64 read_seq = 3; }
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package im.v1;
|
||||
option go_package = "github.com/example/xingyu/proto/im/v1;imv1";
|
||||
message SyncRequest { uint64 last_sync_seq = 1; uint32 limit = 2; }
|
||||
message SyncEvent { uint64 sync_seq = 1; uint32 event_type = 2; uint64 conversation_id = 3; uint64 message_seq = 4; bytes payload = 5; }
|
||||
message SyncResponse { repeated SyncEvent events = 1; uint64 next_sync_seq = 2; bool has_more = 3; }
|
||||
|
||||
Reference in New Issue
Block a user