Skip to content

Commit

Permalink
Remove watermark features from VirtualRoomsController
Browse files Browse the repository at this point in the history
Removed all code and references related to watermark settings, methods, and helpers from the VirtualRoomsController. This includes API endpoints for adding, retrieving, and deleting watermarks, as well as related DTO helpers.
  • Loading branch information
pavelbannov committed Oct 25, 2024
1 parent 9452800 commit 50ff775
Showing 1 changed file with 2 additions and 60 deletions.
62 changes: 2 additions & 60 deletions products/ASC.Files/Server/Api/VirtualRoomsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class VirtualRoomsInternalController(
FolderDtoHelper folderDtoHelper,
FileDtoHelper fileDtoHelper,
FileShareDtoHelper fileShareDtoHelper,
WatermarkDtoHelper watermarkDtoHelper,
IMapper mapper,
SocketManager socketManager,
ApiContext apiContext,
Expand All @@ -55,7 +54,6 @@ public class VirtualRoomsInternalController(
folderDtoHelper,
fileDtoHelper,
fileShareDtoHelper,
watermarkDtoHelper,
mapper,
socketManager,
apiContext,
Expand Down Expand Up @@ -94,7 +92,6 @@ public class VirtualRoomsThirdPartyController(
FolderDtoHelper folderDtoHelper,
FileDtoHelper fileDtoHelper,
FileShareDtoHelper fileShareDtoHelper,
WatermarkDtoHelper watermarkDtoHelper,
IMapper mapper,
SocketManager socketManager,
ApiContext apiContext,
Expand All @@ -111,7 +108,6 @@ public class VirtualRoomsThirdPartyController(
folderDtoHelper,
fileDtoHelper,
fileShareDtoHelper,
watermarkDtoHelper,
mapper,
socketManager,
apiContext,
Expand Down Expand Up @@ -150,7 +146,6 @@ public abstract class VirtualRoomsController<T>(
FolderDtoHelper folderDtoHelper,
FileDtoHelper fileDtoHelper,
FileShareDtoHelper fileShareDtoHelper,
WatermarkDtoHelper watermarkDtoHelper,
IMapper mapper,
SocketManager socketManager,
ApiContext apiContext,
Expand Down Expand Up @@ -506,43 +501,7 @@ public async Task<FolderDto<T>> DeleteTagsAsync(T id, BatchTagsRequestDto inDto)

return await _folderDtoHelper.GetAsync(room);
}

/// <summary>
/// Adds the watermarks settings to a room with the ID specified in the request.
/// </summary>
/// <short>Add room watermarks settings</short>
/// <category>Rooms</category>
/// <param type="System.Int32, System" method="url" name="id">Room ID</param>
/// <param type="ASC.Files.Core.ApiModels.RequestDto.WatermarkRequestDto, ASC.Files.Core" name="inDto">Request parameters for adding watermarks</param>
/// <returns type="ASC.Files.Core.ApiModels.ResponseDto.WatermarkDto, ASC.Files.Core">Room information</returns>
/// <path>api/2.0/files/rooms/{id}/watermark</path>
/// <httpMethod>PUT</httpMethod>
[HttpPut("{id}/watermark")]
public async Task<WatermarkDto> AddWaterMarksAsync(T id, WatermarkRequestDto inDto)
{
var watermarkSettings = await watermarkManager.SetWatermarkAsync(id, inDto);

return watermarkDtoHelper.Get(watermarkSettings);
}

/// <summary>
/// Returns the watermark information.
/// </summary>
/// <short>Get watermark information</short>
/// <category>Rooms</category>
/// <param type="System.Int32, System" method="url" name="id">Room ID</param>
/// <returns type="ASC.Files.Core.ApiModels.ResponseDto.WatermarkDto, ASC.Files.Core">Watermark information</returns>
/// <path>api/2.0/files/rooms/{id}/watermark</path>
/// <httpMethod>GET</httpMethod>
[AllowAnonymous]
[HttpGet("{id}/watermark")]
public async Task<WatermarkDto> GetWatermarkInfoAsync(T id)
{
var room = await _fileStorageService.GetFolderAsync(id).NotFoundIfNull("Folder not found");
var watermarkSettings = await watermarkManager.GetWatermarkAsync(room);

return watermarkDtoHelper.Get(watermarkSettings);
}


/// <summary>
/// Removes the watermarks from a room with the ID specified in the request.
Expand All @@ -558,6 +517,7 @@ public async Task DeleteWatermarkAsync(T id)
{
await watermarkManager.DeleteWatermarkAsync(id);
}

/// <summary>
/// Creates a logo for a room with the ID specified in the request.
/// </summary>
Expand Down Expand Up @@ -667,24 +627,6 @@ public async Task ResendEmailInvitationsAsync(T id, UserInvitationRequestDto inD
await _fileStorageService.ResendEmailInvitationsAsync(id, inDto.UsersIds, inDto.ResendAll);
}

[HttpPut("{id}/settings")]
public async Task<FolderDto<T>> UpdateSettingsAsync(T id, SettingsRoomRequestDto inDto)
{
var room = await _fileStorageService.SetRoomSettingsAsync(id, inDto.Indexing, inDto.DenyDownload);

return await _folderDtoHelper.GetAsync(room);
}

[HttpPut("{id}/lifetime")]
public async Task<FolderDto<T>> UpdateLifetimeSettingsAsync(T id, RoomDataLifetimeDto inDto = null)
{
var lifetime = _mapper.Map<RoomDataLifetimeDto, RoomDataLifetime>(inDto);

var room = await _fileStorageService.SetRoomLifetimeSettingsAsync(id, lifetime);

return await _folderDtoHelper.GetAsync(room);
}

[HttpPut("{id}/reorder")]
public async Task<FolderDto<T>> ReorderAsync(T id)
{
Expand Down

0 comments on commit 50ff775

Please sign in to comment.