BotSharp/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationAttachmentService.cs
2023-11-09 15:11:36 -06:00

29 lines
790 B
C#

using BotSharp.Abstraction.Repositories;
using System.IO;
namespace BotSharp.Core.Conversations.Services;
public class ConversationAttachmentService : IConversationAttachmentService
{
private readonly BotSharpDatabaseSettings _dbSettings;
private readonly IServiceProvider _services;
public ConversationAttachmentService(
BotSharpDatabaseSettings dbSettings,
IServiceProvider services)
{
_dbSettings = dbSettings;
_services = services;
}
public string GetDirectory(string conversationId)
{
var dir = Path.Combine(_dbSettings.FileRepository, "conversations", conversationId, "attachments");
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
return dir;
}
}