From cf9c7f2d3921364597c662b8b2896073dfac1ba8 Mon Sep 17 00:00:00 2001 From: feijie Date: Tue, 10 Dec 2024 21:58:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(docs):=20=E6=B7=BB=E5=8A=A0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E9=AA=8C=E8=AF=81=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../README.EN.md | 49 ++++++++++++++++ .../README.md | 49 ++++++++++++++++ .../README.EN.md | 56 +++++++++++++++++++ .../README.md | 56 +++++++++++++++++++ .../README.EN.md | 55 ++++++++++++++++++ .../README.md | 43 +++++++++++++- .../LINGYUN.Abp.Features.Client/README.EN.md | 51 +++++++++++++++++ .../LINGYUN.Abp.Features.Client/README.md | 39 ++++++++++++- 8 files changed, 396 insertions(+), 2 deletions(-) create mode 100644 aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.EN.md create mode 100644 aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.md create mode 100644 aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.EN.md create mode 100644 aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.md create mode 100644 aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.EN.md create mode 100644 aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.EN.md diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.EN.md new file mode 100644 index 000000000..a882f9763 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.EN.md @@ -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) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.md new file mode 100644 index 000000000..8e8d2f520 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.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) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.EN.md new file mode 100644 index 000000000..669bf36bd --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/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) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.md new file mode 100644 index 000000000..8287b5e16 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.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) diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.EN.md b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.EN.md new file mode 100644 index 000000000..be40a0d8f --- /dev/null +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/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) diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.md b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.md index 46b62020b..dae4ce647 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.md +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.md @@ -2,13 +2,54 @@ 针对客户端的功能验证管理授权 +## 功能特性 + +* 提供客户端功能管理提供者(ClientFeatureManagementProvider) +* 支持客户端功能的权限管理 +* 支持本地化资源管理 +* 与ABP框架的功能管理模块无缝集成 + ## 配置使用 +1. 添加模块依赖 ```csharp [DependsOn(typeof(AbpFeatureManagementClientModule))] public class YouProjectModule : AbpModule { - // other + // other } ``` + +2. 权限配置 + +模块预定义了以下权限: +* FeatureManagement.ManageClientFeatures:管理客户端功能的权限 + +3. 使用示例 + +```csharp +public class YourService +{ + private readonly IFeatureManager _featureManager; + + public YourService(IFeatureManager featureManager) + { + _featureManager = featureManager; + } + + public async Task SetClientFeatureAsync(string clientId, string featureName, string value) + { + // 设置客户端功能值 + await _featureManager.SetForClientAsync(clientId, featureName, value); + } +} +``` + +## 更多 + +* 本模块依赖于LINGYUN.Abp.Features.Client模块 +* 支持通过AbpFeatureManagementResource进行本地化配置 +* 提供了针对客户端功能管理的权限控制 + +[简体中文](./README.md) | [English](./README.EN.md) diff --git a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.EN.md b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.EN.md new file mode 100644 index 000000000..fb0ac242d --- /dev/null +++ b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/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) diff --git a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.md b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.md index 88ae06140..f0862645f 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.md +++ b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.md @@ -2,13 +2,50 @@ 针对客户端的功能验证 +## 功能特性 + +* 提供客户端功能值提供者(ClientFeatureValueProvider) +* 支持基于客户端ID的功能验证 +* 与ABP框架的功能管理系统无缝集成 + ## 配置使用 +1. 添加模块依赖 ```csharp [DependsOn(typeof(AbpFeaturesClientModule))] public class YouProjectModule : AbpModule { - // other + // other } ``` + +2. 使用示例 + +```csharp +public class YourService +{ + private readonly IFeatureChecker _featureChecker; + + public YourService(IFeatureChecker featureChecker) + { + _featureChecker = featureChecker; + } + + public async Task DoSomethingAsync() + { + // 检查客户端是否启用某个功能 + if (await _featureChecker.IsEnabledAsync("YourFeature")) + { + // 业务逻辑 + } + } +} +``` + +## 更多 + +* 本模块主要用于客户端功能验证,通常与LINGYUN.Abp.FeatureManagement.Client模块配合使用 +* 客户端功能值提供者的名称为"C" + +[简体中文](./README.md) | [English](./README.EN.md)