BotSharp/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationAttachmentService.cs

29 lines
790 B
C#
Raw Normal View History

2023-11-09 21:11:36 +00:00
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;
}
}