Add a CallingPhone column to the ConversationDocument

This commit is contained in:
易磊 2024-10-22 09:05:56 +08:00 committed by GitHub
parent 3d8d16404f
commit 15ce459971
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 0 deletions

View file

@ -28,6 +28,8 @@ public class Conversation
public List<string> Tags { get; set; } = new();
public string CallingPhone { get; set; }
public DateTime UpdatedTime { get; set; } = DateTime.UtcNow;
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
}

View file

@ -172,10 +172,12 @@ public partial class ConversationService : IConversationService
{
var state = _services.GetRequiredService<IConversationStateService>();
var channel = state.GetState("channel");
var callingPhone = state.GetState("calling_phone");
var sess = new Conversation
{
Id = _conversationId,
Channel = channel,
CallingPhone = callingPhone,
AgentId = agentId
};
converation = await NewConversation(sess);

View file

@ -10,6 +10,7 @@ public class ConversationDocument : MongoBase
public string Status { get; set; }
public int DialogCount { get; set; }
public List<string> Tags { get; set; }
public string CallingPhone { get; set; }
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
}

View file

@ -17,6 +17,7 @@ public partial class MongoRepository
UserId = !string.IsNullOrEmpty(conversation.UserId) ? conversation.UserId : string.Empty,
Title = conversation.Title,
Channel = conversation.Channel,
CallingPhone = conversation.CallingPhone,
TaskId = conversation.TaskId,
Status = conversation.Status,
Tags = conversation.Tags ?? new(),