8 changed files with 396 additions and 2 deletions
@ -0,0 +1,49 @@ |
|||
# LINGYUN.Abp.Features.LimitValidation.Redis.Client |
|||
|
|||
Redis-based client feature limit validation component |
|||
|
|||
## Features |
|||
|
|||
* Inherits all functionality from LINGYUN.Abp.Features.LimitValidation.Redis |
|||
* Specifically designed for client application feature limit validation |
|||
* Support client-specific limitation policies |
|||
|
|||
## Configuration and Usage |
|||
|
|||
1. Add module dependency |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpFeaturesValidationRedisClientModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
2. Configure Redis options (same as LINGYUN.Abp.Features.LimitValidation.Redis) |
|||
|
|||
```json |
|||
{ |
|||
"Features": { |
|||
"Validation": { |
|||
"Redis": { |
|||
"Configuration": "127.0.0.1", |
|||
"InstanceName": "YourInstanceName" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Usage Example |
|||
|
|||
```csharp |
|||
// Limit a client feature to be called at most 1000 times per day |
|||
[RequiresLimitFeature("YourClientFeature.DailyLimit", "YourClientFeature.Interval", LimitPolicy.Days)] |
|||
public async Task YourClientMethod() |
|||
{ |
|||
// Client business logic |
|||
} |
|||
``` |
|||
|
|||
[简体中文](./README.md) | [English](./README.EN.md) |
|||
@ -0,0 +1,49 @@ |
|||
# LINGYUN.Abp.Features.LimitValidation.Redis.Client |
|||
|
|||
基于Redis的客户端功能限制验证组件 |
|||
|
|||
## 功能特性 |
|||
|
|||
* 继承自LINGYUN.Abp.Features.LimitValidation.Redis的所有功能 |
|||
* 专门针对客户端应用的功能限制验证 |
|||
* 支持客户端特定的限制策略 |
|||
|
|||
## 配置使用 |
|||
|
|||
1. 添加模块依赖 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpFeaturesValidationRedisClientModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
2. 配置Redis选项(与LINGYUN.Abp.Features.LimitValidation.Redis相同) |
|||
|
|||
```json |
|||
{ |
|||
"Features": { |
|||
"Validation": { |
|||
"Redis": { |
|||
"Configuration": "127.0.0.1", |
|||
"InstanceName": "YourInstanceName" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## 使用示例 |
|||
|
|||
```csharp |
|||
// 限制客户端某个功能每天最多调用1000次 |
|||
[RequiresLimitFeature("YourClientFeature.DailyLimit", "YourClientFeature.Interval", LimitPolicy.Days)] |
|||
public async Task YourClientMethod() |
|||
{ |
|||
// 客户端业务逻辑 |
|||
} |
|||
``` |
|||
|
|||
[简体中文](./README.md) | [English](./README.EN.md) |
|||
@ -0,0 +1,56 @@ |
|||
# LINGYUN.Abp.Features.LimitValidation.Redis |
|||
|
|||
Redis-based feature limit validation component |
|||
|
|||
## Features |
|||
|
|||
* Use Redis to store and validate feature call count limits |
|||
* Support Lua scripts for atomic operations |
|||
* Support multiple limitation policies (minute, hour, day, week, month, year) |
|||
* Support custom Redis configuration options |
|||
|
|||
## Configuration and Usage |
|||
|
|||
1. Add module dependency |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpFeaturesValidationRedisModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
2. Configure Redis options |
|||
|
|||
```json |
|||
{ |
|||
"Features": { |
|||
"Validation": { |
|||
"Redis": { |
|||
"Configuration": "127.0.0.1", |
|||
"InstanceName": "YourInstanceName" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Configuration Options |
|||
|
|||
* Configuration: Redis connection string |
|||
* InstanceName: Redis instance name (optional) |
|||
* ConfigurationOptions: Redis configuration options (optional, for more detailed Redis configuration) |
|||
|
|||
## Usage Example |
|||
|
|||
```csharp |
|||
// Limit a method to be called at most 100 times per minute |
|||
[RequiresLimitFeature("YourFeature.MethodLimit", "YourFeature.Interval", LimitPolicy.Minute)] |
|||
public async Task YourMethod() |
|||
{ |
|||
// Business logic |
|||
} |
|||
``` |
|||
|
|||
[简体中文](./README.md) | [English](./README.EN.md) |
|||
@ -0,0 +1,56 @@ |
|||
# LINGYUN.Abp.Features.LimitValidation.Redis |
|||
|
|||
基于Redis的功能限制验证组件 |
|||
|
|||
## 功能特性 |
|||
|
|||
* 使用Redis存储和验证功能调用次数限制 |
|||
* 支持Lua脚本进行原子性操作 |
|||
* 支持多种限制策略(分钟、小时、天、周、月、年) |
|||
* 支持自定义Redis配置选项 |
|||
|
|||
## 配置使用 |
|||
|
|||
1. 添加模块依赖 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpFeaturesValidationRedisModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
2. 配置Redis选项 |
|||
|
|||
```json |
|||
{ |
|||
"Features": { |
|||
"Validation": { |
|||
"Redis": { |
|||
"Configuration": "127.0.0.1", |
|||
"InstanceName": "YourInstanceName" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## 配置项说明 |
|||
|
|||
* Configuration:Redis连接字符串 |
|||
* InstanceName:Redis实例名称(可选) |
|||
* ConfigurationOptions:Redis配置选项(可选,用于更详细的Redis配置) |
|||
|
|||
## 使用示例 |
|||
|
|||
```csharp |
|||
// 限制某个方法每分钟最多调用100次 |
|||
[RequiresLimitFeature("YourFeature.MethodLimit", "YourFeature.Interval", LimitPolicy.Minute)] |
|||
public async Task YourMethod() |
|||
{ |
|||
// 业务逻辑 |
|||
} |
|||
``` |
|||
|
|||
[简体中文](./README.md) | [English](./README.EN.md) |
|||
@ -0,0 +1,55 @@ |
|||
# LINGYUN.Abp.FeatureManagement.Client |
|||
|
|||
Client feature management authorization component |
|||
|
|||
## Features |
|||
|
|||
* Provides ClientFeatureManagementProvider |
|||
* Supports permission management for client features |
|||
* Supports localization resource management |
|||
* Seamlessly integrates with ABP framework's feature management module |
|||
|
|||
## Configuration and Usage |
|||
|
|||
1. Add module dependency |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpFeatureManagementClientModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
2. Permission Configuration |
|||
|
|||
The module predefines the following permissions: |
|||
* FeatureManagement.ManageClientFeatures: Permission to manage client features |
|||
|
|||
3. Usage Example |
|||
|
|||
```csharp |
|||
public class YourService |
|||
{ |
|||
private readonly IFeatureManager _featureManager; |
|||
|
|||
public YourService(IFeatureManager featureManager) |
|||
{ |
|||
_featureManager = featureManager; |
|||
} |
|||
|
|||
public async Task SetClientFeatureAsync(string clientId, string featureName, string value) |
|||
{ |
|||
// Set client feature value |
|||
await _featureManager.SetForClientAsync(clientId, featureName, value); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## More |
|||
|
|||
* This module depends on the LINGYUN.Abp.Features.Client module |
|||
* Supports localization configuration through AbpFeatureManagementResource |
|||
* Provides permission control for client feature management |
|||
|
|||
[简体中文](./README.md) | [English](./README.EN.md) |
|||
@ -0,0 +1,51 @@ |
|||
# LINGYUN.Abp.Features.Client |
|||
|
|||
Client feature validation component |
|||
|
|||
## Features |
|||
|
|||
* Provides ClientFeatureValueProvider |
|||
* Supports feature validation based on client ID |
|||
* Seamlessly integrates with ABP framework's feature management system |
|||
|
|||
## Configuration and Usage |
|||
|
|||
1. Add module dependency |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpFeaturesClientModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
2. Usage example |
|||
|
|||
```csharp |
|||
public class YourService |
|||
{ |
|||
private readonly IFeatureChecker _featureChecker; |
|||
|
|||
public YourService(IFeatureChecker featureChecker) |
|||
{ |
|||
_featureChecker = featureChecker; |
|||
} |
|||
|
|||
public async Task DoSomethingAsync() |
|||
{ |
|||
// Check if a feature is enabled for the client |
|||
if (await _featureChecker.IsEnabledAsync("YourFeature")) |
|||
{ |
|||
// Business logic |
|||
} |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## More |
|||
|
|||
* This module is mainly used for client feature validation, typically used in conjunction with the LINGYUN.Abp.FeatureManagement.Client module |
|||
* The name of the client feature value provider is "C" |
|||
|
|||
[简体中文](./README.md) | [English](./README.EN.md) |
|||
Loading…
Reference in new issue