2022-03-14 10:57:59 +00:00
namespace ASC.Files.Api ;
[ConstraintRoute("int")]
public class FilesControllerInternal : FilesController < int >
{
public FilesControllerInternal ( IServiceProvider serviceProvider , FilesControllerHelper < int > filesControllerHelper ) : base ( serviceProvider , filesControllerHelper )
{
}
}
public class FilesControllerThirdparty : FilesController < string >
{
public FilesControllerThirdparty ( IServiceProvider serviceProvider , FilesControllerHelper < string > filesControllerHelper ) : base ( serviceProvider , filesControllerHelper )
{
}
}
public abstract class FilesController < T > : ApiControllerBase
2022-03-03 17:33:11 +00:00
{
private readonly IServiceProvider _serviceProvider ;
2022-03-14 10:57:59 +00:00
private readonly FilesControllerHelper < T > _filesControllerHelper ;
2022-03-03 17:33:11 +00:00
2022-03-08 17:37:23 +00:00
public FilesController (
2022-03-03 17:33:11 +00:00
IServiceProvider serviceProvider ,
2022-03-14 10:57:59 +00:00
FilesControllerHelper < T > filesControllerHelper )
2022-03-03 17:33:11 +00:00
{
_serviceProvider = serviceProvider ;
2022-03-14 10:57:59 +00:00
_filesControllerHelper = filesControllerHelper ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Change version history
/// </summary>
/// <param name="fileId">File ID</param>
/// <param name="version">Version of history</param>
/// <param name="continueVersion">Mark as version or revision</param>
/// <category>Files</category>
/// <returns></returns>
[Update("file/{fileId}/history")]
2022-03-14 10:57:59 +00:00
public Task < IEnumerable < FileDto < T > > > ChangeHistoryFromBodyAsync ( T fileId , [ FromBody ] ChangeHistoryRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . ChangeHistoryAsync ( fileId , inDto . Version , inDto . ContinueVersion ) ;
2022-03-03 17:33:11 +00:00
}
[Update("file/{fileId}/history")]
[Consumes("application/x-www-form-urlencoded")]
2022-03-14 10:57:59 +00:00
public Task < IEnumerable < FileDto < T > > > ChangeHistoryFromFormAsync ( T fileId , [ FromForm ] ChangeHistoryRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . ChangeHistoryAsync ( fileId , inDto . Version , inDto . ContinueVersion ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Check conversion status
/// </summary>
/// <short>Convert</short>
/// <category>File operations</category>
/// <param name="fileId"></param>
/// <param name="start"></param>
/// <returns>Operation result</returns>
[Read("file/{fileId}/checkconversion")]
2022-03-14 10:57:59 +00:00
public IAsyncEnumerable < ConversationResultDto < T > > CheckConversionAsync ( T fileId , bool start )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . CheckConversionAsync ( new CheckConversionRequestDto < T > ( )
2022-03-03 17:33:11 +00:00
{
FileId = fileId ,
StartConvert = start
} ) ;
}
[Create("file/{fileId}/copyas", order: int.MaxValue)]
2022-03-14 10:57:59 +00:00
public object CopyFileAsFromBody ( T fileId , [ FromBody ] CopyAsRequestDto < JsonElement > inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-05 14:41:47 +00:00
return CopyFile ( fileId , inDto ) ;
2022-03-03 17:33:11 +00:00
}
[Create("file/{fileId}/copyas", order: int.MaxValue)]
[Consumes("application/x-www-form-urlencoded")]
2022-03-14 10:57:59 +00:00
public object CopyFileAsFromForm ( T fileId , [ FromForm ] CopyAsRequestDto < JsonElement > inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-05 14:41:47 +00:00
return CopyFile ( fileId , inDto ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Creates a new file in the specified folder with the title sent in the request
/// </summary>
/// <short>Create file</short>
/// <category>File Creation</category>
/// <param name="folderId">Folder ID</param>
/// <param name="title" remark="Allowed values: the file must have one of the following extensions: DOCX, XLSX, PPTX">File title</param>
/// <remarks>In case the extension for the file title differs from DOCX/XLSX/PPTX and belongs to one of the known text, spreadsheet or presentation formats, it will be changed to DOCX/XLSX/PPTX accordingly. If the file extension is not set or is unknown, the DOCX extension will be added to the file title.</remarks>
/// <returns>New file info</returns>
[Create("{folderId}/file")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > CreateFileFromBodyAsync ( T folderId , [ FromBody ] CreateFileRequestDto < JsonElement > inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . CreateFileAsync ( folderId , inDto . Title , inDto . TemplateId , inDto . EnableExternalExt ) ;
2022-03-03 17:33:11 +00:00
}
[Create("{folderId}/file")]
[Consumes("application/x-www-form-urlencoded")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > CreateFileFromFormAsync ( T folderId , [ FromForm ] CreateFileRequestDto < JsonElement > inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . CreateFileAsync ( folderId , inDto . Title , inDto . TemplateId , inDto . EnableExternalExt ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Creates an html (.html) file in the selected folder with the title and contents sent in the request
/// </summary>
/// <short>Create html</short>
/// <category>File Creation</category>
/// <param name="folderId">Folder ID</param>
/// <param name="title">File title</param>
/// <param name="content">File contents</param>
/// <returns>Folder contents</returns>
[Create("{folderId}/html")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > CreateHtmlFileFromBodyAsync ( T folderId , [ FromBody ] CreateTextOrHtmlFileRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . CreateHtmlFileAsync ( folderId , inDto . Title , inDto . Content ) ;
2022-03-03 17:33:11 +00:00
}
[Create("{folderId}/html")]
[Consumes("application/x-www-form-urlencoded")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > CreateHtmlFileFromFormAsync ( T folderId , [ FromForm ] CreateTextOrHtmlFileRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . CreateHtmlFileAsync ( folderId , inDto . Title , inDto . Content ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Creates a text (.txt) file in the selected folder with the title and contents sent in the request
/// </summary>
/// <short>Create txt</short>
/// <category>File Creation</category>
/// <param name="folderId">Folder ID</param>
/// <param name="title">File title</param>
/// <param name="content">File contents</param>
/// <returns>Folder contents</returns>
[Create("{folderId}/text")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > CreateTextFileFromBodyAsync ( T folderId , [ FromBody ] CreateTextOrHtmlFileRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . CreateTextFileAsync ( folderId , inDto . Title , inDto . Content ) ;
2022-03-03 17:33:11 +00:00
}
[Create("{folderId}/text")]
[Consumes("application/x-www-form-urlencoded")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > CreateTextFileFromFormAsync ( T folderId , [ FromForm ] CreateTextOrHtmlFileRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . CreateTextFileAsync ( folderId , inDto . Title , inDto . Content ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Deletes the file with the ID specified in the request
/// </summary>
/// <short>Delete file</short>
/// <category>Files</category>
/// <param name="fileId">File ID</param>
/// <param name="deleteAfter">Delete after finished</param>
/// <param name="immediately">Don't move to the Recycle Bin</param>
/// <returns>Operation result</returns>
[Delete("file/{fileId}", order: int.MaxValue, DisableFormat = true)]
2022-03-14 10:57:59 +00:00
public Task < IEnumerable < FileOperationDto > > DeleteFile ( T fileId , [ FromBody ] DeleteRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . DeleteFileAsync ( fileId , inDto . DeleteAfter , inDto . Immediately ) ;
2022-03-03 17:33:11 +00:00
}
[AllowAnonymous]
[Read("file/{fileId}/edit/diff")]
2022-03-14 10:57:59 +00:00
public Task < EditHistoryDataDto > GetEditDiffUrlAsync ( T fileId , int version = 0 , string doc = null )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . GetEditDiffUrlAsync ( fileId , version , doc ) ;
2022-03-03 17:33:11 +00:00
}
[AllowAnonymous]
[Read("file/{fileId}/edit/history")]
2022-03-14 10:57:59 +00:00
public Task < List < EditHistoryDto > > GetEditHistoryAsync ( T fileId , string doc = null )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . GetEditHistoryAsync ( fileId , doc ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Returns a detailed information about the file with the ID specified in the request
/// </summary>
/// <short>File information</short>
/// <category>Files</category>
/// <returns>File info</returns>
[Read("file/{fileId}", order: int.MaxValue, DisableFormat = true)]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > GetFileInfoAsync ( T fileId , int version = - 1 )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . GetFileInfoAsync ( fileId , version ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Returns the detailed information about all the available file versions with the ID specified in the request
/// </summary>
/// <short>File versions</short>
/// <category>Files</category>
/// <param name="fileId">File ID</param>
/// <returns>File information</returns>
[Read("file/{fileId}/history")]
2022-03-14 10:57:59 +00:00
public Task < IEnumerable < FileDto < T > > > GetFileVersionInfoAsync ( T fileId )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . GetFileVersionInfoAsync ( fileId ) ;
2022-03-03 17:33:11 +00:00
}
[Update("file/{fileId}/lock")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > LockFileFromBodyAsync ( T fileId , [ FromBody ] LockFileRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . LockFileAsync ( fileId , inDto . LockFile ) ;
2022-03-03 17:33:11 +00:00
}
[Update("file/{fileId}/lock")]
[Consumes("application/x-www-form-urlencoded")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > LockFileFromFormAsync ( T fileId , [ FromForm ] LockFileRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . LockFileAsync ( fileId , inDto . LockFile ) ;
2022-03-03 17:33:11 +00:00
}
[AllowAnonymous]
[Read("file/{fileId}/restoreversion")]
2022-03-14 10:57:59 +00:00
public Task < List < EditHistoryDto > > RestoreVersionAsync ( T fileId , int version = 0 , string url = null , string doc = null )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . RestoreVersionAsync ( fileId , version , url , doc ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Start conversion
/// </summary>
/// <short>Convert</short>
/// <category>File operations</category>
/// <param name="fileId"></param>
/// <returns>Operation result</returns>
[Update("file/{fileId}/checkconversion")]
2022-03-14 10:57:59 +00:00
public IAsyncEnumerable < ConversationResultDto < T > > StartConversion ( T fileId , [ FromBody ( EmptyBodyBehavior = Microsoft . AspNetCore . Mvc . ModelBinding . EmptyBodyBehavior . Allow ) ] CheckConversionRequestDto < T > inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-05 14:41:47 +00:00
if ( inDto = = null )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
inDto = new CheckConversionRequestDto < T > ( ) ;
2022-03-03 17:33:11 +00:00
}
2022-03-05 14:41:47 +00:00
inDto . FileId = fileId ;
2022-03-08 17:37:23 +00:00
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . StartConversionAsync ( inDto ) ;
2022-03-03 17:33:11 +00:00
}
[Update("file/{fileId}/comment")]
2022-03-14 10:57:59 +00:00
public async Task < object > UpdateCommentFromBodyAsync ( T fileId , [ FromBody ] UpdateCommentRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return await _filesControllerHelper . UpdateCommentAsync ( fileId , inDto . Version , inDto . Comment ) ;
2022-03-03 17:33:11 +00:00
}
[Update("file/{fileId}/comment")]
[Consumes("application/x-www-form-urlencoded")]
2022-03-14 10:57:59 +00:00
public async Task < object > UpdateCommentFromFormAsync ( T fileId , [ FromForm ] UpdateCommentRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return await _filesControllerHelper . UpdateCommentAsync ( fileId , inDto . Version , inDto . Comment ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
/// Updates the information of the selected file with the parameters specified in the request
/// </summary>
/// <short>Update file info</short>
/// <category>Files</category>
/// <param name="fileId">File ID</param>
/// <param name="title">New title</param>
/// <param name="lastVersion">File last version number</param>
/// <returns>File info</returns>
[Update("file/{fileId}", order: int.MaxValue, DisableFormat = true)]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > UpdateFileFromBodyAsync ( T fileId , [ FromBody ] UpdateFileRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . UpdateFileAsync ( fileId , inDto . Title , inDto . LastVersion ) ;
2022-03-03 17:33:11 +00:00
}
[Update("file/{fileId}", order: int.MaxValue, DisableFormat = true)]
[Consumes("application/x-www-form-urlencoded")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > UpdateFileFromFormAsync ( T fileId , [ FromForm ] UpdateFileRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . UpdateFileAsync ( fileId , inDto . Title , inDto . LastVersion ) ;
2022-03-03 17:33:11 +00:00
}
/// <summary>
///
/// </summary>
/// <param name="file"></param>
/// <param name="fileId"></param>
/// <param name="encrypted"></param>
/// <returns></returns>
/// <visible>false</visible>
[Update("{fileId}/update")]
2022-03-14 10:57:59 +00:00
public Task < FileDto < T > > UpdateFileStreamFromFormAsync ( T fileId , [ FromForm ] FileStreamRequestDto inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-14 10:57:59 +00:00
return _filesControllerHelper . UpdateFileStreamAsync ( _filesControllerHelper . GetFileFromRequest ( inDto ) . OpenReadStream ( ) , fileId , inDto . FileExtension , inDto . Encrypted , inDto . Forcesave ) ;
2022-03-03 17:33:11 +00:00
}
2022-03-14 10:57:59 +00:00
private object CopyFile ( T fileId , CopyAsRequestDto < JsonElement > inDto )
2022-03-03 17:33:11 +00:00
{
2022-03-08 17:43:47 +00:00
var helper = _serviceProvider . GetService < FilesControllerHelper < T > > ( ) ;
2022-03-05 14:41:47 +00:00
if ( inDto . DestFolderId . ValueKind = = JsonValueKind . Number )
2022-03-03 17:33:11 +00:00
{
2022-03-05 14:41:47 +00:00
return helper . CopyFileAsAsync ( fileId , inDto . DestFolderId . GetInt32 ( ) , inDto . DestTitle , inDto . Password ) ;
2022-03-03 17:33:11 +00:00
}
2022-03-05 14:41:47 +00:00
else if ( inDto . DestFolderId . ValueKind = = JsonValueKind . String )
2022-03-03 17:33:11 +00:00
{
2022-03-05 14:41:47 +00:00
return helper . CopyFileAsAsync ( fileId , inDto . DestFolderId . GetString ( ) , inDto . DestTitle , inDto . Password ) ;
2022-03-03 17:33:11 +00:00
}
return null ;
}
2022-03-14 10:57:59 +00:00
}
public class FilesControllerCommon : ApiControllerBase
{
private readonly GlobalFolderHelper _globalFolderHelper ;
private readonly FileStorageService < string > _fileStorageServiceThirdparty ;
private readonly FilesControllerHelper < int > _filesControllerHelperInternal ;
public FilesControllerCommon (
GlobalFolderHelper globalFolderHelper ,
FileStorageService < string > fileStorageServiceThirdparty ,
FilesControllerHelper < int > filesControllerHelperInternal )
{
_globalFolderHelper = globalFolderHelper ;
_fileStorageServiceThirdparty = fileStorageServiceThirdparty ;
_filesControllerHelperInternal = filesControllerHelperInternal ;
}
/// <summary>
/// Creates a new file in the 'My Documents' section with the title sent in the request
/// </summary>
/// <short>Create file</short>
/// <category>File Creation</category>
/// <param name="title" remark="Allowed values: the file must have one of the following extensions: DOCX, XLSX, PPTX">File title</param>
/// <remarks>In case the extension for the file title differs from DOCX/XLSX/PPTX and belongs to one of the known text, spreadsheet or presentation formats, it will be changed to DOCX/XLSX/PPTX accordingly. If the file extension is not set or is unknown, the DOCX extension will be added to the file title.</remarks>
/// <returns>New file info</returns>
[Create("@my/file")]
public Task < FileDto < int > > CreateFileFromBodyAsync ( [ FromBody ] CreateFileRequestDto < JsonElement > inDto )
{
return _filesControllerHelperInternal . CreateFileAsync ( _globalFolderHelper . FolderMy , inDto . Title , inDto . TemplateId , inDto . EnableExternalExt ) ;
}
[Create("@my/file")]
[Consumes("application/x-www-form-urlencoded")]
public Task < FileDto < int > > CreateFileFromFormAsync ( [ FromForm ] CreateFileRequestDto < JsonElement > inDto )
{
return _filesControllerHelperInternal . CreateFileAsync ( _globalFolderHelper . FolderMy , inDto . Title , inDto . TemplateId , inDto . EnableExternalExt ) ;
}
/// <summary>
/// Creates an html (.html) file in 'Common Documents' section with the title and contents sent in the request
/// </summary>
/// <short>Create html in 'Common'</short>
/// <category>File Creation</category>
/// <param name="title">File title</param>
/// <param name="content">File contents</param>
/// <returns>Folder contents</returns>
[Create("@common/html")]
public async Task < FileDto < int > > CreateHtmlFileInCommonFromBodyAsync ( [ FromBody ] CreateTextOrHtmlFileRequestDto inDto )
{
return await _filesControllerHelperInternal . CreateHtmlFileAsync ( await _globalFolderHelper . FolderCommonAsync , inDto . Title , inDto . Content ) ;
}
[Create("@common/html")]
[Consumes("application/x-www-form-urlencoded")]
public async Task < FileDto < int > > CreateHtmlFileInCommonFromFormAsync ( [ FromForm ] CreateTextOrHtmlFileRequestDto inDto )
{
return await _filesControllerHelperInternal . CreateHtmlFileAsync ( await _globalFolderHelper . FolderCommonAsync , inDto . Title , inDto . Content ) ;
}
/// <summary>
/// Creates an html (.html) file in 'My Documents' section with the title and contents sent in the request
/// </summary>
/// <short>Create html in 'My'</short>
/// <category>File Creation</category>
/// <param name="title">File title</param>
/// <param name="content">File contents</param>
/// <returns>Folder contents</returns>
[Create("@my/html")]
public Task < FileDto < int > > CreateHtmlFileInMyFromBodyAsync ( [ FromBody ] CreateTextOrHtmlFileRequestDto inDto )
{
return _filesControllerHelperInternal . CreateHtmlFileAsync ( _globalFolderHelper . FolderMy , inDto . Title , inDto . Content ) ;
}
[Create("@my/html")]
[Consumes("application/x-www-form-urlencoded")]
public Task < FileDto < int > > CreateHtmlFileInMyFromFormAsync ( [ FromForm ] CreateTextOrHtmlFileRequestDto inDto )
{
return _filesControllerHelperInternal . CreateHtmlFileAsync ( _globalFolderHelper . FolderMy , inDto . Title , inDto . Content ) ;
}
/// <summary>
/// Creates a text (.txt) file in 'Common Documents' section with the title and contents sent in the request
/// </summary>
/// <short>Create txt in 'Common'</short>
/// <category>File Creation</category>
/// <param name="title">File title</param>
/// <param name="content">File contents</param>
/// <returns>Folder contents</returns>
[Create("@common/text")]
public async Task < FileDto < int > > CreateTextFileInCommonFromBodyAsync ( [ FromBody ] CreateTextOrHtmlFileRequestDto inDto )
{
return await _filesControllerHelperInternal . CreateTextFileAsync ( await _globalFolderHelper . FolderCommonAsync , inDto . Title , inDto . Content ) ;
}
[Create("@common/text")]
[Consumes("application/x-www-form-urlencoded")]
public async Task < FileDto < int > > CreateTextFileInCommonFromFormAsync ( [ FromForm ] CreateTextOrHtmlFileRequestDto inDto )
{
return await _filesControllerHelperInternal . CreateTextFileAsync ( await _globalFolderHelper . FolderCommonAsync , inDto . Title , inDto . Content ) ;
}
/// <summary>
/// Creates a text (.txt) file in 'My Documents' section with the title and contents sent in the request
/// </summary>
/// <short>Create txt in 'My'</short>
/// <category>File Creation</category>
/// <param name="title">File title</param>
/// <param name="content">File contents</param>
/// <returns>Folder contents</returns>
[Create("@my/text")]
public Task < FileDto < int > > CreateTextFileInMyFromBodyAsync ( [ FromBody ] CreateTextOrHtmlFileRequestDto inDto )
{
return _filesControllerHelperInternal . CreateTextFileAsync ( _globalFolderHelper . FolderMy , inDto . Title , inDto . Content ) ;
}
[Create("@my/text")]
[Consumes("application/x-www-form-urlencoded")]
public Task < FileDto < int > > CreateTextFileInMyFromFormAsync ( [ FromForm ] CreateTextOrHtmlFileRequestDto inDto )
{
return _filesControllerHelperInternal . CreateTextFileAsync ( _globalFolderHelper . FolderMy , inDto . Title , inDto . Content ) ;
}
[Create("thumbnails")]
public Task < IEnumerable < JsonElement > > CreateThumbnailsFromBodyAsync ( [ FromBody ] BaseBatchRequestDto inDto )
{
return _fileStorageServiceThirdparty . CreateThumbnailsAsync ( inDto . FileIds . ToList ( ) ) ;
}
[Create("thumbnails")]
[Consumes("application/x-www-form-urlencoded")]
public async Task < IEnumerable < JsonElement > > CreateThumbnailsFromFormAsync ( [ FromForm ] [ ModelBinder ( BinderType = typeof ( BaseBatchModelBinder ) ) ] BaseBatchRequestDto inDto )
{
return await _fileStorageServiceThirdparty . CreateThumbnailsAsync ( inDto . FileIds . ToList ( ) ) ;
}
2022-03-03 17:33:11 +00:00
}