Fix after merge

This commit is contained in:
Maksim Chegulov 2022-06-08 16:38:34 +03:00
parent b693779ea1
commit e2ba706d71
3 changed files with 56 additions and 23 deletions

View File

@ -38,7 +38,7 @@ public class RoomLogoManager
private static Size _smallLogoSize = new Size(32, 32);
private readonly IDaoFactory _daoFactory;
private readonly FileSecurity _fileSecurity;
private readonly ILog _logger;
private readonly ILogger<RoomLogoManager> _logger;
private readonly StorageFactory _storageFactory;
private readonly TenantManager _tenantManager;
private IDataStore _dataStore;
@ -49,7 +49,7 @@ public class RoomLogoManager
private static readonly TimeSpan _cacheLifeTime = TimeSpan.FromMinutes(30);
private readonly IHttpContextAccessor _httpContextAccessor;
public RoomLogoManager(StorageFactory storageFactory, TenantManager tenantManager, IDaoFactory daoFactory, FileSecurity fileSecurity, ILog logger, AscCache cache, FilesMessageService filesMessageService, IHttpContextAccessor httpContextAccessor)
public RoomLogoManager(StorageFactory storageFactory, TenantManager tenantManager, IDaoFactory daoFactory, FileSecurity fileSecurity, ILogger<RoomLogoManager> logger, AscCache cache, FilesMessageService filesMessageService, IHttpContextAccessor httpContextAccessor)
{
_storageFactory = storageFactory;
_tenantManager = tenantManager;
@ -123,7 +123,7 @@ public class RoomLogoManager
}
catch (DirectoryNotFoundException e)
{
_logger.Error(e);
_logger.ErrorRemoveRoomLogo(e);
}
return room;

View File

@ -0,0 +1,33 @@
// (c) Copyright Ascensio System SIA 2010-2022
//
// This program is a free software product.
// You can redistribute it and/or modify it under the terms
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
// any third-party rights.
//
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
//
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
//
// The interactive user interfaces in modified source and object code versions of the Program must
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
//
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
// trademark law for use of our trademarks.
//
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
namespace ASC.Files.Core.Log;
public static partial class RoomLogoManagerLogger
{
[LoggerMessage(Level = LogLevel.Error, Message = "RemoveRoomLogo")]
public static partial void ErrorRemoveRoomLogo(this ILogger<RoomLogoManager> logger, Exception exception);
}

View File

@ -33,7 +33,7 @@ public class VirtualRoomsInternalController : VirtualRoomsController<int>
{
}
[Create("rooms")]
[HttpPost("rooms")]
public async Task<FolderDto<int>> CreateRoomAsync(CreateRoomRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -50,7 +50,7 @@ public class VirtualRoomsThirdpartyController : VirtualRoomsController<string>
{
}
[Create("rooms/thirdparty/{id}")]
[HttpPost("rooms/thirdparty/{id}")]
public async Task<FolderDto<string>> CreateRoomAsync(string id, CreateRoomRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -90,7 +90,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
_folderDtoHelper = folderDtoHelper;
}
[Read("rooms/{id}")]
[HttpGet("rooms/{id}")]
public async Task<FolderContentDto<T>> GetRoomAsync(T id, Guid userOrGroupId, FilterType filterType, bool searchInContent, bool withSubFolders)
{
ErrorIfNotDocSpace();
@ -98,7 +98,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _foldersControllerHelper.GetFolderAsync(id, userOrGroupId, filterType, searchInContent, withSubFolders);
}
[Update("rooms/{id}")]
[HttpPut("rooms/{id}")]
public async Task<FolderDto<T>> UpdateRoomAsync(T id, UpdateRoomRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -108,7 +108,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _folderDtoHelper.GetAsync(room);
}
[Delete("rooms/{id}")]
[HttpDelete("rooms/{id}")]
public async Task<FileOperationDto> DeleteRoomAsync(T id)
{
ErrorIfNotDocSpace();
@ -119,7 +119,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _fileOperationDtoHelper.GetAsync(operationResult);
}
[Update("rooms/{id}/archive")]
[HttpPut("rooms/{id}/archive")]
public async Task<FileOperationDto> ArchiveRoomAsync(T id)
{
ErrorIfNotDocSpace();
@ -133,7 +133,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _fileOperationDtoHelper.GetAsync(operationResult);
}
[Update("rooms/{id}/unarchive")]
[HttpPut("rooms/{id}/unarchive")]
public async Task<FileOperationDto> UnarchiveRoomAsync(T id)
{
ErrorIfNotDocSpace();
@ -147,7 +147,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _fileOperationDtoHelper.GetAsync(operationResult);
}
[Update("rooms/{id}/share")]
[HttpPut("rooms/{id}/share")]
public Task<IEnumerable<FileShareDto>> SetRoomSecurityAsync(T id, SecurityInfoRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -155,7 +155,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return _securityControllerHelper.SetFolderSecurityInfoAsync(id, inDto.Share, inDto.Notify, inDto.SharingMessage);
}
[Read("rooms/{id}/invite")]
[HttpGet("rooms/{id}/invite")]
public object GetInvitationLink(T id, InviteUserRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -163,7 +163,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return _roomLinksManager.GenerateLink(id, inDto.Email, (int)inDto.Access, inDto.EmployeeType, _authContext.CurrentAccount.ID);
}
[Update("rooms/{id}/tags")]
[HttpPut("rooms/{id}/tags")]
public async Task<FolderDto<T>> AddTagsAsync(T id, BatchTagsRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -173,7 +173,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _folderDtoHelper.GetAsync(room);
}
[Delete("rooms/{id}/tags")]
[HttpDelete("rooms/{id}/tags")]
public async Task<FolderDto<T>> DeleteTagsAsync(T id, BatchTagsRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -183,7 +183,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _folderDtoHelper.GetAsync(room);
}
[Create("rooms/{id}/logo")]
[HttpPost("rooms/{id}/logo")]
public async Task<FolderDto<T>> CreateRoomLogoAsync(T id, LogoRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -193,7 +193,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _folderDtoHelper.GetAsync(room);
}
[Delete("rooms/{id}/logo")]
[HttpDelete("rooms/{id}/logo")]
public async Task<FolderDto<T>> DeleteRoomLogoAsync(T id)
{
ErrorIfNotDocSpace();
@ -203,7 +203,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _folderDtoHelper.GetAsync(room);
}
[Update("rooms/{id}/pin")]
[HttpPut("rooms/{id}/pin")]
public async Task<FolderDto<T>> PinRoomAsync(T id)
{
ErrorIfNotDocSpace();
@ -213,7 +213,7 @@ public abstract class VirtualRoomsController<T> : ApiControllerBase
return await _folderDtoHelper.GetAsync(room);
}
[Update("rooms/{id}/unpin")]
[HttpPut("rooms/{id}/unpin")]
public async Task<FolderDto<T>> UnpinRoomAsync(T id)
{
ErrorIfNotDocSpace();
@ -257,7 +257,7 @@ public class VirtualRoomsCommonController : ApiControllerBase
_fileSizeComment = fileSizeComment;
}
[Read("rooms")]
[HttpGet("rooms")]
public async Task<FolderContentDto<int>> GetRoomsFolderAsync(RoomType type, string subjectId, bool searchInContent, bool withSubfolders, SearchArea searchArea, string tags)
{
ErrorIfNotDocSpace();
@ -293,7 +293,7 @@ public class VirtualRoomsCommonController : ApiControllerBase
return dto.NotFoundIfNull();
}
[Create("tags")]
[HttpPost("tags")]
public async Task<TagInfo> CreateTagAsync(CreateTagRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -301,7 +301,7 @@ public class VirtualRoomsCommonController : ApiControllerBase
return await _customTagsService.CreateTagAsync(inDto.Name);
}
[Read("tags")]
[HttpGet("tags")]
public async IAsyncEnumerable<TagInfo> GetTagsInfoAsync()
{
ErrorIfNotDocSpace();
@ -315,7 +315,7 @@ public class VirtualRoomsCommonController : ApiControllerBase
}
}
[Delete("tags")]
[HttpDelete("tags")]
public async Task DeleteTagsAsync(BatchTagsRequestDto inDto)
{
ErrorIfNotDocSpace();
@ -323,7 +323,7 @@ public class VirtualRoomsCommonController : ApiControllerBase
await _customTagsService.DeleteTagsAsync(inDto.TagIds);
}
[Create("logos")]
[HttpPost("logos")]
public async Task<UploadResultDto> UploadRoomLogo(IFormCollection formCollection)
{
var result = new UploadResultDto();