29 lines
790 B
C#
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;
|
|
}
|
|
}
|