Skip to content

Commit

Permalink
引入Minio Nuget包;升级腾讯云Nuget包
Browse files Browse the repository at this point in the history
  • Loading branch information
withsalt committed Mar 4, 2022
1 parent 489a2d3 commit bc703c9
Show file tree
Hide file tree
Showing 179 changed files with 99 additions and 19,160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
36 changes: 18 additions & 18 deletions src/src/OnceMi.AspNetCore.OSS/Interface/Base/BaseOSSService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,6 @@ public BaseOSSService(IMemoryCache cache, OSSOptions options)
this.Options = options ?? throw new ArgumentNullException(nameof(OSSOptions));
}

internal virtual string BuildPresignedObjectCacheKey(string bucketName, string objectName, PresignedObjectType type)
{
return Encrypt.MD5($"{this.GetType().FullName}_{bucketName}_{objectName}_{type.ToString().ToUpper()}");
}

internal virtual string FormatObjectName(string objectName)
{
if (string.IsNullOrEmpty(objectName) || objectName == "/")
{
throw new ArgumentNullException(nameof(objectName));
}
if (objectName.StartsWith('/'))
{
return objectName.TrimStart('/');
}
return objectName;
}

public virtual Task RemovePresignedUrlCache(string bucketName, string objectName)
{
if (string.IsNullOrEmpty(bucketName))
Expand All @@ -50,6 +32,19 @@ public virtual Task RemovePresignedUrlCache(string bucketName, string objectName
return Task.CompletedTask;
}

internal virtual string FormatObjectName(string objectName)
{
if (string.IsNullOrEmpty(objectName) || objectName == "/")
{
throw new ArgumentNullException(nameof(objectName));
}
if (objectName.StartsWith('/'))
{
return objectName.TrimStart('/');
}
return objectName;
}

internal virtual async Task<string> PresignedObjectAsync(string bucketName
, string objectName
, int expiresInt
Expand Down Expand Up @@ -125,5 +120,10 @@ internal virtual async Task<string> PresignedObjectAsync(string bucketName
throw new Exception($"Presigned {(type == PresignedObjectType.Get ? "get" : "put")} url for object '{objectName}' from {bucketName} failed. {ex.Message}", ex);
}
}

private string BuildPresignedObjectCacheKey(string bucketName, string objectName, PresignedObjectType type)
{
return Encrypt.MD5($"{this.GetType().FullName}_{bucketName}_{objectName}_{type.ToString().ToUpper()}");
}
}
}
20 changes: 7 additions & 13 deletions src/src/OnceMi.AspNetCore.OSS/OnceMi.AspNetCore.OSS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@
<Description>ASP.NET Core对象储存扩展。支持Minio自建对象储存、阿里云OSS、腾讯云COS、七牛云Kodo、华为云OBS</Description>
<Company>OnceMi</Company>
<Authors>OnceMi</Authors>
<AssemblyVersion>1.1.1.0</AssemblyVersion>
<FileVersion>1.1.1.0</FileVersion>
<Version>1.1.1</Version>
<AssemblyVersion>1.1.2.0</AssemblyVersion>
<FileVersion>1.1.2.0</FileVersion>
<Version>1.1.2</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RepositoryUrl>https://github.com/oncemi/OnceMi.AspNetCore.OSS</RepositoryUrl>
<PackageProjectUrl>https://github.com/oncemi/OnceMi.AspNetCore.OSS</PackageProjectUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RepositoryType>Github</RepositoryType>
<PackageReleaseNotes>增加华为云支持</PackageReleaseNotes>
<PackageReleaseNotes>引入Minio Nuget包;升级腾讯云Nuget包</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.26" />
<PackageReference Include="Minio" Version="4.0.0" />
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.28" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<!--以下为Minio所需包-->
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Crc32.NET" Version="1.2.0" />
<PackageReference Include="SourceLink.Embed.AllSourceFiles" Version="2.8.3" PrivateAssets="All" />
<PackageReference Include="AsyncFixer" Version="1.5.1" PrivateAssets="All" />
<PackageReference Include="RestSharp" Version="106.15.0" />
<PackageReference Include="System.Reactive.Linq" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
88 changes: 0 additions & 88 deletions src/src/OnceMi.AspNetCore.OSS/SDK/Minio/AWSS3Endpoints.cs

This file was deleted.

Loading

0 comments on commit bc703c9

Please sign in to comment.