ASC.Data.Reassigns: ReassignProgressItem: run ReassignStorage method

This commit is contained in:
Andrey Savihin 2023-06-28 16:14:30 +03:00
parent 00a88c9486
commit 4f1a68d440
3 changed files with 13 additions and 6 deletions

View File

@ -12,6 +12,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
<ProjectReference Include="..\..\web\ASC.Web.Core\ASC.Web.Core.csproj" />
<ProjectReference Include="..\ASC.Data.Storage\ASC.Data.Storage.csproj" />
</ItemGroup>

View File

@ -36,8 +36,9 @@ global using ASC.Data.Storage;
global using ASC.MessagingSystem.Core;
global using ASC.MessagingSystem.EF.Model;
global using ASC.Web.Core;
global using ASC.Web.Core.Users;
global using ASC.Web.Studio.Core.Notify;
global using ASC.Web.Core.Users;
global using ASC.Web.Files.Services.WCFService;
global using ASC.Web.Studio.Core.Notify;
global using Microsoft.AspNetCore.Http;
global using Microsoft.Extensions.DependencyInjection;

View File

@ -44,10 +44,10 @@ public class ReassignProgressItem : DistributedTaskProgress
public ReassignProgressItem(
IServiceScopeFactory serviceScopeFactory,
IDictionary<string, StringValues> httpHeaders,
int tenantId, Guid fromUserId, Guid toUserId, Guid currentUserId, bool deleteProfile)
int tenantId, Guid fromUserId, Guid toUserId, Guid currentUserId, bool deleteProfile)
{
_serviceScopeFactory = serviceScopeFactory;
_httpHeaders = httpHeaders;
_httpHeaders = httpHeaders;
//_docService = Web.Files.Classes.Global.FileStorageService;
//_projectsReassign = new ProjectsReassign();
@ -73,7 +73,7 @@ public class ReassignProgressItem : DistributedTaskProgress
await using var scope = _serviceScopeFactory.CreateAsyncScope();
var scopeClass = scope.ServiceProvider.GetService<ReassignProgressItemScope>();
var queueWorkerRemove = scope.ServiceProvider.GetService<QueueWorkerRemove>();
var (tenantManager, coreBaseSettings, messageService, studioNotifyService, securityContext, userManager, userPhotoManager, displayUserSettingsHelper, messageTarget, options) = scopeClass;
var (tenantManager, coreBaseSettings, messageService, fileStorageService, studioNotifyService, securityContext, userManager, userPhotoManager, displayUserSettingsHelper, messageTarget, options) = scopeClass;
var logger = options.CreateLogger("ASC.Web");
await tenantManager.SetCurrentTenantAsync(_tenantId);
@ -88,7 +88,7 @@ public class ReassignProgressItem : DistributedTaskProgress
logger.LogInformation("reassignment of data from documents");
await fileStorageService.ReassignStorageAsync<object>(FromUser, ToUser);
//_docService.ReassignStorage(_fromUserId, _toUserId);
Percentage = 33;
PublishChanges();
@ -200,6 +200,7 @@ public class ReassignProgressItemScope
private readonly TenantManager _tenantManager;
private readonly CoreBaseSettings _coreBaseSettings;
private readonly MessageService _messageService;
private readonly FileStorageService _fileStorageService;
private readonly StudioNotifyService _studioNotifyService;
private readonly SecurityContext _securityContext;
private readonly UserManager _userManager;
@ -211,6 +212,7 @@ public class ReassignProgressItemScope
public ReassignProgressItemScope(TenantManager tenantManager,
CoreBaseSettings coreBaseSettings,
MessageService messageService,
FileStorageService fileStorageService,
StudioNotifyService studioNotifyService,
SecurityContext securityContext,
UserManager userManager,
@ -222,6 +224,7 @@ public class ReassignProgressItemScope
_tenantManager = tenantManager;
_coreBaseSettings = coreBaseSettings;
_messageService = messageService;
_fileStorageService = fileStorageService;
_studioNotifyService = studioNotifyService;
_securityContext = securityContext;
_userManager = userManager;
@ -234,6 +237,7 @@ public class ReassignProgressItemScope
public void Deconstruct(out TenantManager tenantManager,
out CoreBaseSettings coreBaseSettings,
out MessageService messageService,
out FileStorageService fileStorageService,
out StudioNotifyService studioNotifyService,
out SecurityContext securityContext,
out UserManager userManager,
@ -245,6 +249,7 @@ public class ReassignProgressItemScope
tenantManager = _tenantManager;
coreBaseSettings = _coreBaseSettings;
messageService = _messageService;
fileStorageService = _fileStorageService;
studioNotifyService = _studioNotifyService;
securityContext = _securityContext;
userManager = _userManager;