GetConversations() add channelId query condition
This commit is contained in:
parent
fd2b5d1b01
commit
34658d4468
|
|
@ -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; }
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue