GetConversations() add channelId query condition

This commit is contained in:
nick.yi 2025-04-29 13:35:48 +08:00
parent fd2b5d1b01
commit 34658d4468
3 changed files with 9 additions and 0 deletions

View file

@ -12,6 +12,7 @@ public class ConversationFilter
public string? AgentId { get; set; }
public string? Status { get; set; }
public string? Channel { get; set; }
public string? ChannelId { get; set; }
public string? UserId { get; set; }
public DateTime? StartTime { get; set; }

View file

@ -430,6 +430,10 @@ public partial class FileRepository
{
matched = matched && record.Channel == filter.Channel;
}
if(filter?.ChannelId != null)
{
matched = matched && record.ChannelId == filter.ChannelId;
}
if (filter?.UserId != null)
{
matched = matched && record.UserId == filter.UserId;

View file

@ -371,6 +371,10 @@ public partial class MongoRepository
{
convFilters.Add(convBuilder.Eq(x => x.Channel, filter.Channel));
}
if (!string.IsNullOrEmpty(filter?.ChannelId))
{
convFilters.Add(convBuilder.Eq(x => x.ChannelId, filter.ChannelId));
}
if (!string.IsNullOrEmpty(filter?.UserId))
{
convFilters.Add(convBuilder.Eq(x => x.UserId, filter.UserId));