-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
将文件存储接口移动到Util.FileStorage.Abstractions类库
- Loading branch information
Showing
42 changed files
with
189 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Util.Aop; | ||
|
||
/// <summary> | ||
/// Aop配置 | ||
/// </summary> | ||
public class AopOptions { | ||
/// <summary> | ||
/// 是否启用IAopProxy接口标记 | ||
/// </summary> | ||
public bool IsEnableIAopProxy { get; set; } | ||
/// <summary> | ||
/// 是否启用参数拦截器,默认值: true | ||
/// </summary> | ||
public bool IsEnableParameterAspect { get; set; } = true; | ||
} |
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
33 changes: 33 additions & 0 deletions
33
src/Util.FileStorage.Abstractions/01-Util.FileStorage.Abstractions.csproj
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,33 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>$(NetTargetFramework)</TargetFramework> | ||
<PackageIcon>icon.jpg</PackageIcon> | ||
<AssemblyName>Util.FileStorage.Abstractions</AssemblyName> | ||
<RootNamespace>Util.FileStorage</RootNamespace> | ||
<Description>Util.FileStorage.Abstractions是Util应用框架文件存储操作接口定义类库</Description> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<OutputPath></OutputPath> | ||
<DocumentationFile>.\obj\Debug\$(NetTargetFramework)\Util.FileStorage.Abstractions.xml</DocumentationFile> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<OutputPath></OutputPath> | ||
<DocumentationFile>.\obj\Release\$(NetTargetFramework)\Util.FileStorage.Abstractions.xml</DocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\build\icon.jpg"> | ||
<Pack>True</Pack> | ||
<Visible>False</Visible> | ||
<PackagePath></PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Util.Core\01-Util.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
global using System; | ||
global using System.Threading.Tasks; | ||
global using System.Collections.Generic; | ||
global using System.Threading; | ||
global using System.IO; | ||
global using System.ComponentModel; | ||
global using System.Linq; | ||
global using Microsoft.Extensions.Options; | ||
global using Microsoft.Extensions.DependencyInjection; | ||
global using Microsoft.Extensions.DependencyInjection.Extensions; | ||
global using Util.Dependency; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace Util.FileStorage; | ||
|
||
/// <summary> | ||
/// 文件验证操作 | ||
/// </summary> | ||
public static class FileValidation { | ||
/// <summary> | ||
/// 扩展名是否有效 | ||
/// </summary> | ||
/// <param name="fileName">文件名,范例: a.jpg</param> | ||
/// <param name="accepts">接受的扩展名列表,以逗号分隔,范例: .jpg,.png,.gif</param> | ||
public static bool IsValidExtension( string fileName, string accepts ) { | ||
if( fileName.IsEmpty() ) | ||
return false; | ||
if( accepts.IsEmpty() ) | ||
return true; | ||
var extension = Path.GetExtension( fileName ); | ||
var list = accepts.Split( ',' ).Where( t => t.IsEmpty() == false ).ToList(); | ||
if ( list.Count == 0 ) | ||
return true; | ||
return list.Any( type => type.TrimStart( '.' ) == extension.TrimStart( '.' ) ); | ||
} | ||
} |
Oops, something went wrong.