Skip to content

Commit

Permalink
重命名AddRedisDistributedLock -> AddDistributedLock;
Browse files Browse the repository at this point in the history
  • Loading branch information
zqlovejyc committed Oct 11, 2021
1 parent 883df87 commit e294595
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
19 changes: 16 additions & 3 deletions ZqUtils.Core/Extensions/Extensions.IServiceCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,28 @@ public static IServiceCollection AddStackExchangeRedis(
}
#endregion

#region AddRedisDistributedLock
#region AddDistributedLock
/// <summary>
/// 注入分布式锁(IDistributedLockProvider)
/// </summary>
/// <param name="this"></param>
/// <param name="provider"></param>
/// <returns></returns>
public static IServiceCollection AddDistributedLock(
this IServiceCollection @this,
IDistributedLockProvider provider)
{
return @this.AddSingleton(x => provider);
}

/// <summary>
/// 注入基于Redis的分布式锁(IDistributedLockProvider)
/// </summary>
/// <param name="this"></param>
/// <param name="database"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddRedisDistributedLock(
public static IServiceCollection AddDistributedLock(
this IServiceCollection @this,
IDatabase database,
Action<RedisDistributedSynchronizationOptionsBuilder> options = null)
Expand All @@ -261,7 +274,7 @@ public static IServiceCollection AddRedisDistributedLock(
/// <param name="defaultDatabase"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddRedisDistributedLock(
public static IServiceCollection AddDistributedLock(
this IServiceCollection @this,
int defaultDatabase = 0,
Action<RedisDistributedSynchronizationOptionsBuilder> options = null)
Expand Down
16 changes: 8 additions & 8 deletions ZqUtils.Core/ZqUtils.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AgileConfig.Client" Version="1.1.8.11" />
<PackageReference Include="AgileConfig.Client" Version="1.1.9" />
<PackageReference Include="AspectCore.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="BouncyCastle.NetCore" Version="1.8.8" />
<PackageReference Include="Com.Ctrip.Framework.Apollo.Configuration" Version="2.4.1.1" />
<PackageReference Include="Confluent.Kafka" Version="1.8.0" />
<PackageReference Include="Confluent.Kafka" Version="1.8.1" />
<PackageReference Include="Dapper" Version="2.0.90" />
<PackageReference Include="DeepCloner" Version="0.10.2" />
<PackageReference Include="DistributedLock.Redis" Version="1.0.1" />
<PackageReference Include="DnsClient" Version="1.5.0" />
<PackageReference Include="EPPlus" Version="5.7.4" />
<PackageReference Include="EPPlus" Version="5.7.5" />
<PackageReference Include="FreeRedis" Version="0.3.7" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
Expand All @@ -85,20 +85,20 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MongoDB.Driver" Version="2.13.1" />
<PackageReference Include="MongoDB.Driver" Version="2.13.2" />
<PackageReference Include="NATS.Client" Version="0.12.0" />
<PackageReference Include="NEST" Version="7.14.1" />
<PackageReference Include="NEST" Version="7.15.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.11" />
<PackageReference Include="Polly" Version="7.2.2" />
<PackageReference Include="Quartz.Plugins.TimeZoneConverter" Version="3.3.3" />
<PackageReference Include="Quartz.Serialization.Json" Version="3.3.3" />
<PackageReference Include="RabbitMQ.Client" Version="6.2.2" />
<PackageReference Include="Scrutor" Version="3.3.0" />
<PackageReference Include="SharpZipLib" Version="1.3.2" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
<PackageReference Include="StackExchange.Redis" Version="2.2.62" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.13.1" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="ZXing.Net.Bindings.ZKWeb.System.Drawing" Version="0.16.5" />
Expand Down

0 comments on commit e294595

Please sign in to comment.