-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from JadynWong/jadyn/AddRemoteStreamContent
Support `RemoteStreamContent`
- Loading branch information
Showing
30 changed files
with
775 additions
and
127 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
....FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/CreateFileBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Runtime.InteropServices.ComTypes; | ||
using System.Text; | ||
using Volo.Abp.ObjectExtending; | ||
|
||
namespace EasyAbp.FileManagement.Files.Dtos | ||
{ | ||
public abstract class CreateFileBase : ExtensibleObject | ||
{ | ||
[Required] | ||
public string FileContainerName { get; set; } | ||
|
||
public Guid? ParentId { get; set; } | ||
|
||
public Guid? OwnerUserId { get; set; } | ||
|
||
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | ||
{ | ||
base.Validate(validationContext); | ||
|
||
if (FileContainerName.IsNullOrWhiteSpace()) | ||
{ | ||
yield return new ValidationResult("FileContainerName should not be empty!", | ||
new[] { nameof(FileContainerName) }); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ment.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/CreateFileWithStreamInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using Volo.Abp.Content; | ||
using Volo.Abp.ObjectExtending; | ||
|
||
namespace EasyAbp.FileManagement.Files.Dtos | ||
{ | ||
[Serializable] | ||
public class CreateFileWithStreamInput : CreateFileBase | ||
{ | ||
public IRemoteStreamContent Content { get; set; } | ||
|
||
public bool GenerateUniqueFileName { get; set; } | ||
|
||
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | ||
{ | ||
base.Validate(validationContext); | ||
|
||
if (Content == null) | ||
{ | ||
yield return new ValidationResult("Content should not be empty!", | ||
new[] { nameof(Content) }); | ||
} | ||
else if (Content.FileName.IsNullOrWhiteSpace()) | ||
{ | ||
yield return new ValidationResult("Content.FileName should not be empty!", | ||
new[] { nameof(Content.FileName) }); | ||
} | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
....Application.Contracts/EasyAbp/FileManagement/Files/Dtos/CreateManyFileWithStreamInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Text; | ||
using Volo.Abp.Content; | ||
|
||
namespace EasyAbp.FileManagement.Files.Dtos | ||
{ | ||
public class CreateManyFileWithStreamInput : CreateFileBase | ||
{ | ||
public List<IRemoteStreamContent> FileContents { get; set; } = new(); | ||
|
||
public bool GenerateUniqueFileName { get; set; } | ||
|
||
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | ||
{ | ||
base.Validate(validationContext); | ||
|
||
if (FileContents.IsNullOrEmpty()) | ||
{ | ||
yield return new ValidationResult("FileContents should not be null or empty!", | ||
new[] { nameof(FileContents) }); | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
....FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/UpdateFileBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Volo.Abp.ObjectExtending; | ||
|
||
namespace EasyAbp.FileManagement.Files.Dtos | ||
{ | ||
public class UpdateFileBase: ExtensibleObject | ||
{ | ||
} | ||
} |
11 changes: 5 additions & 6 deletions
11
...FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/UpdateFileInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ment.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/UpdateFileWithStreamInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using Volo.Abp.Content; | ||
|
||
namespace EasyAbp.FileManagement.Files.Dtos | ||
{ | ||
public class UpdateFileWithStreamInput : UpdateFileBase | ||
{ | ||
public IRemoteStreamContent Content { get; set; } | ||
|
||
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | ||
{ | ||
if (Content == null) | ||
{ | ||
yield return new ValidationResult("Content should not be empty!", | ||
new[] { nameof(Content) }); | ||
} | ||
else if (Content.FileName.IsNullOrWhiteSpace()) | ||
{ | ||
yield return new ValidationResult("Content.FileName should not be empty!", | ||
new[] { nameof(Content.FileName) }); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.