Files
crmdesk/deploy/protobuf/message.proto
T
2026-09-19 16:35:35 +08:00

61 lines
1.7 KiB
Protocol Buffer

syntax = "proto3";
// prevent naming conflicts between different projects.
// package protobuf.proto;
// [START java_declaration]
option java_package = "com.bytedesk.socket.protobuf.model";
option java_outer_classname = "MessageProto";
// [END java_declaration]
// 类名前缀
// [START objc_declaration]
//option objc_class_prefix = "Proto";
// [END objc_declaration]
//DoubleValue
//FloatValue
//Int64Value
//UInt64Value
//Int32Value
//UInt32Value
//BoolValue
//StringValue
//BytesValue
//import "google/protobuf/wrappers.proto";
import "user.proto";
import "thread.proto";
// import "queue.proto";
// import "group.proto";
// 注意 1: 每个字段后面的序号一旦投入生产不能随便修改
// 注意 2: 前1~15序号仅需一个字节编码,尽量用在常用字段
// 注意 3: 被删除的field要作为reserved变量,不能重新赋值
// types: bool, int32/int64/uint32/uint64/sint32/sint64/fixed32/fixed64/sfixed32/sfixed64, bytes, float, double, and string
// [START messages]
// 会话类型, 将会话类型作为topic前缀来区分,如:agent/...., user/..., group/...
// 消息三要素:1. 谁发送的消息? 2. 发送给谁的消息? 3. 发送的消息内容是什么?
message Message {
// 唯一mid
string uid = 1;
// 消息类型
string type = 2;
// 消息内容,可能是文本,图片,语音,视频,文件等,json
string content = 3;
// 消息发送状态
string status = 4;
// 时间戳
string createdAt = 5;
// 消息来源客户端
string channel = 6;
// 会话
Thread thread = 7;
// 发送者
User user = 8;
// 自定义扩展/附加信息
string extra = 9;
}
// [END messages]