Skip to content

Conversation

iceljc
Copy link
Collaborator

@iceljc iceljc commented Aug 28, 2023

Add mongo storeage

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
Copy link
Contributor

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:

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; }
Copy link
Member

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,
Copy link
Member

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; }
Copy link
Member

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; }
Copy link
Member

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)
Copy link
Member

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")]
Copy link
Member

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")]
Copy link
Member

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")]
Copy link
Member

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")]
Copy link
Member

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" />
Copy link
Member

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
Copy link
Member

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?

@Oceania2018 Oceania2018 merged commit 5f27c9c into SciSharp:master Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants