-
Notifications
You must be signed in to change notification settings - Fork 44
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 #119 from EasyAbp/refactor-file-location-apis
Refactor file location APIs
- Loading branch information
Showing
10 changed files
with
87 additions
and
31 deletions.
There are no files selected for viewing
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
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
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
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
27 changes: 27 additions & 0 deletions
27
src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Files/FileLocationModel.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,27 @@ | ||
using System; | ||
using JetBrains.Annotations; | ||
|
||
namespace EasyAbp.FileManagement.Files; | ||
|
||
public class FileLocationModel | ||
{ | ||
public bool IsDirectory { get; set; } | ||
|
||
[NotNull] | ||
public string ParentPath { get; set; } | ||
|
||
[NotNull] | ||
public string FileName { get; set; } | ||
|
||
[NotNull] | ||
public string FilePath => ParentPath.IsNullOrEmpty() | ||
? FileName | ||
: $"{ParentPath}{FileManagementConsts.DirectorySeparator}{FileName}"; | ||
|
||
public FileLocationModel(bool isDirectory, [NotNull] string parentPath, [NotNull] string fileName) | ||
{ | ||
IsDirectory = isDirectory; | ||
ParentPath = parentPath; | ||
FileName = 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
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
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
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
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