mirror of
https://github.com/Shchoholiev/shopping-assistant-api.git
synced 2025-04-12 01:48:49 +00:00
SA-33 comments and some changes added
This commit is contained in:
parent
fcc5f02c48
commit
962ab03c4c
@ -7,10 +7,11 @@ namespace ShoppingAssistantApi.Application.IServices;
|
|||||||
|
|
||||||
public interface IProductService
|
public interface IProductService
|
||||||
{
|
{
|
||||||
IAsyncEnumerable<(List<ProductName> ProductNames, WishlistDto Wishlist)> StartNewSearchAndReturnWishlist(Message message, CancellationToken cancellationToken);
|
|
||||||
|
|
||||||
IAsyncEnumerable<ServerSentEvent> SearchProductAsync(string wishlistId, MessageCreateDto message, CancellationToken cancellationToken);
|
IAsyncEnumerable<ServerSentEvent> SearchProductAsync(string wishlistId, MessageCreateDto message, CancellationToken cancellationToken);
|
||||||
|
|
||||||
|
// TODO remove all methods below
|
||||||
|
IAsyncEnumerable<(List<ProductName> ProductNames, WishlistDto Wishlist)> StartNewSearchAndReturnWishlist(Message message, CancellationToken cancellationToken);
|
||||||
|
|
||||||
IAsyncEnumerable<string> GetProductFromSearch(Message message, CancellationToken cancellationToken);
|
IAsyncEnumerable<string> GetProductFromSearch(Message message, CancellationToken cancellationToken);
|
||||||
|
|
||||||
IAsyncEnumerable<string> GetRecommendationsForProductFromSearchStream(Message message,
|
IAsyncEnumerable<string> GetRecommendationsForProductFromSearchStream(Message message,
|
||||||
|
@ -7,6 +7,4 @@ public class Wishlist : EntityBase
|
|||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
|
|
||||||
public ICollection<Message>? Messages { get; set; }
|
|
||||||
}
|
}
|
||||||
|
@ -24,14 +24,15 @@ public class ProductService : IProductService
|
|||||||
_openAiService = openAiService;
|
_openAiService = openAiService;
|
||||||
_wishlistsService = wishlistsService;
|
_wishlistsService = wishlistsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IAsyncEnumerable<ServerSentEvent> SearchProductAsync(string wishlistId, MessageCreateDto message, CancellationToken cancellationToken)
|
public IAsyncEnumerable<ServerSentEvent> SearchProductAsync(string wishlistId, MessageCreateDto message, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// get all messages from wishlist
|
// Documentation: https://shchoholiev.atlassian.net/l/cp/JizkynhU
|
||||||
|
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: remove all methods below
|
||||||
public async IAsyncEnumerable<(List<ProductName> ProductNames, WishlistDto Wishlist)> StartNewSearchAndReturnWishlist(Message message, CancellationToken cancellationToken)
|
public async IAsyncEnumerable<(List<ProductName> ProductNames, WishlistDto Wishlist)> StartNewSearchAndReturnWishlist(Message message, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
List<OpenAiMessage> messages = new List<OpenAiMessage>()
|
List<OpenAiMessage> messages = new List<OpenAiMessage>()
|
||||||
|
@ -187,25 +187,6 @@ public class DbInitialaizer
|
|||||||
Name = "Gaming PC",
|
Name = "Gaming PC",
|
||||||
Type = WishlistTypes.Product.ToString(),
|
Type = WishlistTypes.Product.ToString(),
|
||||||
CreatedById = user1.Id,
|
CreatedById = user1.Id,
|
||||||
Messages = new Message[]
|
|
||||||
{
|
|
||||||
new Message
|
|
||||||
{
|
|
||||||
Text = "Prompt",
|
|
||||||
Role = MessageRoles.User.ToString(),
|
|
||||||
WishlistId = ObjectId.Parse("ab79cde6f69abcd3efab65cd"),
|
|
||||||
CreatedById = user1.Id,
|
|
||||||
CreatedDateUtc = DateTime.UtcNow
|
|
||||||
},
|
|
||||||
new Message
|
|
||||||
{
|
|
||||||
Text = "Answer",
|
|
||||||
Role = MessageRoles.Application.ToString(),
|
|
||||||
WishlistId = ObjectId.Parse("ab79cde6f69abcd3efab65cd"),
|
|
||||||
CreatedById = user1.Id,
|
|
||||||
CreatedDateUtc = DateTime.UtcNow
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
new Wishlist
|
new Wishlist
|
||||||
{
|
{
|
||||||
@ -213,17 +194,6 @@ public class DbInitialaizer
|
|||||||
Name = "Generic Wishlist Name",
|
Name = "Generic Wishlist Name",
|
||||||
Type = WishlistTypes.Product.ToString(),
|
Type = WishlistTypes.Product.ToString(),
|
||||||
CreatedById = user2.Id,
|
CreatedById = user2.Id,
|
||||||
Messages = new Message[]
|
|
||||||
{
|
|
||||||
new Message
|
|
||||||
{
|
|
||||||
Text = "Prompt",
|
|
||||||
Role = MessageRoles.User.ToString(),
|
|
||||||
WishlistId = ObjectId.Parse("ab6c2c2d9edf39abcd1ef9ab"),
|
|
||||||
CreatedById = user1.Id,
|
|
||||||
CreatedDateUtc = DateTime.UtcNow
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user