feat: add support for request ID tracking across services
- Implemented request ID handling in various services and handlers to improve traceability of requests. - Added new AuthOptions endpoint to expose WxWork and OIDC configuration options. - Updated message and event logging to include request ID for better debugging. - Enhanced login form to dynamically show available authentication options based on server configuration. - Introduced utility functions for normalizing and ensuring valid request IDs. - Updated tests to verify request ID functionality in message sending and event logging.
This commit is contained in:
@@ -385,6 +385,7 @@ type ConversationReadState struct {
|
||||
type Message struct {
|
||||
ID int64 `gorm:"primaryKey;autoIncrement"`
|
||||
ConversationID int64 `gorm:"type:bigint;not null;index;uniqueIndex:uk_conversation_seq;uniqueIndex:uk_conversation_client_msg"`
|
||||
RequestID string `gorm:"type:varchar(128);not null;default:'';index"`
|
||||
ClientMsgID string `gorm:"type:varchar(128);not null;default:'';uniqueIndex:uk_conversation_client_msg"`
|
||||
SenderType enums.IMSenderType `gorm:"type:varchar(30);not null;default:'';index"`
|
||||
SenderID int64 `gorm:"type:bigint;not null;default:0;index"`
|
||||
@@ -552,6 +553,7 @@ type Channel struct {
|
||||
type ConversationEventLog struct {
|
||||
ID int64 `gorm:"primaryKey;autoIncrement"`
|
||||
ConversationID int64 `gorm:"type:bigint;not null;index"`
|
||||
RequestID string `gorm:"type:varchar(128);not null;default:'';index"`
|
||||
EventType enums.IMEventType `gorm:"type:varchar(50);not null;default:'';index"`
|
||||
OperatorType enums.IMSenderType `gorm:"type:varchar(30);not null;default:'';index"`
|
||||
OperatorID int64 `gorm:"type:bigint;not null;default:0;index"`
|
||||
@@ -839,6 +841,7 @@ type AgentRunLog struct {
|
||||
ID int64 `gorm:"primaryKey;autoIncrement"`
|
||||
ConversationID int64 `gorm:"type:bigint;not null;default:0;index"`
|
||||
MessageID int64 `gorm:"type:bigint;not null;default:0;index"`
|
||||
RequestID string `gorm:"type:varchar(128);not null;default:'';index"`
|
||||
AIAgentID int64 `gorm:"type:bigint;not null;default:0;index"`
|
||||
AIConfigID int64 `gorm:"type:bigint;not null;default:0;index"`
|
||||
UserMessage string `gorm:"type:longtext"`
|
||||
|
||||
Reference in New Issue
Block a user