Admin ItemDeleter, Logging

This commit is contained in:
2023-07-26 11:30:26 +02:00
parent 66113ee9a0
commit 3de71cbdbe
15 changed files with 157 additions and 27 deletions

View File

@@ -0,0 +1,17 @@
using FileTime.Core.Models;
using FileTime.Server.Common;
namespace FileTime.Providers.Remote;
public class RemoteItemDeleter : IRemoteItemDeleter
{
private IRemoteConnection _remoteConnection = null!;
private string _remoteContentProviderId = null!;
public void Init(IRemoteConnection remoteConnection, string remoteContentProviderId)
{
_remoteConnection = remoteConnection;
_remoteContentProviderId = remoteContentProviderId;
}
public async Task DeleteAsync(IRemoteContentProvider contentProvider, FullName fullName)
=> await _remoteConnection.DeleteItemAsync(_remoteContentProviderId, fullName);
}

View File

@@ -10,6 +10,7 @@ public static class Startup
{
serviceCollection.TryAddSingleton<IRemoteContentProvider, RemoteContentProvider>();
serviceCollection.TryAddTransient<IRemoteItemCreator, RemoteItemCreator>();
serviceCollection.TryAddTransient<IRemoteItemDeleter, RemoteItemDeleter>();
return serviceCollection;
}