统一Redis消息结构体字段为驼峰camelCase
This commit is contained in:
@@ -10,48 +10,48 @@ type HistoryMessage struct {
|
|||||||
|
|
||||||
// SendStreamMessage 发送到 Redis Stream 的消息结构
|
// SendStreamMessage 发送到 Redis Stream 的消息结构
|
||||||
type SendStreamMessage struct {
|
type SendStreamMessage struct {
|
||||||
UserId string `json:"user_id"` // 用户ID
|
UserId string `json:"userId"` // 用户ID
|
||||||
Content string `json:"content"` // 消息内容
|
Content string `json:"content"` // 消息内容
|
||||||
Timestamp int64 `json:"timestamp"` // 时间戳(秒)
|
Timestamp int64 `json:"timestamp"` // 时间戳(秒)
|
||||||
MessageId string `json:"message_id"` // 消息唯一ID
|
MessageId string `json:"messageId"` // 消息唯一ID
|
||||||
Platform string `json:"platform,omitempty"` // 平台标识
|
Platform string `json:"platform,omitempty"` // 平台标识
|
||||||
AccountId string `json:"account_id,omitempty"` // 账号ID
|
AccountId string `json:"accountId,omitempty"` // 账号ID
|
||||||
TenantId string `json:"tenant_id,omitempty"` // 租户ID(数据隔离)
|
TenantId string `json:"tenantId,omitempty"` // 租户ID(数据隔离)
|
||||||
AccountName string `json:"account_name,omitempty"` // 客服账号名称
|
AccountName string `json:"accountName,omitempty"` // 客服账号名称
|
||||||
ChatId string `json:"chat_id,omitempty"` // RAGFlow Chat ID(从ragflow_config查询)
|
ChatId string `json:"chatId,omitempty"` // RAGFlow Chat ID(从ragflow_config查询)
|
||||||
ReplyQueue string `json:"reply_queue,omitempty"` // 响应队列名称(支持多实例独立队列)
|
ReplyQueue string `json:"replyQueue,omitempty"` // 响应队列名称(支持多实例独立队列)
|
||||||
History []HistoryMessage `json:"history,omitempty"` // 历史对话(归档后恢复时携带)
|
History []HistoryMessage `json:"history,omitempty"` // 历史对话(归档后恢复时携带)
|
||||||
}
|
}
|
||||||
|
|
||||||
// BatchStreamMessage 批量消息结构
|
// BatchStreamMessage 批量消息结构
|
||||||
type BatchStreamMessage struct {
|
type BatchStreamMessage struct {
|
||||||
UserId string `json:"user_id"` // 用户ID
|
UserId string `json:"userId"` // 用户ID
|
||||||
Content string `json:"content"` // 消息内容
|
Content string `json:"content"` // 消息内容
|
||||||
Timestamp int64 `json:"timestamp"` // 时间戳(秒)
|
Timestamp int64 `json:"timestamp"` // 时间戳(秒)
|
||||||
BatchId string `json:"batch_id"` // 批次ID
|
BatchId string `json:"batchId"` // 批次ID
|
||||||
Index int `json:"index"` // 批次内序号
|
Index int `json:"index"` // 批次内序号
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResponseStreamMessage RAGFlow 响应消息结构(MQ 消息)
|
// ResponseStreamMessage RAGFlow 响应消息结构(MQ 消息)
|
||||||
type ResponseStreamMessage struct {
|
type ResponseStreamMessage struct {
|
||||||
UserId string `json:"user_id"` // 用户ID
|
UserId string `json:"userId"` // 用户ID
|
||||||
Platform string `json:"platform"` // 平台标识
|
Platform string `json:"platform"` // 平台标识
|
||||||
TenantId string `json:"tenant_id"` // 租户ID
|
TenantId string `json:"tenantId"` // 租户ID
|
||||||
Question string `json:"question"` // 用户问题
|
Question string `json:"question"` // 用户问题
|
||||||
Content string `json:"content"` // RAGFlow 回复内容
|
Content string `json:"content"` // RAGFlow 回复内容
|
||||||
SessionId string `json:"session_id"` // RAGFlow Session ID
|
SessionId string `json:"sessionId"` // RAGFlow Session ID
|
||||||
Timestamp int64 `json:"timestamp"` // 时间戳(秒)
|
Timestamp int64 `json:"timestamp"` // 时间戳(秒)
|
||||||
MessageId string `json:"message_id"` // 原始消息ID
|
MessageId string `json:"messageId"` // 原始消息ID
|
||||||
}
|
}
|
||||||
|
|
||||||
// FollowUpMessage 追问消息结构(RabbitMQ 延时队列)
|
// FollowUpMessage 追问消息结构(RabbitMQ 延时队列)
|
||||||
type FollowUpMessage struct {
|
type FollowUpMessage struct {
|
||||||
TenantId string `json:"tenant_id"` // 租户ID
|
TenantId string `json:"tenantId"` // 租户ID
|
||||||
UserId string `json:"user_id"` // 用户ID
|
UserId string `json:"userId"` // 用户ID
|
||||||
Platform string `json:"platform"` // 平台标识
|
Platform string `json:"platform"` // 平台标识
|
||||||
Content string `json:"content"` // 追问内容
|
Content string `json:"content"` // 追问内容
|
||||||
FollowUpType int `json:"follow_up_type"` // 追问类型:1=30s, 2=60s, 3=180s
|
FollowUpType int `json:"followUpType"` // 追问类型:1=30s, 2=60s, 3=180s
|
||||||
Timestamp int64 `json:"timestamp"` // 发送时间戳
|
Timestamp int64 `json:"timestamp"` // 发送时间戳
|
||||||
}
|
}
|
||||||
|
|
||||||
// 追问类型常量
|
// 追问类型常量
|
||||||
@@ -91,10 +91,10 @@ func GetFollowUpDelay(followUpType int) int {
|
|||||||
|
|
||||||
// ArchiveMessage 会话归档消息结构(RabbitMQ 延时队列)
|
// ArchiveMessage 会话归档消息结构(RabbitMQ 延时队列)
|
||||||
type ArchiveMessage struct {
|
type ArchiveMessage struct {
|
||||||
UserId string `json:"user_id"` // 用户ID
|
UserId string `json:"userId"` // 用户ID
|
||||||
Platform string `json:"platform"` // 平台标识
|
Platform string `json:"platform"` // 平台标识
|
||||||
SessionId string `json:"session_id"` // RAGFlow Session ID
|
SessionId string `json:"sessionId"` // RAGFlow Session ID
|
||||||
Timestamp int64 `json:"timestamp"` // 发送时间戳
|
Timestamp int64 `json:"timestamp"` // 发送时间戳
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetArchiveDelay 获取归档延时(从 config 包读取)
|
// GetArchiveDelay 获取归档延时(从 config 包读取)
|
||||||
|
|||||||
Reference in New Issue
Block a user