-
-
Notifications
You must be signed in to change notification settings - Fork 579
Features/add mongo implementation #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features/add mongo implementation #119
Conversation
join ua in db.UserAgent on a.Id equals ua.AgentId | ||
where ua.UserId == _user.Id | ||
join u in db.User on ua.UserId equals u.Id | ||
where u.ExternalId == _user.Id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shuld be compatible with u.id == _user.Id
.
Reference this fix:
BotSharp/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs
Line 14 in 2698830
where ua.UserId == _user.Id || u.ExternalId == _user.Id |
public string AgentId { get; set; } = string.Empty; | ||
public string UserId { get; set; } = string.Empty; | ||
public string Title { get; set; } = string.Empty; | ||
public string Dialog { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we seperate Dialog to another collection? It will be optimized if UI only needs the conversation list.
UserId = conv.UserId, | ||
Id = conv.Id, | ||
Title = conv.Title, | ||
Dialog = conv.Dialog, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dialog should be in seperate collection.
{ | ||
public class RecordBase | ||
{ | ||
public string? Id { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is Id
nullable? we can set the default as Guid.Empty
|
||
[MaxLength(36)] | ||
public string? ExternalId { get; set; } | ||
public string ExternalId { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExternalId should be string?
. It's nullable
.
|
||
public static class ListExtenstion | ||
{ | ||
public static bool IsEmpty<T>(this IEnumerable<T> strList) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the name IsNullOrEmpty
better?
_routingService = routingService; | ||
} | ||
|
||
[HttpPost("/routing-items")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better /routing/items
?
return savedItems.Select(x => RoutingItemViewModel.FromRoutingItem(x)).ToList(); | ||
} | ||
|
||
[HttpPost("/routing-profiles")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/routing/profiles
return savedProfiles.Select(x => RoutingProfileViewModel.FromRoutingProfile(x)).ToList(); | ||
} | ||
|
||
[HttpDelete("/routing-items")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/routing/items
await _routingService.DeleteRoutingItems(); | ||
} | ||
|
||
[HttpDelete("/routing-profiles")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/routing/profiles/
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0-preview.7.23375.6" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we only use v6.0.0
namespace BotSharp.Plugin.MongoStorage; | ||
|
||
[BsonIgnoreExtraElements(Inherited = true)] | ||
public class MongoBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between MongoBase
with RecordBase
?
Add mongo storeage