-
Notifications
You must be signed in to change notification settings - Fork 329
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 #182 from dotnetcore/dev
Upgrading dependencies and fixed some bug
- Loading branch information
Showing
18 changed files
with
551 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,56 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<EasyCachingCorePackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Redis provider support some geo methods. | ||
</EasyCachingCorePackageNotes> | ||
<EasyCachingMemcachedPackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingMemcachedPackageNotes> | ||
<EasyCachingRedisPackageNotes> | ||
1. Support Hyperloglog. | ||
1. Support some geo methods. | ||
</EasyCachingRedisPackageNotes> | ||
<EasyCachingSQLitePackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingSQLitePackageNotes> | ||
<EasyCachingInMemoryPackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Fix datetime exception. | ||
2. Upgrading dependencies. | ||
</EasyCachingInMemoryPackageNotes> | ||
<EasyCachingHybridPackageNotes> | ||
1. improve hybrid get with data retriever. | ||
1. Upgrading dependencies. | ||
</EasyCachingHybridPackageNotes> | ||
<EasyCachingAspectCorePackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingAspectCorePackageNotes> | ||
<EasyCachingCastlePackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingCastlePackageNotes> | ||
<EasyCachingResponseCachingPackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingResponseCachingPackageNotes> | ||
<EasyCachingJsonPackageNotes> | ||
1. Support JsonSerializerSettings. | ||
1. Upgrading dependencies. | ||
</EasyCachingJsonPackageNotes> | ||
<EasyCachingMessagePackPackageNotes> | ||
1. Support custom resolver. | ||
1. Upgrading dependencies. | ||
</EasyCachingMessagePackPackageNotes> | ||
<EasyCachingProtobufPackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingProtobufPackageNotes> | ||
<EasyCachingCSRedisPackageNotes> | ||
1. Support Hyperloglog. | ||
1. Support some geo methods. | ||
</EasyCachingCSRedisPackageNotes> | ||
<EasyCachingCSRedisBusPackageNotes> | ||
1. Support sentinel mode. | ||
1. Upgrading dependencies. | ||
</EasyCachingCSRedisBusPackageNotes> | ||
<EasyCachingRedisBusPackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingRedisBusPackageNotes> | ||
<EasyCachingRabbitBusPackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingRabbitBusPackageNotes> | ||
<EasyCachingDiskPackageNotes> | ||
1. Make Interceptors and response caching Support .netcore3.0. | ||
2. Remove WithServices method to support console apps. | ||
3. Improve RabbitMQ bus. | ||
4. Add deep clone for memory cache provider. | ||
5. Support multi instances of hybrid provider. | ||
6. Upgrading dependencies. | ||
7. Modify some extension methods' namespace. | ||
1. Upgrading dependencies. | ||
</EasyCachingDiskPackageNotes> | ||
</PropertyGroup> | ||
</Project> |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<EasyCachingCorePackageVersion>0.8.0</EasyCachingCorePackageVersion> | ||
<EasyCachingMemcachedPackageVersion>0.8.0</EasyCachingMemcachedPackageVersion> | ||
<EasyCachingRedisPackageVersion>0.8.2</EasyCachingRedisPackageVersion> | ||
<EasyCachingSQLitePackageVersion>0.8.0</EasyCachingSQLitePackageVersion> | ||
<EasyCachingInMemoryPackageVersion>0.8.0</EasyCachingInMemoryPackageVersion> | ||
<EasyCachingHybridPackageVersion>0.8.1</EasyCachingHybridPackageVersion> | ||
<EasyCachingAspectCorePackageVersion>0.8.0</EasyCachingAspectCorePackageVersion> | ||
<EasyCachingCastlePackageVersion>0.8.0</EasyCachingCastlePackageVersion> | ||
<EasyCachingResponseCachingPackageVersion>0.8.0</EasyCachingResponseCachingPackageVersion> | ||
<EasyCachingJsonPackageVersion>0.8.1</EasyCachingJsonPackageVersion> | ||
<EasyCachingMessagePackPackageVersion>0.8.1</EasyCachingMessagePackPackageVersion> | ||
<EasyCachingProtobufPackageVersion>0.8.0</EasyCachingProtobufPackageVersion> | ||
<EasyCachingCSRedisPackageVersion>0.8.2</EasyCachingCSRedisPackageVersion> | ||
<EasyCachingRedisBusPackageVersion>0.8.0</EasyCachingRedisBusPackageVersion> | ||
<EasyCachingCSRedisBusPackageVersion>0.8.1</EasyCachingCSRedisBusPackageVersion> | ||
<EasyCachingRabbitBusPackageVersion>0.8.0</EasyCachingRabbitBusPackageVersion> | ||
<EasyCachingDiskPackageVersion>0.8.0</EasyCachingDiskPackageVersion> | ||
<EasyCachingCorePackageVersion>0.8.3</EasyCachingCorePackageVersion> | ||
<EasyCachingMemcachedPackageVersion>0.8.3</EasyCachingMemcachedPackageVersion> | ||
<EasyCachingRedisPackageVersion>0.8.3</EasyCachingRedisPackageVersion> | ||
<EasyCachingSQLitePackageVersion>0.8.3</EasyCachingSQLitePackageVersion> | ||
<EasyCachingInMemoryPackageVersion>0.8.3</EasyCachingInMemoryPackageVersion> | ||
<EasyCachingHybridPackageVersion>0.8.3</EasyCachingHybridPackageVersion> | ||
<EasyCachingAspectCorePackageVersion>0.8.3</EasyCachingAspectCorePackageVersion> | ||
<EasyCachingCastlePackageVersion>0.8.3</EasyCachingCastlePackageVersion> | ||
<EasyCachingResponseCachingPackageVersion>0.8.3</EasyCachingResponseCachingPackageVersion> | ||
<EasyCachingJsonPackageVersion>0.8.3</EasyCachingJsonPackageVersion> | ||
<EasyCachingMessagePackPackageVersion>0.8.3</EasyCachingMessagePackPackageVersion> | ||
<EasyCachingProtobufPackageVersion>0.8.3</EasyCachingProtobufPackageVersion> | ||
<EasyCachingCSRedisPackageVersion>0.8.3</EasyCachingCSRedisPackageVersion> | ||
<EasyCachingRedisBusPackageVersion>0.8.3</EasyCachingRedisBusPackageVersion> | ||
<EasyCachingCSRedisBusPackageVersion>0.8.3</EasyCachingCSRedisBusPackageVersion> | ||
<EasyCachingRabbitBusPackageVersion>0.8.3</EasyCachingRabbitBusPackageVersion> | ||
<EasyCachingDiskPackageVersion>0.8.3</EasyCachingDiskPackageVersion> | ||
</PropertyGroup> | ||
</Project> |
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
146 changes: 146 additions & 0 deletions
146
src/EasyCaching.CSRedis/DefaultCSRedisCachingProvider.Geo.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,146 @@ | ||
namespace EasyCaching.CSRedis | ||
{ | ||
using EasyCaching.Core; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using GeoUnit = global::CSRedis.GeoUnit; | ||
|
||
public partial class DefaultCSRedisCachingProvider : IRedisCachingProvider | ||
{ | ||
public long GeoAdd(string cacheKey, List<(double longitude, double latitude, string member)> values) | ||
{ | ||
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); | ||
ArgumentCheck.NotNullAndCountGTZero(values, nameof(values)); | ||
|
||
var list = new List<(double longitude, double latitude, object member)>(); | ||
|
||
foreach (var item in values) | ||
{ | ||
list.Add((item.longitude, item.latitude, item.member)); | ||
} | ||
|
||
var res = _cache.GeoAdd(cacheKey, list.ToArray()); | ||
return res; | ||
} | ||
|
||
public async Task<long> GeoAddAsync(string cacheKey, List<(double longitude, double latitude, string member)> values) | ||
{ | ||
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); | ||
ArgumentCheck.NotNullAndCountGTZero(values, nameof(values)); | ||
|
||
var list = new List<(double longitude, double latitude, object member)>(); | ||
|
||
foreach (var item in values) | ||
{ | ||
list.Add((item.longitude, item.latitude, item.member)); | ||
} | ||
|
||
var res = await _cache.GeoAddAsync(cacheKey, list.ToArray()); | ||
return res; | ||
} | ||
|
||
public double? GeoDist(string cacheKey, string member1, string member2, string unit = "m") | ||
{ | ||
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); | ||
ArgumentCheck.NotNullOrWhiteSpace(member1, nameof(member1)); | ||
ArgumentCheck.NotNullOrWhiteSpace(member2, nameof(member2)); | ||
ArgumentCheck.NotNullOrWhiteSpace(unit, nameof(unit)); | ||
|
||
var res = _cache.GeoDist(cacheKey, member1, member2, GetGeoUnit(unit)); | ||
return res; | ||
} | ||
|
||
public async Task<double?> GeoDistAsync(string cacheKey, string member1, string member2, string unit = "m") | ||
{ | ||
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); | ||
ArgumentCheck.NotNullOrWhiteSpace(member1, nameof(member1)); | ||
ArgumentCheck.NotNullOrWhiteSpace(member2, nameof(member2)); | ||
ArgumentCheck.NotNullOrWhiteSpace(unit, nameof(unit)); | ||
|
||
var res = await _cache.GeoDistAsync(cacheKey, member1, member2, GetGeoUnit(unit)); | ||
return res; | ||
} | ||
|
||
public List<string> GeoHash(string cacheKey, List<string> members) | ||
{ | ||
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); | ||
ArgumentCheck.NotNullAndCountGTZero(members, nameof(members)); | ||
|
||
var list = new List<object>(); | ||
foreach (var item in members) | ||
{ | ||
list.Add(item); | ||
} | ||
|
||
var res = _cache.GeoHash(cacheKey, list.ToArray()); | ||
return res.ToList() ; | ||
} | ||
|
||
public async Task<List<string>> GeoHashAsync(string cacheKey, List<string> members) | ||
{ | ||
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); | ||
ArgumentCheck.NotNullAndCountGTZero(members, nameof(members)); | ||
|
||
var list = new List<object>(); | ||
foreach (var item in members) | ||
{ | ||
list.Add(item); | ||
} | ||
|
||
var res = await _cache.GeoHashAsync(cacheKey, list.ToArray()); | ||
return res.ToList(); | ||
} | ||
|
||
public List<(double longitude, double latitude)?> GeoPos(string cacheKey, List<string> members) | ||
{ | ||
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); | ||
ArgumentCheck.NotNullAndCountGTZero(members, nameof(members)); | ||
|
||
var list = new List<object>(); | ||
foreach (var item in members) | ||
{ | ||
list.Add(item); | ||
} | ||
|
||
var res = _cache.GeoPos(cacheKey, list.ToArray()); | ||
return res.ToList(); | ||
} | ||
|
||
public async Task<List<(double longitude, double latitude)?>> GeoPosAsync(string cacheKey, List<string> members) | ||
{ | ||
ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); | ||
ArgumentCheck.NotNullAndCountGTZero(members, nameof(members)); | ||
|
||
var list = new List<object>(); | ||
foreach (var item in members) | ||
{ | ||
list.Add(item); | ||
} | ||
|
||
var res = await _cache.GeoPosAsync(cacheKey, list.ToArray()); | ||
return res.ToList(); | ||
} | ||
|
||
private GeoUnit GetGeoUnit(string unit) | ||
{ | ||
GeoUnit geoUnit; | ||
switch (unit) | ||
{ | ||
case "km": | ||
geoUnit = GeoUnit.km; | ||
break; | ||
case "ft": | ||
geoUnit = GeoUnit.ft; | ||
break; | ||
case "mi": | ||
geoUnit = GeoUnit.mi; | ||
break; | ||
default: | ||
geoUnit = GeoUnit.m; | ||
break; | ||
} | ||
return geoUnit; | ||
} | ||
} | ||
} |
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.