Browse Source

feat(docs): 添加功能验证管理模块文档

pull/1049/head
feijie 1 year ago
parent
commit
cf9c7f2d39
  1. 49
      aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.EN.md
  2. 49
      aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/README.md
  3. 56
      aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.EN.md
  4. 56
      aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/README.md
  5. 55
      aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.EN.md
  6. 43
      aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.md
  7. 51
      aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.EN.md
  8. 39
      aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.md

49
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)

49
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)

56
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)

56
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)

55
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)

43
aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/README.md

@ -2,13 +2,54 @@
针对客户端的功能验证管理授权 针对客户端的功能验证管理授权
## 功能特性
* 提供客户端功能管理提供者(ClientFeatureManagementProvider)
* 支持客户端功能的权限管理
* 支持本地化资源管理
* 与ABP框架的功能管理模块无缝集成
## 配置使用 ## 配置使用
1. 添加模块依赖
```csharp ```csharp
[DependsOn(typeof(AbpFeatureManagementClientModule))] [DependsOn(typeof(AbpFeatureManagementClientModule))]
public class YouProjectModule : AbpModule 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)

51
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)

39
aspnet-core/framework/features/LINGYUN.Abp.Features.Client/README.md

@ -2,13 +2,50 @@
针对客户端的功能验证 针对客户端的功能验证
## 功能特性
* 提供客户端功能值提供者(ClientFeatureValueProvider)
* 支持基于客户端ID的功能验证
* 与ABP框架的功能管理系统无缝集成
## 配置使用 ## 配置使用
1. 添加模块依赖
```csharp ```csharp
[DependsOn(typeof(AbpFeaturesClientModule))] [DependsOn(typeof(AbpFeaturesClientModule))]
public class YouProjectModule : AbpModule 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)

Loading…
Cancel
Save