Merge branch 'develop' into feature/fix-hide/show-header
This commit is contained in:
commit
bb8c1962fb
@ -1,10 +1,11 @@
|
|||||||
using System.IO;
|
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace ASC.Files.Core.Model
|
namespace ASC.Files.Core.Model
|
||||||
{
|
{
|
||||||
public class InsertFileModel
|
public class InsertFileModel
|
||||||
{
|
{
|
||||||
public Stream File { get; set; }
|
public IFormFile File { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public bool? CreateNewIfExist { get; set; }
|
public bool? CreateNewIfExist { get; set; }
|
||||||
public bool KeepConvertStatus { get; set; }
|
public bool KeepConvertStatus { get; set; }
|
||||||
|
@ -509,14 +509,7 @@ namespace ASC.Api.Documents
|
|||||||
/// <category>Uploads</category>
|
/// <category>Uploads</category>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Create("@my/insert")]
|
[Create("@my/insert")]
|
||||||
public FileWrapper<int> InsertFileToMyFromBody([FromBody]InsertFileModel model)
|
public FileWrapper<int> InsertFileToMyFromBody([FromForm] InsertFileModel model)
|
||||||
{
|
|
||||||
return InsertFile(GlobalFolderHelper.FolderMy, model);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Create("@my/insert")]
|
|
||||||
[Consumes("application/x-www-form-urlencoded")]
|
|
||||||
public FileWrapper<int> InsertFileToMyFromForm([FromForm]InsertFileModel model)
|
|
||||||
{
|
{
|
||||||
return InsertFile(GlobalFolderHelper.FolderMy, model);
|
return InsertFile(GlobalFolderHelper.FolderMy, model);
|
||||||
}
|
}
|
||||||
@ -531,14 +524,7 @@ namespace ASC.Api.Documents
|
|||||||
/// <category>Uploads</category>
|
/// <category>Uploads</category>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Create("@common/insert")]
|
[Create("@common/insert")]
|
||||||
public FileWrapper<int> InsertFileToCommonFromBody([FromBody]InsertFileModel model)
|
public FileWrapper<int> InsertFileToCommonFromBody([FromForm] InsertFileModel model)
|
||||||
{
|
|
||||||
return InsertFile(GlobalFolderHelper.FolderCommon, model);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Create("@common/insert")]
|
|
||||||
[Consumes("application/x-www-form-urlencoded")]
|
|
||||||
public FileWrapper<int> InsertFileToCommonFromForm([FromForm]InsertFileModel model)
|
|
||||||
{
|
{
|
||||||
return InsertFile(GlobalFolderHelper.FolderCommon, model);
|
return InsertFile(GlobalFolderHelper.FolderCommon, model);
|
||||||
}
|
}
|
||||||
@ -554,31 +540,12 @@ namespace ASC.Api.Documents
|
|||||||
/// <category>Uploads</category>
|
/// <category>Uploads</category>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Create("{folderId}/insert", order: int.MaxValue, DisableFormat = true)]
|
[Create("{folderId}/insert", order: int.MaxValue, DisableFormat = true)]
|
||||||
public FileWrapper<string> InsertFileFromBody(string folderId, [FromBody]InsertFileModel model)
|
public FileWrapper<string> InsertFile(string folderId, [FromForm] InsertFileModel model)
|
||||||
{
|
{
|
||||||
return InsertFile(folderId, model);
|
return FilesControllerHelperString.InsertFile(folderId, model.File.OpenReadStream(), model.Title, model.CreateNewIfExist, model.KeepConvertStatus);
|
||||||
}
|
|
||||||
|
|
||||||
[Create("{folderId}/insert", order: int.MaxValue, DisableFormat = true)]
|
|
||||||
[Consumes("application/x-www-form-urlencoded")]
|
|
||||||
public FileWrapper<string> InsertFileFromForm(string folderId, [FromForm]InsertFileModel model)
|
|
||||||
{
|
|
||||||
return InsertFile(folderId, model);
|
|
||||||
}
|
|
||||||
|
|
||||||
private FileWrapper<string> InsertFile(string folderId, InsertFileModel model)
|
|
||||||
{
|
|
||||||
return FilesControllerHelperString.InsertFile(folderId, model.File, model.Title, model.CreateNewIfExist, model.KeepConvertStatus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Create("{folderId:int}/insert", order: int.MaxValue - 1)]
|
[Create("{folderId:int}/insert", order: int.MaxValue - 1)]
|
||||||
public FileWrapper<int> InsertFileFromBody(int folderId, [FromBody]InsertFileModel model)
|
|
||||||
{
|
|
||||||
return InsertFile(folderId, model);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Create("{folderId:int}/insert", order: int.MaxValue - 1)]
|
|
||||||
[Consumes("application/x-www-form-urlencoded")]
|
|
||||||
public FileWrapper<int> InsertFileFromForm(int folderId, [FromForm]InsertFileModel model)
|
public FileWrapper<int> InsertFileFromForm(int folderId, [FromForm]InsertFileModel model)
|
||||||
{
|
{
|
||||||
return InsertFile(folderId, model);
|
return InsertFile(folderId, model);
|
||||||
@ -586,7 +553,7 @@ namespace ASC.Api.Documents
|
|||||||
|
|
||||||
private FileWrapper<int> InsertFile(int folderId, InsertFileModel model)
|
private FileWrapper<int> InsertFile(int folderId, InsertFileModel model)
|
||||||
{
|
{
|
||||||
return FilesControllerHelperInt.InsertFile(folderId, model.File, model.Title, model.CreateNewIfExist, model.KeepConvertStatus);
|
return FilesControllerHelperInt.InsertFile(folderId, model.File.OpenReadStream(), model.Title, model.CreateNewIfExist, model.KeepConvertStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user