Files
weiyu/deploy/protobuf/message.proto
2025-08-07 10:01:14 +08:00

61 lines
1.7 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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]