diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.EN.md b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.EN.md new file mode 100644 index 000000000..7fccd5585 --- /dev/null +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.EN.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.AuditLogging.Elasticsearch + +[简体中文](./README.md) | English + +Elasticsearch implementation for the audit logging module. + +## Features + +* ElasticsearchAuditLogManager - Implements IAuditLogManager, managing audit logs with Elasticsearch +* ElasticsearchSecurityLogManager - Implements ISecurityLogManager, managing security logs with Elasticsearch + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuditLoggingElasticsearchModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Options + +* AbpAuditLoggingElasticsearchOptions.IndexPrefix - Index prefix, default is 'auditlogging' +* AbpAuditLoggingElasticsearchOptions.IndexSettings - Elasticsearch index settings + +## Multi-tenancy Support + +When integrated with the tenant module, the index will switch based on the tenant: +- For tenant-specific data: `{prefix}-{index}-{tenantId}` +- For host data: `{prefix}-{index}` + +## appsettings.json + +```json +{ + "AuditLogging": { + "Elasticsearch": { + "IndexPrefix": "auditlogging" + } + } +} +``` + +## Features + +1. Audit Log Management + - Store and retrieve audit logs in Elasticsearch + - Support for entity change tracking + - Flexible querying with various filters + - Support for extra properties + +2. Security Log Management + - Store and retrieve security logs in Elasticsearch + - Support for security-related events tracking + - Comprehensive querying capabilities + +3. Index Management + - Automatic index initialization + - Support for custom index settings + - Multi-tenant index isolation diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.md b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.md index 3da5f3174..568ac8e03 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.md +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.md @@ -1,5 +1,7 @@ # LINGYUN.Abp.AuditLogging.Elasticsearch +简体中文 | [English](./README.EN.md) + 审计模块 Elasticsearch 实现 ElasticsearchAuditLogManager 实现了 IAuditLogManager, 审计日志由ES管理 @@ -33,6 +35,4 @@ public class YouProjectModule : AbpModule "IndexPrefix": "auditlogging" } } -} - -``` \ No newline at end of file +} \ No newline at end of file diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/README.EN.md b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..30cc539c1 --- /dev/null +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/README.EN.md @@ -0,0 +1,48 @@ +# LINGYUN.Abp.AuditLogging.EntityFrameworkCore + +[简体中文](./README.md) | English + +EntityFrameworkCore implementation for the audit logging module. This module serves as a bridge, with the actual implementation delegated to the official ABP modules. + +## Features + +* AuditLogManager - Implements IAuditLogManager, audit logs are managed by the Volo.Abp.AuditLogging module +* SecurityLogManager - Implements ISecurityLogManager, security logs are managed by the Volo.Abp.Identity module + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuditLoggingEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +Please follow the configuration guidelines in the Volo.Abp.AuditLogging and Volo.Abp.Identity modules. + +## Database Configuration + +Configure the connection strings in your appsettings.json: + +```json +{ + "ConnectionStrings": { + "AbpIdentity": "Server=127.0.0.1;Database=Identity;User Id=root;Password=*", + "AbpAuditLogging": "Server=127.0.0.1;Database=AuditLogging;User Id=root;Password=*", + } +} +``` + +## Features + +1. Audit Log Management + - Store and retrieve audit logs using EntityFrameworkCore + - Support for entity change tracking + - Integration with ABP's identity system for security logs + +2. Auto Mapping + - Automatic mapping configuration for audit log entities + - Supports custom mapping profiles through AbpAutoMapperOptions diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/README.EN.md b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/README.EN.md new file mode 100644 index 000000000..d94976c70 --- /dev/null +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/README.EN.md @@ -0,0 +1,59 @@ +# LINGYUN.Abp.AuditLogging + +Audit logging core module, providing basic functionality and interface definitions for audit logging. + +[简体中文](./README.md) + +## Features + +* Audit logging infrastructure +* Audit log repository interface definitions +* Audit log manager interface definitions +* Support for ignoring specific types in audit logging + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuditLoggingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Auditing": { + "IsEnabled": true, // Enable or disable audit logging + "HideErrors": true, // Hide error information in audit logs + "IsEnabledForAnonymousUsers": true, // Enable audit logging for anonymous users + "IsEnabledForGetRequests": false, // Enable audit logging for GET requests + "ApplicationName": null // Application name + } +} +``` + +## Basic Usage + +1. Reference the module +2. Configure audit logging options +3. Implement an audit log storage provider (e.g., EntityFrameworkCore or Elasticsearch) + +## Advanced Features + +### Ignoring Specific Types + +By default, the module ignores audit logs for the following types: +* CancellationToken +* CancellationTokenSource + +You can add more types to ignore through configuration: + +```csharp +Configure(options => +{ + options.IgnoredTypes.AddIfNotContains(typeof(YourType)); +}); +``` diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/README.md b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/README.md new file mode 100644 index 000000000..a54d1738f --- /dev/null +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/README.md @@ -0,0 +1,59 @@ +# LINGYUN.Abp.AuditLogging + +审计日志核心模块,提供审计日志的基础功能和接口定义。 + +[English](./README.EN.md) + +## 功能特性 + +* 审计日志基础设施 +* 审计日志仓储接口定义 +* 审计日志管理器接口定义 +* 支持忽略特定类型的审计日志记录 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAuditLoggingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Auditing": { + "IsEnabled": true, // 是否启用审计日志 + "HideErrors": true, // 是否隐藏错误信息 + "IsEnabledForAnonymousUsers": true, // 是否为匿名用户启用审计日志 + "IsEnabledForGetRequests": false, // 是否为GET请求启用审计日志 + "ApplicationName": null // 应用程序名称 + } +} +``` + +## 基本用法 + +1. 引用模块 +2. 配置审计日志选项 +3. 实现审计日志存储提供者(例如:EntityFrameworkCore或Elasticsearch) + +## 高级功能 + +### 忽略特定类型 + +默认情况下,模块会忽略以下类型的审计日志: +* CancellationToken +* CancellationTokenSource + +你可以通过配置添加更多需要忽略的类型: + +```csharp +Configure(options => +{ + options.IgnoredTypes.AddIfNotContains(typeof(YourType)); +}); +``` diff --git a/aspnet-core/framework/auditing/README.md b/aspnet-core/framework/auditing/README.md new file mode 100644 index 000000000..2f21293a5 --- /dev/null +++ b/aspnet-core/framework/auditing/README.md @@ -0,0 +1,113 @@ +# LINGYUN.Abp 审计模块 + +## 模块概述 + +审计模块提供了全面的日志记录和审计功能,支持多种存储方式和高度可配置的审计选项。 + +## 功能特性 + +### 核心功能 + +- 审计日志基础设施 +- 审计日志仓储接口定义 +- 审计日志管理器接口定义 +- 支持忽略特定类型的审计日志记录 + +### 存储支持 + +- EntityFrameworkCore 实现 +- Elasticsearch 实现 + +## 模块引用 + +### 核心模块 + +```csharp +[DependsOn(typeof(AbpAuditLoggingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +### EntityFrameworkCore 模块 + +```csharp +[DependsOn(typeof(AbpAuditLoggingEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +### Elasticsearch 模块 + +```csharp +[DependsOn(typeof(AbpAuditLoggingElasticsearchModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置选项 + +### 审计日志配置 + +```json +{ + "Auditing": { + "IsEnabled": true, // 是否启用审计日志 + "HideErrors": true, // 是否隐藏错误信息 + "IsEnabledForAnonymousUsers": true, // 是否为匿名用户启用审计日志 + "IsEnabledForGetRequests": false, // 是否为GET请求启用审计日志 + "ApplicationName": null // 应用程序名称 + } +} +``` + +### Elasticsearch 配置 + +```json +{ + "AuditLogging": { + "Elasticsearch": { + "IndexPrefix": "auditlogging" // 索引前缀 + } + } +} +``` + +## 数据库连接配置 + +```json +{ + "ConnectionStrings": { + "AbpIdentity": "Server=127.0.0.1;Database=Identity;User Id=root;Password=*", + "AbpAuditLogging": "Server=127.0.0.1;Database=AuditLogging;User Id=root;Password=*" + } +} +``` + +## 高级功能 + +### 忽略特定类型 + +默认情况下,模块会忽略以下类型的审计日志: + +- CancellationToken +- CancellationTokenSource + +你可以通过配置添加更多需要忽略的类型: + +```csharp +Configure(options => +{ + options.IgnoredTypes.AddIfNotContains(typeof(YourType)); +}); +``` + +## 特殊说明 + +- Elasticsearch 实现支持跨租户,将根据租户自动切换索引 +- EntityFrameworkCore 实现主要作为桥梁,具体实现交由 Abp 官方模块管理 diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/README.EN.md b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/README.EN.md new file mode 100644 index 000000000..e615967a7 --- /dev/null +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/README.EN.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.Authentication.QQ + +QQ Connect authentication module, integrating QQ login functionality into ABP applications. + +## Features + +* QQ OAuth2.0 authentication +* Support for both mobile and PC login +* Retrieve basic QQ user information (nickname, gender, avatar, etc.) +* Integration with ABP identity system + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuthenticationQQModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Authentication": { + "QQ": { + "AppId": "Your QQ Connect AppId", + "AppKey": "Your QQ Connect AppKey", + "IsMobile": false, // Enable mobile login page + "ClaimsIssuer": "connect.qq.com", // Optional, defaults to connect.qq.com + "CallbackPath": "/signin-qq", // Optional, defaults to /signin-qq + "Scope": ["get_user_info"] // Optional, defaults to get_user_info + } + } +} +``` + +## Basic Usage + +1. Configure QQ Connect Parameters + * Apply for an application on QQ Connect platform to get AppId and AppKey + * Configure AppId and AppKey in appsettings.json + +2. Add QQ Login + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAuthentication() + .AddQQConnect(); // Add QQ login support + } + ``` + +## Retrieved User Information + +* OpenId - Unique QQ user identifier +* NickName - User's nickname +* Gender - User's gender +* AvatarUrl - User's avatar URL + +## More Information + +* [QQ Connect Documentation](https://wiki.connect.qq.com/) +* [ABP Authentication Documentation](https://docs.abp.io/en/abp/latest/Authentication) diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/README.md b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/README.md new file mode 100644 index 000000000..cc73d19c9 --- /dev/null +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/README.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.Authentication.QQ + +QQ互联认证模块,集成QQ登录功能到ABP应用程序。 + +## 功能特性 + +* QQ OAuth2.0认证 +* 支持移动端和PC端登录 +* 获取QQ用户基本信息(昵称、性别、头像等) +* 支持与ABP身份系统集成 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAuthenticationQQModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Authentication": { + "QQ": { + "AppId": "你的QQ互联AppId", + "AppKey": "你的QQ互联AppKey", + "IsMobile": false, // 是否启用移动端登录页面 + "ClaimsIssuer": "connect.qq.com", // 可选,默认为 connect.qq.com + "CallbackPath": "/signin-qq", // 可选,默认为 /signin-qq + "Scope": ["get_user_info"] // 可选,默认为 get_user_info + } + } +} +``` + +## 基本用法 + +1. 配置QQ互联参数 + * 在QQ互联平台申请应用,获取AppId和AppKey + * 在appsettings.json中配置AppId和AppKey + +2. 添加QQ登录 + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAuthentication() + .AddQQConnect(); // 添加QQ登录支持 + } + ``` + +## 获取的用户信息 + +* OpenId - QQ用户唯一标识 +* NickName - 用户昵称 +* Gender - 用户性别 +* AvatarUrl - 用户头像URL + +## 更多信息 + +* [QQ互联文档](https://wiki.connect.qq.com/) +* [ABP认证文档](https://docs.abp.io/en/abp/latest/Authentication) diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/README.EN.md b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/README.EN.md new file mode 100644 index 000000000..ae62dc6c1 --- /dev/null +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/README.EN.md @@ -0,0 +1,81 @@ +# LINGYUN.Abp.Authentication.WeChat + +WeChat Official Account authentication module, integrating WeChat Official Account login functionality into ABP applications. + +## Features + +* WeChat Official Account OAuth2.0 authentication +* Retrieve WeChat user information (nickname, gender, region, avatar, etc.) +* Support for UnionId mechanism, connecting Official Account and Mini Program account systems +* Support for WeChat server message verification +* Integration with ABP identity system + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuthenticationWeChatModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Authentication": { + "WeChat": { + "AppId": "Your WeChat Official Account AppId", + "AppSecret": "Your WeChat Official Account AppSecret", + "ClaimsIssuer": "WeChat", // Optional, defaults to WeChat + "CallbackPath": "/signin-wechat", // Optional, defaults to /signin-wechat + "Scope": ["snsapi_login", "snsapi_userinfo"], // Optional, defaults to snsapi_login and snsapi_userinfo + "QrConnect": { + "Enabled": false, // Enable PC-side QR code login + "Endpoint": "https://open.weixin.qq.com/connect/qrconnect" // PC-side QR code login endpoint + } + } + } +} +``` + +## Basic Usage + +1. Configure WeChat Official Account Parameters + * Register an Official Account on WeChat Official Account Platform to get AppId and AppSecret + * Configure AppId and AppSecret in appsettings.json + +2. Add WeChat Login + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAuthentication() + .AddWeChat(); // Add WeChat login support + } + ``` + +3. Enable WeChat Server Message Verification (Optional) + ```csharp + public void Configure(IApplicationBuilder app) + { + app.UseWeChatSignature(); // Enable WeChat server message verification middleware + } + ``` + +## Retrieved User Information + +* OpenId - Unique WeChat user identifier +* UnionId - WeChat Open Platform unique identifier (requires binding to Open Platform) +* NickName - User's nickname +* Sex - User's gender +* Country - User's country +* Province - User's province +* City - User's city +* AvatarUrl - User's avatar URL +* Privilege - User's privilege information + +## More Information + +* [WeChat Official Account Platform Documentation](https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html) +* [ABP Authentication Documentation](https://docs.abp.io/en/abp/latest/Authentication) diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/README.md b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/README.md new file mode 100644 index 000000000..af19e67a8 --- /dev/null +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/README.md @@ -0,0 +1,81 @@ +# LINGYUN.Abp.Authentication.WeChat + +微信公众号认证模块,集成微信公众号登录功能到ABP应用程序。 + +## 功能特性 + +* 微信公众号OAuth2.0认证 +* 支持获取微信用户基本信息(昵称、性别、地区、头像等) +* 支持UnionId机制,打通公众号与小程序账号体系 +* 支持微信服务器消息验证 +* 支持与ABP身份系统集成 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAuthenticationWeChatModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Authentication": { + "WeChat": { + "AppId": "你的微信公众号AppId", + "AppSecret": "你的微信公众号AppSecret", + "ClaimsIssuer": "WeChat", // 可选,默认为 WeChat + "CallbackPath": "/signin-wechat", // 可选,默认为 /signin-wechat + "Scope": ["snsapi_login", "snsapi_userinfo"], // 可选,默认包含 snsapi_login 和 snsapi_userinfo + "QrConnect": { + "Enabled": false, // 是否启用PC端扫码登录 + "Endpoint": "https://open.weixin.qq.com/connect/qrconnect" // PC端扫码登录地址 + } + } + } +} +``` + +## 基本用法 + +1. 配置微信公众号参数 + * 在微信公众平台申请公众号,获取AppId和AppSecret + * 在appsettings.json中配置AppId和AppSecret + +2. 添加微信登录 + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAuthentication() + .AddWeChat(); // 添加微信登录支持 + } + ``` + +3. 启用微信服务器消息验证(可选) + ```csharp + public void Configure(IApplicationBuilder app) + { + app.UseWeChatSignature(); // 启用微信服务器消息验证中间件 + } + ``` + +## 获取的用户信息 + +* OpenId - 微信用户唯一标识 +* UnionId - 微信开放平台唯一标识(需要绑定开放平台) +* NickName - 用户昵称 +* Sex - 用户性别 +* Country - 国家 +* Province - 省份 +* City - 城市 +* AvatarUrl - 用户头像URL +* Privilege - 用户特权信息 + +## 更多信息 + +* [微信公众平台开发文档](https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html) +* [ABP认证文档](https://docs.abp.io/en/abp/latest/Authentication) diff --git a/aspnet-core/framework/authentication/README.md b/aspnet-core/framework/authentication/README.md new file mode 100644 index 000000000..ce8772b42 --- /dev/null +++ b/aspnet-core/framework/authentication/README.md @@ -0,0 +1,99 @@ +# LINGYUN.Abp.Authentication 认证模块 + +本模块提供第三方社交登录认证功能,目前支持 QQ 和微信公众号登录,并与 ABP 身份系统深度集成。 + +## 模块概述 + +认证模块包含两个主要子模块: + +1. **QQ 互联认证模块** + + - 支持 QQ OAuth2.0 认证 + - 适用于移动端和 PC 端登录 + - 获取用户基本信息(昵称、性别、头像等) + +2. **微信公众号认证模块** + - 支持微信公众号 OAuth2.0 认证 + - 获取用户详细信息(昵称、性别、地区、头像等) + - 支持 UnionId 机制,打通公众号与小程序账号体系 + +## 功能特性 + +- 第三方社交账号登录 +- 获取用户基本信息 +- 与 ABP 身份系统无缝集成 +- 灵活的配置选项 +- 支持多种登录场景(移动端、PC 端) + +## 快速开始 + +### 模块引用 + +```csharp +[DependsOn( + typeof(AbpAuthenticationQQModule), + typeof(AbpAuthenticationWeChatModule) +)] +public class YourProjectModule : AbpModule +{ + // 其他配置 +} +``` + +### 配置示例 + +在 `appsettings.json` 中配置第三方登录参数: + +```json +{ + "Authentication": { + "QQ": { + "AppId": "你的QQ互联AppId", + "AppKey": "你的QQ互联AppKey" + }, + "WeChat": { + "AppId": "你的微信公众号AppId", + "AppSecret": "你的微信公众号AppSecret" + } + } +} +``` + +### 添加登录支持 + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddAuthentication() + .AddQQConnect() // 添加QQ登录 + .AddWeChat(); // 添加微信登录 +} +``` + +## 支持的用户信息 + +### QQ 登录获取信息 + +- OpenId - QQ 用户唯一标识 +- NickName - 用户昵称 +- Gender - 用户性别 +- AvatarUrl - 用户头像 URL + +### 微信登录获取信息 + +- OpenId - 微信用户唯一标识 +- UnionId - 微信开放平台唯一标识 +- NickName - 用户昵称 +- Sex - 用户性别 +- Country, Province, City - 地理信息 +- AvatarUrl - 用户头像 URL + +## 参考文档 + +- [QQ 互联文档](https://wiki.connect.qq.com/) +- [微信公众平台开发文档](https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html) +- [ABP 认证文档](https://docs.abp.io/en/abp/latest/Authentication) + +## 许可证 + +遵循项目的开源许可证 diff --git a/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/README.EN.md b/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/README.EN.md new file mode 100644 index 000000000..51f932d07 --- /dev/null +++ b/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/README.EN.md @@ -0,0 +1,73 @@ +# LINGYUN.Abp.Authorization.OrganizationUnits + +Organization Unit Authorization Module, providing organization unit-based permission validation functionality. + +## Features + +* Support for organization unit-based permission validation +* Provides Organization Unit Permission Value Provider (OrganizationUnitPermissionValueProvider) +* Support for multiple organization unit permission validation +* Integration with ABP permission system +* Organization Unit Claim type extensions +* Current user organization unit query extensions + +## Module Reference + +```csharp +[DependsOn(typeof(AbpAuthorizationOrganizationUnitsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Configure Permission Provider + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.ValueProviders.Add(); + }); + } + ``` + +2. Get Current User's Organization Units + ```csharp + public class YourService + { + private readonly ICurrentUser _currentUser; + + public YourService(ICurrentUser currentUser) + { + _currentUser = currentUser; + } + + public void YourMethod() + { + var organizationUnits = _currentUser.FindOrganizationUnits(); + // Process business logic with organization units + } + } + ``` + +3. Get Organization Units from ClaimsPrincipal + ```csharp + public class YourService + { + public void YourMethod(ClaimsPrincipal principal) + { + var organizationUnits = principal.FindOrganizationUnits(); + // Process business logic with organization units + } + } + ``` + +## More Resources + +* [GitHub Repository](https://github.com/colinin/abp-next-admin) +* [Sample Application](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/services/LY.MicroService.Applications.Single) + +[简体中文](./README.md) diff --git a/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/README.md b/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/README.md new file mode 100644 index 000000000..3ddc184c9 --- /dev/null +++ b/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/README.md @@ -0,0 +1,73 @@ +# LINGYUN.Abp.Authorization.OrganizationUnits + +组织单元权限验证模块,提供基于组织单元的权限验证功能。 + +## 功能特性 + +* 支持基于组织单元的权限验证 +* 提供组织单元权限值提供者(OrganizationUnitPermissionValueProvider) +* 支持多组织单元权限验证 +* 集成ABP权限系统 +* 提供组织单元Claim类型扩展 +* 支持当前用户组织单元查询扩展 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAuthorizationOrganizationUnitsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 配置权限提供者 + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.ValueProviders.Add(); + }); + } + ``` + +2. 获取当前用户的组织单元 + ```csharp + public class YourService + { + private readonly ICurrentUser _currentUser; + + public YourService(ICurrentUser currentUser) + { + _currentUser = currentUser; + } + + public void YourMethod() + { + var organizationUnits = _currentUser.FindOrganizationUnits(); + // 使用组织单元进行业务处理 + } + } + ``` + +3. 从ClaimsPrincipal获取组织单元 + ```csharp + public class YourService + { + public void YourMethod(ClaimsPrincipal principal) + { + var organizationUnits = principal.FindOrganizationUnits(); + // 使用组织单元进行业务处理 + } + } + ``` + +## 更多资源 + +* [GitHub仓库](https://github.com/colinin/abp-next-admin) +* [示例应用程序](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/services/LY.MicroService.Applications.Single) + +[English](./README.EN.md) diff --git a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/README.md b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/README.md index 91d948a8f..e4268b17e 100644 --- a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/README.md +++ b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/README.md @@ -27,8 +27,24 @@ To get a detailed help for a command: labp help ``` +## Features + +* Support for generating TypeScript client proxy code + - Axios HTTP client + - Vben Admin integration + - UniApp integration +* Support for generating Flutter client proxy code + - Dio HTTP client + - REST service integration +* Support for generating view code + - Vben Admin view templates + - Flutter GetX view templates +* Custom ABP startup templates + ## Feedback Have a question and need feedback? -- [Github issuses](https://github.com/colinin/abp-next-admin/issuses) \ No newline at end of file +- [Github issues](https://github.com/colinin/abp-next-admin/issues) + +[简体中文](./README.zh-Hans.md) \ No newline at end of file diff --git a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/README.zh-Hans.md b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/README.zh-Hans.md new file mode 100644 index 000000000..61b716992 --- /dev/null +++ b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/README.zh-Hans.md @@ -0,0 +1,50 @@ +# 基于ABP CLI的扩展工具集 + +提供快速创建模板项目、生成JavaScript库命令等更多功能。 + +## 开始使用 + +```shell +dotnet tool install --global LINGYUN.Abp.Cli +``` + +## 使用方法 + +```shell +使用方法: + + labp [options] + +命令列表: + + > help: 显示命令行帮助。使用 ` labp help ` 获取详细帮助 + > create: 基于自定义的ABP启动模板生成新的解决方案 + > generate-proxy: 生成客户端服务代理和DTO以消费HTTP API + > generate-view: 从HTTP API代理生成视图代码 + +获取命令的详细帮助: + + labp help +``` + +## 功能特性 + +* 支持生成TypeScript客户端代理代码 + - Axios HTTP客户端 + - Vben Admin集成 + - UniApp集成 +* 支持生成Flutter客户端代理代码 + - Dio HTTP客户端 + - REST服务集成 +* 支持生成视图代码 + - Vben Admin视图模板 + - Flutter GetX视图模板 +* 自定义ABP启动模板 + +## 反馈 + +有问题需要反馈? + +- [Github问题](https://github.com/colinin/abp-next-admin/issues) + +[English](./README.md) diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.Features/README.EN.md b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.Features/README.EN.md new file mode 100644 index 000000000..c21ab1c0b --- /dev/null +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.Features/README.EN.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Aliyun.Features + +Alibaba Cloud service feature management module. + +## Features + +* Provides feature definitions and management for Alibaba Cloud services +* Supports enabling/disabling Alibaba Cloud service features +* Integration with ABP feature management system + +## Module Reference + +```csharp +[DependsOn(typeof(AbpAliyunFeaturesModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Feature Items + +* **Features:AlibabaCloud** - Alibaba Cloud service feature group + * **Features:AlibabaCloud:IsEnabled** - Enable/Disable Alibaba Cloud services + * Default value: false + * Description: Enable to give the application Alibaba Cloud service capabilities + +## Configuration Items + +This module is mainly used for feature definition and does not contain configuration items. + +## Notes + +* This module needs to be used in conjunction with the LINGYUN.Abp.Aliyun module +* After enabling Alibaba Cloud service features, you still need to configure the corresponding service parameters in the LINGYUN.Abp.Aliyun module + +[查看中文文档](README.md) diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.Features/README.md b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.Features/README.md new file mode 100644 index 000000000..72bd17850 --- /dev/null +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.Features/README.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Aliyun.Features + +阿里云服务功能管理模块。 + +## 功能特性 + +* 提供阿里云服务的功能定义和管理 +* 支持启用/禁用阿里云服务功能 +* 与ABP功能管理系统集成 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAliyunFeaturesModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 功能项 + +* **Features:AlibabaCloud** - 阿里云服务功能组 + * **Features:AlibabaCloud:IsEnabled** - 是否启用阿里云服务 + * 默认值:false + * 描述:启用使应用程序拥有阿里云服务的能力 + +## 配置项 + +此模块主要用于功能定义,不包含配置项。 + +## 注意 + +* 此模块需要与LINGYUN.Abp.Aliyun模块配合使用 +* 启用阿里云服务功能后,还需要在LINGYUN.Abp.Aliyun模块中配置相应的服务参数 + +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/README.EN.md b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/README.EN.md new file mode 100644 index 000000000..0bdc4ab2b --- /dev/null +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/README.EN.md @@ -0,0 +1,23 @@ +# LINGYUN.Abp.Aliyun.SettingManagement + +Alibaba Cloud configuration management module. By referencing this module, you can manage Alibaba Cloud-related configurations and access the API interfaces published through the gateway aggregation. + +API endpoint: api/setting-management/aliyun + +## Module Reference + +The module should be referenced as needed. It is recommended to reference this module in the configuration management hosting service. + +```csharp +[DependsOn(typeof(AbpAliyunSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Note + +Since the background management module is responsible for managing all configurations, this module only provides query interfaces. + +[查看中文文档](README.md) diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/README.md b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/README.md index 66baecce3..48e66cdf5 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/README.md +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/README.md @@ -1,12 +1,20 @@ # LINGYUN.Abp.Aliyun.SettingManagement -阿里云配置管理模块,引用此模块可管理阿里云相关的配置,可通过网关聚合对外公布的API接口 +阿里云配置管理模块,引用此模块可管理阿里云相关的配置,可通过网关聚合对外公布的API接口。 -API接口: api/setting-management/aliyun +## 功能特性 -## 配置使用 +* 提供阿里云服务配置的查询接口 +* 支持通过API接口获取阿里云配置信息 +* 与ABP设置管理系统集成 -模块按需引用,建议在配置管理承载服务引用此模块 +## API接口 + +* **GET api/setting-management/aliyun** - 获取阿里云配置信息 + +## 模块引用 + +模块按需引用,建议在配置管理承载服务引用此模块。 ```csharp [DependsOn(typeof(AbpAliyunSettingManagementModule))] @@ -15,6 +23,11 @@ public class YouProjectModule : AbpModule // other } ``` + ## 注意 -因后台管理模块负责管理所有配置,此模块仅提供查询接口 +* 因后台管理模块负责管理所有配置,此模块仅提供查询接口 +* 需要与LINGYUN.Abp.Aliyun模块配合使用 +* 建议在配置管理承载服务中引用此模块 + +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/README.EN.md b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/README.EN.md new file mode 100644 index 000000000..5fb453139 --- /dev/null +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/README.EN.md @@ -0,0 +1,144 @@ +# LINGYUN.Abp.Aliyun + +Alibaba Cloud SDK integration module. + +Reference: [Alibaba Cloud API Documentation](https://help.aliyun.com/document_detail/28763.html) + +## Features + +- Provides basic SDK integration for Alibaba Cloud services +- Supports Alibaba Cloud RAM (Resource Access Management) authentication +- Supports STS Token access +- Supports Alibaba Cloud SMS service +- Supports Alibaba Cloud Object Storage Service (OSS) +- Provides distributed cache support for optimizing high concurrency scenarios + +## Module Reference + +```csharp +[DependsOn(typeof(AbpAliyunModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Items + +### Authentication Configuration + +- **AliyunSettingNames.Authorization.RegionId** + + - Description: Alibaba Cloud service region + - Type: Optional + - Default value: default + - Example: oss-cn-hangzhou + +- **AliyunSettingNames.Authorization.AccessKeyId** + + - Description: AccessKey ID of Alibaba Cloud RAM account + - Type: Required + - How to get: Access Alibaba Cloud Console - Access Control + +- **AliyunSettingNames.Authorization.AccessKeySecret** + - Description: AccessKey Secret of RAM account + - Type: Required + - How to get: Access Alibaba Cloud Console - Access Control + +### STS Token Configuration + +- **AliyunSettingNames.Authorization.UseSecurityTokenService** + + - Description: Whether to use STS Token access + - Type: Optional + - Default value: false + - Recommendation: Recommended to enable for improved security + +- **AliyunSettingNames.Authorization.RamRoleArn** + + - Description: Alibaba Cloud RAM role ARN + - Type: Required when STS Token is enabled + - Format: acs:ram::$accountID:role/$roleName + +- **AliyunSettingNames.Authorization.RoleSessionName** + + - Description: Custom token name + - Type: Optional + - Usage: For access auditing + +- **AliyunSettingNames.Authorization.DurationSeconds** + + - Description: Token expiration time + - Type: Optional + - Default value: 3000 + - Unit: Seconds + +- **AliyunSettingNames.Authorization.Policy** + - Description: Permission policy + - Type: Optional + - Format: JSON string + +### SMS Service Configuration + +```json +{ + "Settings": { + "Abp.Aliyun.Sms": { + "Domain": "dysmsapi.aliyuncs.com", // API endpoint, default is dysmsapi.aliyuncs.com + "Version": "2017-05-25", // API version, default is 2017-05-25 + "ActionName": "SendSms", // API method name, default is SendSms + "DefaultSignName": "", // Default SMS signature + "DefaultTemplateCode": "", // Default SMS template code + "DefaultPhoneNumber": "", // Default phone number for receiving SMS + "VisableErrorToClient": "false" // Whether to show error messages to client + } + } +} +``` + +## Available Regions + +The module supports the following Alibaba Cloud regions: + +- China Regions + + - North China 1 (Qingdao) - cn-qingdao + - North China 2 (Beijing) - cn-beijing + - North China 3 (Zhangjiakou) - cn-zhangjiakou + - North China 5 (Hohhot) - cn-huhehaote + - East China 1 (Hangzhou) - cn-hangzhou + - East China 2 (Shanghai) - cn-shanghai + - South China 1 (Shenzhen) - cn-shenzhen + - South China 2 (Heyuan) - cn-heyuan + - South China 3 (Guangzhou) - cn-guangzhou + - Southwest 1 (Chengdu) - cn-chengdu + +- Hong Kong and International Regions + - Hong Kong - cn-hongkong + - US (Silicon Valley) - us-west-1 + - US (Virginia) - us-east-1 + - Japan (Tokyo) - ap-northeast-1 + - South Korea (Seoul) - ap-northeast-2 + - Singapore - ap-southeast-1 + - Australia (Sydney) - ap-southeast-2 + - Malaysia (Kuala Lumpur) - ap-southeast-3 + - Indonesia (Jakarta) - ap-southeast-5 + - Philippines (Manila) - ap-southeast-6 + - Thailand (Bangkok) - ap-southeast-7 + - India (Mumbai) - ap-south-1 + - Germany (Frankfurt) - eu-central-1 + - UK (London) - eu-west-1 + - UAE (Dubai) - me-east-1 + +## Performance Optimization + +- In high concurrency scenarios, it is recommended to enable distributed caching to improve performance +- When using STS Token, the token will be automatically cached until expiration +- It is recommended to set DurationSeconds reasonably to avoid frequent token refreshes + +## Related Modules + +- [LINGYUN.Abp.Aliyun.SettingManagement](../LINGYUN.Abp.Aliyun.SettingManagement/README.md) - Provides configuration management functionality +- [LINGYUN.Abp.Aliyun.Features](../LINGYUN.Abp.Aliyun.Features/README.md) - Provides feature management functionality + +[查看中文文档](README.md) diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/README.md b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/README.md index 6cb396563..e9cb61afa 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/README.md +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/README.md @@ -1,12 +1,19 @@ # LINGYUN.Abp.Aliyun -阿里云sdk集成 +阿里云 SDK 集成模块。 -参照:https://help.aliyun.com/document_detail/28763.html +参照:[阿里云 API 文档](https://help.aliyun.com/document_detail/28763.html) -## 配置使用 +## 功能特性 -模块按需引用 +- 提供阿里云服务的基础 SDK 集成 +- 支持阿里云 RAM(访问控制)认证 +- 支持 STS Token 访问 +- 支持阿里云短信服务(SMS) +- 支持阿里云对象存储(OSS) +- 提供分布式缓存支持,优化高并发场景 + +## 模块引用 ```csharp [DependsOn(typeof(AbpAliyunModule))] @@ -15,17 +22,123 @@ public class YouProjectModule : AbpModule // other } ``` + ## 配置项说明 -* AliyunSettingNames.Authorization.RegionId 可选,区域,默认 default -* AliyunSettingNames.Authorization.AccessKeyId 必须,阿里云RAM账号的AccessKey ID -* AliyunSettingNames.Authorization.AccessKeySecret 必须,RAM账号的AccessKey Secret -* AliyunSettingNames.Authorization.UseSecurityTokenService 可选,建议,使用STS Token访问,按照阿里云文档,建议使用Sts Token访问API,默认false -* AliyunSettingNames.Authorization.RamRoleArn 可选,启用Sts Token之后必须配置,阿里云RAM角色ARN -* AliyunSettingNames.Authorization.RoleSessionName 可选,启用Sts Token之后的用户自定义令牌名称,用于访问审计 -* AliyunSettingNames.Authorization.DurationSeconds 可选,用户令牌的过期时间,单位为秒,默认3000 -* AliyunSettingNames.Authorization.Policy 可选,权限策略,为json字符串 +### 认证配置 + +- **AliyunSettingNames.Authorization.RegionId** + + - 说明:阿里云服务区域 + - 类型:可选 + - 默认值:default + - 示例:oss-cn-hangzhou + +- **AliyunSettingNames.Authorization.AccessKeyId** + + - 说明:阿里云 RAM 账号的 AccessKey ID + - 类型:必须 + - 获取方式:访问阿里云控制台-访问控制 + +- **AliyunSettingNames.Authorization.AccessKeySecret** + - 说明:RAM 账号的 AccessKey Secret + - 类型:必须 + - 获取方式:访问阿里云控制台-访问控制 + +### STS Token 配置 + +- **AliyunSettingNames.Authorization.UseSecurityTokenService** + + - 说明:是否使用 STS Token 访问 + - 类型:可选 + - 默认值:false + - 建议:建议开启,提高安全性 + +- **AliyunSettingNames.Authorization.RamRoleArn** + + - 说明:阿里云 RAM 角色 ARN + - 类型:启用 STS Token 时必须 + - 格式:acs:ram::$accountID:role/$roleName + +- **AliyunSettingNames.Authorization.RoleSessionName** + + - 说明:用户自定义令牌名称 + - 类型:可选 + - 用途:用于访问审计 + +- **AliyunSettingNames.Authorization.DurationSeconds** + + - 说明:用户令牌的过期时间 + - 类型:可选 + - 默认值:3000 + - 单位:秒 + +- **AliyunSettingNames.Authorization.Policy** + - 说明:权限策略 + - 类型:可选 + - 格式:JSON 字符串 + +### 短信服务配置 + +```json +{ + "Settings": { + "Abp.Aliyun.Sms": { + "Domain": "dysmsapi.aliyuncs.com", // API域名,默认为 dysmsapi.aliyuncs.com + "Version": "2017-05-25", // API版本,默认为 2017-05-25 + "ActionName": "SendSms", // API方法名,默认为 SendSms + "DefaultSignName": "", // 默认短信签名 + "DefaultTemplateCode": "", // 默认短信模板代码 + "DefaultPhoneNumber": "", // 默认接收短信的手机号码 + "VisableErrorToClient": "false" // 是否向客户端显示错误信息 + } + } +} +``` + +## 可用区域 + +本模块支持以下阿里云区域: + +- 中国区域 + + - 华北 1(青岛)- cn-qingdao + - 华北 2(北京)- cn-beijing + - 华北 3(张家口)- cn-zhangjiakou + - 华北 5(呼和浩特)- cn-huhehaote + - 华东 1(杭州)- cn-hangzhou + - 华东 2(上海)- cn-shanghai + - 华南 1(深圳)- cn-shenzhen + - 华南 2(河源)- cn-heyuan + - 华南 3(广州)- cn-guangzhou + - 西南 1(成都)- cn-chengdu + +- 香港及海外区域 + - 香港 - cn-hongkong + - 美国(硅谷)- us-west-1 + - 美国(弗吉尼亚)- us-east-1 + - 日本(东京)- ap-northeast-1 + - 韩国(首尔)- ap-northeast-2 + - 新加坡 - ap-southeast-1 + - 澳大利亚(悉尼)- ap-southeast-2 + - 马来西亚(吉隆坡)- ap-southeast-3 + - 印度尼西亚(雅加达)- ap-southeast-5 + - 菲律宾(马尼拉)- ap-southeast-6 + - 泰国(曼谷)- ap-southeast-7 + - 印度(孟买)- ap-south-1 + - 德国(法兰克福)- eu-central-1 + - 英国(伦敦)- eu-west-1 + - 阿联酋(迪拜)- me-east-1 + +## 性能优化 + +- 在高并发场景下,建议开启分布式缓存以提高性能 +- 使用 STS Token 时,Token 会自动缓存到过期前 +- 建议合理设置 DurationSeconds,避免过于频繁的 Token 刷新 + +## 相关模块 -## 其他 +- [LINGYUN.Abp.Aliyun.SettingManagement](../LINGYUN.Abp.Aliyun.SettingManagement/README.md) - 提供配置管理功能 +- [LINGYUN.Abp.Aliyun.Features](../LINGYUN.Abp.Aliyun.Features/README.md) - 提供功能管理功能 -网络因素在高并发下可能会出现预期外的异常,考虑使用二级缓存 +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/framework/cloud-aliyun/README.md b/aspnet-core/framework/cloud-aliyun/README.md new file mode 100644 index 000000000..bd5216537 --- /dev/null +++ b/aspnet-core/framework/cloud-aliyun/README.md @@ -0,0 +1,33 @@ +# LINGYUN.Abp.Aliyun 模块概述 + +## 简介 +LINGYUN.Abp.Aliyun 模块集成了阿里云的 SDK,提供了对阿里云服务的全面支持,包括认证、短信服务和对象存储等功能。 + +## 包含的项目列表 +- **LINGYUN.Abp.Aliyun** +- **LINGYUN.Abp.Aliyun.Features** +- **LINGYUN.Abp.Aliyun.SettingManagement** + +## 每个项目的主要功能概述 + +### LINGYUN.Abp.Aliyun +- 提供阿里云服务的基础 SDK 集成。 +- 支持阿里云 RAM 认证和 STS Token 访问。 +- 支持短信服务和对象存储。 +- 提供分布式缓存支持。 + +### LINGYUN.Abp.Aliyun.Features +- 提供阿里云服务的功能定义和管理。 +- 支持启用/禁用阿里云服务功能。 +- 与 ABP 功能管理系统集成。 + +### LINGYUN.Abp.Aliyun.SettingManagement +- 提供阿里云服务配置的查询接口。 +- 通过 API 接口获取阿里云配置信息。 +- 与 ABP 设置管理系统集成。 + +## 模块的整体用途和重要性 +该模块为开发者提供了与阿里云服务的无缝集成,简化了云服务的使用和管理,提升了应用程序的灵活性和可扩展性。 + +## 如何使用或集成该模块 +在项目中引用相应的模块,并根据需要配置阿里云的相关参数。确保与 ABP 框架的其他模块配合使用,以实现最佳效果。 diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/README.EN.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/README.EN.md new file mode 100644 index 000000000..1d465743a --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/README.EN.md @@ -0,0 +1,137 @@ +# LINGYUN.Abp.BlobStoring.Tencent + +Tencent Cloud Object Storage (COS) Module, integrating Tencent Cloud Object Storage service into ABP BlobStoring system. + +## Features + +* Support for Tencent Cloud Object Storage service +* Multi-tenant configuration support +* Automatic bucket creation support +* Bucket referer configuration support +* Multi-region configuration support +* File size limit support +* Tenant-isolated storage support + +## Configuration Items + +### Basic Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "Your Tencent Cloud SecretId", // Get from Tencent Cloud Console + "SecretKey": "Your Tencent Cloud SecretKey", // Get from Tencent Cloud Console + "DurationSecond": "600" // Session duration in seconds + } + } +} +``` + +### Object Storage Configuration + +```json +{ + "Tencent": { + "OSS": { + "AppId": "", // Tencent Cloud AppId + "Region": "", // Bucket region + "BucketName": "", // Bucket name + "CreateBucketIfNotExists": false, // Create bucket if not exists + "CreateBucketReferer": [] // Referer settings when creating bucket + } + } +} +``` + +### Bucket Naming Rules + +* Only lowercase letters and numbers are supported, i.e., [a-z, 0-9], hyphen "-" and their combinations +* Cannot start or end with a hyphen (-) +* The maximum allowed characters for bucket names are affected by the region abbreviation and APPID, with a total limit of 60 characters for the complete request domain +* For more rules, refer to [Tencent Cloud Bucket Naming Rules](https://cloud.tencent.com/document/product/436/13312) + +### Object Naming Rules + +* Cannot start with forward slash / or backslash \\ +* ASCII control characters are not supported in object keys: up arrow (↑), down arrow (↓), right arrow (→), left arrow (←) +* For more rules, refer to [Tencent Cloud Object Naming Rules](https://cloud.tencent.com/document/product/436/13324) + +## Basic Usage + +1. Add module dependency +```csharp +[DependsOn(typeof(AbpBlobStoringTencentCloudModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Configure Tencent Cloud Object Storage +```csharp +Configure(options => +{ + options.Containers.Configure(container => + { + container.UseTencentCloud(tencent => + { + tencent.AppId = "Your Tencent Cloud AppId"; + tencent.Region = "ap-guangzhou"; + tencent.BucketName = "your-bucket-name"; + tencent.CreateBucketIfNotExists = true; + tencent.CreateBucketReferer = new List + { + "*.example.com", + "example.com" + }; + }); + }); +}); +``` + +3. Use BLOB storage +```csharp +public class YourService +{ + private readonly IBlobContainer _blobContainer; + + public YourService(IBlobContainer blobContainer) + { + _blobContainer = blobContainer; + } + + public async Task SaveBlobAsync(string name, Stream stream) + { + await _blobContainer.SaveAsync(name, stream); + } + + public async Task GetBlobAsync(string name) + { + return await _blobContainer.GetAsync(name); + } +} +``` + +## Advanced Features + +### Multi-tenant Support + +The module supports tenant-isolated storage with the following path format: +* Host: `host/{blobName}` +* Tenant: `tenants/{tenantId}/{blobName}` + +### Feature Management + +The module provides the following feature switches: + +* TencentBlobStoring - Controls enabling/disabling of Tencent Cloud Object Storage service +* TencentBlobStoringMaximumStreamSize - Controls the maximum file size limit (MB) for uploads + +## More Documentation + +* [Tencent Cloud Object Storage](https://cloud.tencent.com/document/product/436) +* [Tencent Cloud COS Console](https://console.cloud.tencent.com/cos) +* [ABP BlobStoring System](https://docs.abp.io/en/abp/latest/Blob-Storing) + +[简体中文](./README.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/README.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/README.md new file mode 100644 index 000000000..e4b304105 --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/README.md @@ -0,0 +1,137 @@ +# LINGYUN.Abp.BlobStoring.Tencent + +腾讯云对象存储(COS)模块,集成腾讯云对象存储服务到ABP BlobStoring系统。 + +## 功能特性 + +* 支持腾讯云对象存储服务 +* 支持多租户配置 +* 支持自动创建存储桶(Bucket) +* 支持存储桶防盗链配置 +* 支持多区域配置 +* 支持文件大小限制 +* 支持按租户隔离存储 + +## 配置项说明 + +### 基础配置 + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "您的腾讯云SecretId", // 从腾讯云控制台获取 + "SecretKey": "您的腾讯云SecretKey", // 从腾讯云控制台获取 + "DurationSecond": "600" // 会话持续时长,单位秒 + } + } +} +``` + +### 对象存储配置 + +```json +{ + "Tencent": { + "OSS": { + "AppId": "", // 腾讯云AppId + "Region": "", // 存储桶所在地域 + "BucketName": "", // 存储桶名称 + "CreateBucketIfNotExists": false, // 存储桶不存在时是否创建 + "CreateBucketReferer": [] // 创建存储桶时的防盗链设置 + } + } +} +``` + +### 存储桶命名规范 + +* 仅支持小写英文字母和数字,即[a-z,0-9]、中划线"-"及其组合 +* 不能以短划线(-)开头或结尾 +* 存储桶名称的最大允许字符受到地域简称和APPID的字符数影响,组成的完整请求域名字符数总计最多60个字符 +* 更多规范请参考[腾讯云存储桶命名规范](https://cloud.tencent.com/document/product/436/13312) + +### 对象命名规范 + +* 不允许以正斜线/或者反斜线\\开头 +* 对象键中不支持ASCII控制字符中的字符上(↑),字符下(↓),字符右(→),字符左(←) +* 更多规范请参考[腾讯云对象命名规范](https://cloud.tencent.com/document/product/436/13324) + +## 基本用法 + +1. 添加模块依赖 +```csharp +[DependsOn(typeof(AbpBlobStoringTencentCloudModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 配置腾讯云对象存储 +```csharp +Configure(options => +{ + options.Containers.Configure(container => + { + container.UseTencentCloud(tencent => + { + tencent.AppId = "您的腾讯云AppId"; + tencent.Region = "ap-guangzhou"; + tencent.BucketName = "your-bucket-name"; + tencent.CreateBucketIfNotExists = true; + tencent.CreateBucketReferer = new List + { + "*.example.com", + "example.com" + }; + }); + }); +}); +``` + +3. 使用BLOB存储 +```csharp +public class YourService +{ + private readonly IBlobContainer _blobContainer; + + public YourService(IBlobContainer blobContainer) + { + _blobContainer = blobContainer; + } + + public async Task SaveBlobAsync(string name, Stream stream) + { + await _blobContainer.SaveAsync(name, stream); + } + + public async Task GetBlobAsync(string name) + { + return await _blobContainer.GetAsync(name); + } +} +``` + +## 高级特性 + +### 多租户支持 + +模块支持按租户隔离存储,存储路径格式如下: +* 宿主:`host/{blobName}` +* 租户:`tenants/{tenantId}/{blobName}` + +### 特性管理 + +模块提供以下特性开关: + +* TencentBlobStoring - 控制腾讯云对象存储服务的启用/禁用 +* TencentBlobStoringMaximumStreamSize - 控制上传文件的最大大小限制(MB) + +## 更多文档 + +* [腾讯云对象存储](https://cloud.tencent.com/document/product/436) +* [腾讯云COS控制台](https://console.cloud.tencent.com/cos) +* [ABP BlobStoring系统](https://docs.abp.io/en/abp/latest/Blob-Storing) + +[English](./README.EN.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/README.EN.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/README.EN.md new file mode 100644 index 000000000..5364e881f --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/README.EN.md @@ -0,0 +1,128 @@ +# LINGYUN.Abp.Sms.Tencent + +Tencent Cloud SMS Service Module, integrating Tencent Cloud SMS service into ABP applications. + +## Features + +* Support for Tencent Cloud SMS sending functionality +* Multi-tenant configuration support +* Default signature and template configuration support +* Support for batch sending to multiple phone numbers +* SMS template parameter support +* Built-in error handling and logging + +## Configuration Items + +### Basic Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "Your Tencent Cloud SecretId", // Get from Tencent Cloud Console + "SecretKey": "Your Tencent Cloud SecretKey", // Get from Tencent Cloud Console + "DurationSecond": "600" // Session duration in seconds + } + } +} +``` + +### SMS Service Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud.Sms": { + "AppId": "", // SMS application ID, generated after adding application in SMS console + "DefaultSignName": "", // Default SMS signature + "DefaultTemplateId": "" // Default SMS template ID + } + } +} +``` + +## Basic Usage + +1. Add module dependency +```csharp +[DependsOn(typeof(AbpSmsTencentModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Configure Tencent Cloud SMS service +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "Your Tencent Cloud SecretId", + "SecretKey": "Your Tencent Cloud SecretKey", + "DurationSecond": "600" + }, + "Abp.TencentCloud.Sms": { + "AppId": "Your SMS Application ID", + "DefaultSignName": "Your SMS Signature", + "DefaultTemplateId": "Your Default Template ID" + } + } +} +``` + +3. SMS sending examples +```csharp +public class YourService +{ + private readonly ISmsSender _smsSender; + + public YourService(ISmsSender smsSender) + { + _smsSender = smsSender; + } + + // Send using default signature and template + public async Task SendSmsAsync(string phoneNumber, Dictionary templateParams) + { + await _smsSender.SendAsync( + phoneNumber, + nameof(TencentCloudSmsSender), + templateParams); + } + + // Send using specified signature and template + public async Task SendSmsAsync( + string signName, + string templateCode, + string phoneNumber, + Dictionary templateParams) + { + await _smsSender.SendAsync( + signName, + templateCode, + phoneNumber, + templateParams); + } +} +``` + +## Advanced Features + +### Feature Switches + +The module provides the following feature switches: + +* TencentSms - Controls enabling/disabling of Tencent Cloud SMS service + +### Error Handling + +* Throws exception when all SMS sending fails +* Logs warning when partial SMS sending fails +* Supports viewing detailed failure information, including serial number, phone number, error code, and error message + +## More Documentation + +* [Tencent Cloud SMS Service](https://cloud.tencent.com/document/product/382) +* [SMS Console](https://console.cloud.tencent.com/smsv2) + +[简体中文](./README.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/README.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/README.md new file mode 100644 index 000000000..80dfa5eb4 --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/README.md @@ -0,0 +1,127 @@ +# LINGYUN.Abp.Sms.Tencent + +腾讯云短信服务模块,集成腾讯云短信服务到ABP应用程序。 + +## 功能特性 + +* 支持腾讯云短信服务的发送功能 +* 支持多租户配置 +* 支持默认签名和模板配置 +* 支持多手机号批量发送 +* 支持短信模板参数传递 +* 内置错误处理和日志记录 + +## 配置项说明 + +### 基础配置 + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "您的腾讯云SecretId", // 从腾讯云控制台获取 + "SecretKey": "您的腾讯云SecretKey", // 从腾讯云控制台获取 + "DurationSecond": "600" // 会话持续时长,单位秒 + } + } +} +``` + +### 短信服务配置 + +```json +{ + "Settings": { + "Abp.TencentCloud.Sms": { + "AppId": "", // 短信应用ID,在短信控制台添加应用后生成 + "DefaultSignName": "", // 默认短信签名 + "DefaultTemplateId": "" // 默认短信模板ID + } + } +} +``` + +## 基本用法 + +1. 添加模块依赖 +```csharp +[DependsOn(typeof(AbpSmsTencentModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 配置腾讯云短信服务 +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "您的腾讯云SecretId", + "SecretKey": "您的腾讯云SecretKey" + }, + "Abp.TencentCloud.Sms": { + "AppId": "您的短信应用ID", + "DefaultSignName": "您的短信签名", + "DefaultTemplateId": "您的默认模板ID" + } + } +} +``` + +3. 发送短信示例 +```csharp +public class YourService +{ + private readonly ISmsSender _smsSender; + + public YourService(ISmsSender smsSender) + { + _smsSender = smsSender; + } + + // 使用默认签名和模板发送 + public async Task SendSmsAsync(string phoneNumber, Dictionary templateParams) + { + await _smsSender.SendAsync( + phoneNumber, + nameof(TencentCloudSmsSender), + templateParams); + } + + // 使用指定签名和模板发送 + public async Task SendSmsAsync( + string signName, + string templateCode, + string phoneNumber, + Dictionary templateParams) + { + await _smsSender.SendAsync( + signName, + templateCode, + phoneNumber, + templateParams); + } +} +``` + +## 高级特性 + +### 特性开关 + +模块提供以下特性开关: + +* TencentSms - 控制腾讯云短信服务的启用/禁用 + +### 错误处理 + +* 当所有短信发送失败时,会抛出异常 +* 当部分短信发送失败时,会记录警告日志 +* 支持查看发送失败的详细信息,包括流水号、手机号、错误代码和错误信息 + +## 更多文档 + +* [腾讯云短信服务](https://cloud.tencent.com/document/product/382) +* [短信控制台](https://console.cloud.tencent.com/smsv2) + +[English](./README.EN.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/README.EN.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/README.EN.md new file mode 100644 index 000000000..cbbec1529 --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/README.EN.md @@ -0,0 +1,81 @@ +# LINGYUN.Abp.Tencent.QQ + +Tencent QQ Connect module, integrating QQ Connect service into ABP applications. + +## Features + +* Support for QQ Connect quick login +* Multi-tenant configuration support +* Provides QQ Connect client factory for dynamic client creation + +## Configuration Items + +### Basic Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "Your Tencent Cloud SecretId", // Get from Tencent Cloud Console + "SecretKey": "Your Tencent Cloud SecretKey", // Get from Tencent Cloud Console + "DurationSecond": "600" // Session duration in seconds + } + } +} +``` + +### QQ Connect Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud.QQConnect": { + "AppId": "", // QQ Connect AppId, get from QQ Connect Management Center + "AppKey": "", // QQ Connect AppKey, get from QQ Connect Management Center + "IsMobile": "false" // Whether to use mobile style, default is PC style + } + } +} +``` + +## Basic Usage + +1. Add module dependency +```csharp +[DependsOn(typeof(AbpTencentQQModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Configure QQ Connect service + +Refer to the configuration items description above for the corresponding configuration. + +3. QQ Connect service usage example +```csharp +public class YourService +{ + private readonly TencentQQClientFactory _qqClientFactory; + + public YourService(TencentQQClientFactory qqClientFactory) + { + _qqClientFactory = qqClientFactory; + } + + public async Task QQConnectAsync() + { + var qqClient = await _qqClientFactory.CreateAsync(); + // Use qqClient to call QQ Connect service APIs + // For detailed API usage, please refer to QQ Connect development documentation + } +} +``` + +## More Documentation + +* [QQ Connect Open Platform](https://connect.qq.com/) +* [QQ Connect Development Documentation](https://wiki.connect.qq.com/) + +[简体中文](./README.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/README.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/README.md new file mode 100644 index 000000000..ecbea9a6e --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/README.md @@ -0,0 +1,81 @@ +# LINGYUN.Abp.Tencent.QQ + +腾讯QQ互联模块,集成腾讯QQ互联服务到ABP应用程序。 + +## 功能特性 + +* 支持QQ互联快速登录 +* 支持多租户配置 +* 提供QQ互联客户端工厂,支持动态创建客户端 + +## 配置项说明 + +### 基础配置 + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "您的腾讯云SecretId", // 从腾讯云控制台获取 + "SecretKey": "您的腾讯云SecretKey", // 从腾讯云控制台获取 + "DurationSecond": "600" // 会话持续时间(秒) + } + } +} +``` + +### QQ互联配置 + +```json +{ + "Settings": { + "Abp.TencentCloud.QQConnect": { + "AppId": "", // QQ互联应用ID,从QQ互联管理中心获取 + "AppKey": "", // QQ互联应用密钥,从QQ互联管理中心获取 + "IsMobile": "false" // 是否使用移动端样式,默认为PC端样式 + } + } +} +``` + +## 基本用法 + +1. 添加模块依赖 +```csharp +[DependsOn(typeof(AbpTencentQQModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 配置QQ互联服务 + +参考上述配置项说明进行相应配置。 + +3. QQ互联服务使用示例 +```csharp +public class YourService +{ + private readonly TencentQQClientFactory _qqClientFactory; + + public YourService(TencentQQClientFactory qqClientFactory) + { + _qqClientFactory = qqClientFactory; + } + + public async Task QQConnectAsync() + { + var qqClient = await _qqClientFactory.CreateAsync(); + // 使用qqClient调用QQ互联服务API + // 详细API使用方法请参考QQ互联开发文档 + } +} +``` + +## 更多文档 + +* [QQ互联开放平台](https://connect.qq.com/) +* [QQ互联开发文档](https://wiki.connect.qq.com/) + +[English](./README.EN.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/README.EN.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/README.EN.md new file mode 100644 index 000000000..d5e8be196 --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/README.EN.md @@ -0,0 +1,156 @@ +# LINGYUN.Abp.Tencent.SettingManagement + +Tencent Cloud Service Setting Management Module, providing configuration management interface and API for Tencent Cloud services. + +## Features + +* Provides configuration management interface for Tencent Cloud services +* Supports global and tenant-level configuration management +* Supports configuration for the following Tencent Cloud services: + * Basic configuration (keys, regions, etc.) + * Connection configuration (HTTP method, timeout, proxy, etc.) + * SMS service configuration (application ID, default signature, default template, etc.) + * QQ Connect configuration (application ID, application key, etc.) +* Built-in permission management +* Multi-language localization support +* Support for all Tencent Cloud available regions + +## Permissions + +* `TencentCloud` - Tencent Cloud service permission group + * `TencentCloud.Settings` - Configure Tencent Cloud service permission + +## API Endpoints + +### Get Global Configuration + +```http +GET /api/setting-management/tencent/by-global +``` + +### Get Current Tenant Configuration + +```http +GET /api/setting-management/tencent/by-current-tenant +``` + +## Basic Usage + +1. Add module dependency +```csharp +[DependsOn(typeof(AbpTencentCloudSettingManagementModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Configure authorization +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.GrantByDefault(TencentCloudSettingPermissionNames.Settings); + }); +} +``` + +## Configuration Items + +### Basic Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "EndPoint": "ap-guangzhou", // Resource region, default is Guangzhou + "SecretId": "Your Tencent Cloud SecretId", // Get from Tencent Cloud Console + "SecretKey": "Your Tencent Cloud SecretKey", // Get from Tencent Cloud Console + "DurationSecond": "600" // Session duration in seconds + } + } +} +``` + +### Connection Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud.Connection": { + "HttpMethod": "POST", // Request method, default is POST + "Timeout": "60", // Connection timeout in seconds + "WebProxy": "", // Proxy server address, optional + "EndPoint": "" // Specific service domain, required for financial zone services + } + } +} +``` + +### SMS Service Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud.Sms": { + "AppId": "", // SMS application ID, generated after adding application in SMS console + "DefaultSignName": "", // Default SMS signature + "DefaultTemplateId": "" // Default SMS template ID + } + } +} +``` + +### QQ Connect Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud.QQConnect": { + "AppId": "", // QQ Connect application ID, get from QQ Connect Management Center + "AppKey": "", // QQ Connect application key, get from QQ Connect Management Center + "IsMobile": "false" // Whether to use mobile style, default is PC style + } + } +} +``` + +## Available Regions + +The module supports the following Tencent Cloud regions: + +* China Regions + * North China (Beijing) - ap-beijing + * Southwest China (Chengdu) - ap-chengdu + * Southwest China (Chongqing) - ap-chongqing + * South China (Guangzhou) - ap-guangzhou + * Hong Kong/Macao/Taiwan (Hong Kong, China) - ap-hongkong + * East China (Nanjing) - ap-nanjing + * East China (Shanghai) - ap-shanghai + * East China (Shanghai Financial) - ap-shanghai-fsi + * South China (Shenzhen Financial) - ap-shenzhen-fsi + +* Asia Pacific + * Bangkok - ap-bangkok + * Jakarta - ap-jakarta + * Mumbai - ap-mumbai + * Seoul - ap-seoul + * Singapore - ap-singapore + * Tokyo - ap-tokyo + +* Europe + * Frankfurt - eu-frankfurt + * Moscow - eu-moscow + +* North America + * Virginia - na-ashburn + * Silicon Valley - na-siliconvalley + * Toronto - na-toronto + +## More Documentation + +* [Tencent Cloud API Key Management](https://console.cloud.tencent.com/cam/capi) +* [Tencent Cloud Regions and Availability Zones](https://cloud.tencent.com/document/product/213/6091) + +[简体中文](./README.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/README.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/README.md new file mode 100644 index 000000000..c5a7997dc --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/README.md @@ -0,0 +1,156 @@ +# LINGYUN.Abp.Tencent.SettingManagement + +腾讯云服务设置管理模块,提供腾讯云服务的配置管理界面和API。 + +## 功能特性 + +* 提供腾讯云服务的配置管理界面 +* 支持全局和租户级别的配置管理 +* 支持以下腾讯云服务的配置: + * 基础配置(密钥、地域等) + * 连接配置(HTTP方法、超时时间、代理等) + * 短信服务配置(应用ID、默认签名、默认模板等) + * QQ互联配置(应用ID、应用密钥等) +* 内置权限管理 +* 支持多语言本地化 +* 支持所有腾讯云可用区域的配置 + +## 权限 + +* `TencentCloud` - 腾讯云服务权限组 + * `TencentCloud.Settings` - 配置腾讯云服务权限 + +## API接口 + +### 获取全局配置 + +```http +GET /api/setting-management/tencent/by-global +``` + +### 获取当前租户配置 + +```http +GET /api/setting-management/tencent/by-current-tenant +``` + +## 基本用法 + +1. 添加模块依赖 +```csharp +[DependsOn(typeof(AbpTencentCloudSettingManagementModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 授权配置 +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.GrantByDefault(TencentCloudSettingPermissionNames.Settings); + }); +} +``` + +## 配置项说明 + +### 基础配置 + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "EndPoint": "ap-guangzhou", // 资源所在地域,默认为广州 + "SecretId": "您的腾讯云SecretId", // 从腾讯云控制台获取 + "SecretKey": "您的腾讯云SecretKey", // 从腾讯云控制台获取 + "DurationSecond": "600" // 会话持续时长,单位秒 + } + } +} +``` + +### 连接配置 + +```json +{ + "Settings": { + "Abp.TencentCloud.Connection": { + "HttpMethod": "POST", // 请求方法,默认POST + "Timeout": "60", // 连接超时时间,单位秒 + "WebProxy": "", // 代理服务器地址,可选 + "EndPoint": "" // 特定服务的域名,如金融区服务需要指定 + } + } +} +``` + +### 短信服务配置 + +```json +{ + "Settings": { + "Abp.TencentCloud.Sms": { + "AppId": "", // 短信应用ID,在短信控制台添加应用后生成 + "DefaultSignName": "", // 默认短信签名 + "DefaultTemplateId": "" // 默认短信模板ID + } + } +} +``` + +### QQ互联配置 + +```json +{ + "Settings": { + "Abp.TencentCloud.QQConnect": { + "AppId": "", // QQ互联应用ID,从QQ互联管理中心获取 + "AppKey": "", // QQ互联应用密钥,从QQ互联管理中心获取 + "IsMobile": "false" // 是否使用移动端样式,默认为PC端样式 + } + } +} +``` + +## 可用区域 + +模块支持以下腾讯云区域: + +* 中国区域 + * 华北地区(北京)- ap-beijing + * 西南地区(成都)- ap-chengdu + * 西南地区(重庆)- ap-chongqing + * 华南地区(广州)- ap-guangzhou + * 港澳台地区(中国香港)- ap-hongkong + * 华东地区(南京)- ap-nanjing + * 华东地区(上海)- ap-shanghai + * 华东地区(上海金融)- ap-shanghai-fsi + * 华南地区(深圳金融)- ap-shenzhen-fsi + +* 亚太地区 + * 曼谷 - ap-bangkok + * 雅加达 - ap-jakarta + * 孟买 - ap-mumbai + * 首尔 - ap-seoul + * 新加坡 - ap-singapore + * 东京 - ap-tokyo + +* 欧洲地区 + * 法兰克福 - eu-frankfurt + * 莫斯科 - eu-moscow + +* 北美地区 + * 弗吉尼亚 - na-ashburn + * 硅谷 - na-siliconvalley + * 多伦多 - na-toronto + +## 更多文档 + +* [腾讯云API密钥管理](https://console.cloud.tencent.com/cam/capi) +* [腾讯云地域和可用区](https://cloud.tencent.com/document/product/213/6091) + +[English](./README.EN.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/README.EN.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/README.EN.md new file mode 100644 index 000000000..91833c60d --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/README.EN.md @@ -0,0 +1,93 @@ +# LINGYUN.Abp.Tencent.TTS + +Tencent Cloud Text-to-Speech (TTS) Service Module, integrating Tencent Cloud TTS service into ABP applications. + +## Features + +* Support for Tencent Cloud Text-to-Speech (TTS) service +* Multi-tenant configuration support +* Based on Tencent Cloud TTS SDK V20190823 +* Provides TTS client factory for dynamic TTS client creation + +## Basic Usage + +1. Add module dependency +```csharp +[DependsOn(typeof(AbpTencentTTSModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Configure Tencent Cloud service +```json +{ + "Settings": { + "LINGYUN.Abp.Tencent": { + "SecretId": "Your Tencent Cloud SecretId", + "SecretKey": "Your Tencent Cloud SecretKey" + } + } +} +``` + +3. TTS service usage example +```csharp +public class YourService +{ + private readonly TencentCloudTTSClientFactory _ttsClientFactory; + + public YourService(TencentCloudTTSClientFactory ttsClientFactory) + { + _ttsClientFactory = ttsClientFactory; + } + + public async Task TextToSpeechAsync(string text) + { + var ttsClient = await _ttsClientFactory.CreateAsync(); + // Use ttsClient to call Tencent Cloud TTS service APIs + // For detailed API usage, please refer to Tencent Cloud TTS SDK documentation + } +} +``` + +## Configuration Items + +### Basic Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "Your Tencent Cloud SecretId", // Get from Tencent Cloud Console + "SecretKey": "Your Tencent Cloud SecretKey", // Get from Tencent Cloud Console + "DurationSecond": "600" // Session duration in seconds + } + } +} +``` + +### TTS Service Configuration + +```json +{ + "Settings": { + "Abp.TencentCloud.TTS": { + "AppId": "", // TTS application ID + "VoiceType": "", // Voice type, default is "0" + "Language": "1", // Language, 1-Chinese, 2-English + "Speed": "0", // Speech speed, range: -2~2 + "Volume": "0", // Volume, range: 0~10 + "ProjectId": "0" // Project ID + } + } +} +``` + +## More Documentation + +* [Tencent Cloud TTS Service](https://cloud.tencent.com/document/product/1073) +* [Tencent Cloud TTS SDK Documentation](https://cloud.tencent.com/document/product/1073/37927) + +[简体中文](./README.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/README.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/README.md new file mode 100644 index 000000000..d3e13d3d6 --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/README.md @@ -0,0 +1,93 @@ +# LINGYUN.Abp.Tencent.TTS + +腾讯云语音合成服务模块,集成腾讯云语音合成服务到ABP应用程序。 + +## 功能特性 + +* 支持腾讯云语音合成服务(TTS) +* 支持多租户配置 +* 基于腾讯云TTS SDK V20190823 +* 提供TTS客户端工厂,支持动态创建TTS客户端 + +## 基本用法 + +1. 添加模块依赖 +```csharp +[DependsOn(typeof(AbpTencentTTSModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 配置腾讯云服务 +```json +{ + "Settings": { + "LINGYUN.Abp.Tencent": { + "SecretId": "您的腾讯云SecretId", + "SecretKey": "您的腾讯云SecretKey" + } + } +} +``` + +3. 使用TTS服务示例 +```csharp +public class YourService +{ + private readonly TencentCloudTTSClientFactory _ttsClientFactory; + + public YourService(TencentCloudTTSClientFactory ttsClientFactory) + { + _ttsClientFactory = ttsClientFactory; + } + + public async Task TextToSpeechAsync(string text) + { + var ttsClient = await _ttsClientFactory.CreateAsync(); + // 使用ttsClient调用腾讯云TTS服务API + // 详细API使用方法请参考腾讯云TTS SDK文档 + } +} +``` + +## 配置项说明 + +### 基础配置 + +```json +{ + "Settings": { + "Abp.TencentCloud": { + "SecretId": "您的腾讯云SecretId", // 从腾讯云控制台获取 + "SecretKey": "您的腾讯云SecretKey", // 从腾讯云控制台获取 + "DurationSecond": "600" // 会话持续时间(秒) + } + } +} +``` + +### TTS服务配置 + +```json +{ + "Settings": { + "Abp.TencentCloud.TTS": { + "AppId": "", // TTS应用ID + "VoiceType": "", // 音色,默认为"0" + "Language": "1", // 语言,1-中文,2-英文 + "Speed": "0", // 语速,范围:-2~2 + "Volume": "0", // 音量,范围:0~10 + "ProjectId": "0" // 项目ID + } + } +} +``` + +## 更多文档 + +* [腾讯云语音合成服务](https://cloud.tencent.com/document/product/1073) +* [腾讯云TTS SDK文档](https://cloud.tencent.com/document/product/1073/37927) + +[English](./README.EN.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/README.EN.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/README.EN.md new file mode 100644 index 000000000..e042c59a2 --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/README.EN.md @@ -0,0 +1,87 @@ +# LINGYUN.Abp.Tencent + +Tencent Cloud Service Base Module, providing infrastructure support for other Tencent Cloud service modules. + +## Features + +* Provides Tencent Cloud SDK client factory, supporting dynamic creation of clients for various Tencent Cloud services +* Multi-tenant configuration support +* Built-in localization support (Chinese and English) +* Unified Tencent Cloud service configuration management +* Feature management support, enabling/disabling functionalities as needed +* Region localization display support + +## Configuration + +### Basic Settings + +```json +{ + "Settings": { + "LINGYUN.Abp.Tencent": { + "EndPoint": "ap-guangzhou", // Resource region, default is Guangzhou + "SecretId": "Your Tencent Cloud SecretId", // Get from Tencent Cloud Console + "SecretKey": "Your Tencent Cloud SecretKey", // Get from Tencent Cloud Console + "DurationSecond": "600" // Session duration in seconds + } + } +} +``` + +### Connection Settings + +```json +{ + "Settings": { + "LINGYUN.Abp.Tencent.Connection": { + "HttpMethod": "POST", // Request method, default is POST + "Timeout": "60", // Connection timeout in seconds + "WebProxy": "" // Proxy server address, optional + } + } +} +``` + +## Basic Usage + +1. Add module dependency +```csharp +[DependsOn(typeof(AbpTencentCloudModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Configure Tencent Cloud service +```json +{ + "Settings": { + "LINGYUN.Abp.Tencent": { + "SecretId": "Your Tencent Cloud SecretId", + "SecretKey": "Your Tencent Cloud SecretKey" + } + } +} +``` + +## Advanced Features + +### Feature Management + +The module provides the following feature switches: + +* TencentSms - Tencent Cloud SMS service +* TencentBlobStoring - Tencent Cloud Object Storage service + * MaximumStreamSize - Maximum file stream size limit for single upload (MB) + +### Multi-tenant Support + +All configurations support multi-tenant settings, allowing different Tencent Cloud service parameters for different tenants. + +## More Documentation + +* [Tencent Cloud API Key Management](https://console.cloud.tencent.com/cam/capi) +* [Tencent Cloud Regions and Availability Zones](https://cloud.tencent.com/document/product/213/6091) + +[简体中文](./README.md) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/README.md b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/README.md new file mode 100644 index 000000000..4e6af7322 --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/README.md @@ -0,0 +1,87 @@ +# LINGYUN.Abp.Tencent + +腾讯云服务基础模块,为其他腾讯云服务模块提供基础设施支持。 + +## 功能特性 + +* 提供腾讯云SDK客户端工厂,支持动态创建腾讯云各项服务的客户端 +* 支持多租户配置 +* 内置多语言本地化支持(中文和英文) +* 提供统一的腾讯云服务配置管理 +* 支持特性(Feature)管理,可按需启用/禁用功能 +* 支持区域(Region)本地化显示 + +## 配置项 + +### 基础配置 + +```json +{ + "Settings": { + "LINGYUN.Abp.Tencent": { + "EndPoint": "ap-guangzhou", // 资源所在地域,默认为广州 + "SecretId": "您的腾讯云SecretId", // 从腾讯云控制台获取 + "SecretKey": "您的腾讯云SecretKey", // 从腾讯云控制台获取 + "DurationSecond": "600" // 会话持续时长,单位秒 + } + } +} +``` + +### 连接配置 + +```json +{ + "Settings": { + "LINGYUN.Abp.Tencent.Connection": { + "HttpMethod": "POST", // 请求方法,默认POST + "Timeout": "60", // 连接超时时间,单位秒 + "WebProxy": "" // 代理服务器地址,可选 + } + } +} +``` + +## 基本用法 + +1. 添加模块依赖 +```csharp +[DependsOn(typeof(AbpTencentCloudModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 配置腾讯云服务 +```json +{ + "Settings": { + "LINGYUN.Abp.Tencent": { + "SecretId": "您的腾讯云SecretId", + "SecretKey": "您的腾讯云SecretKey" + } + } +} +``` + +## 高级特性 + +### 特性管理 + +模块提供以下特性开关: + +* TencentSms - 腾讯云短信服务 +* TencentBlobStoring - 腾讯云对象存储服务 + * MaximumStreamSize - 单次上传文件流大小限制(MB) + +### 多租户支持 + +所有配置均支持多租户配置,可以为不同租户配置不同的腾讯云服务参数。 + +## 更多文档 + +* [腾讯云API密钥管理](https://console.cloud.tencent.com/cam/capi) +* [腾讯云地域和可用区](https://cloud.tencent.com/document/product/213/6091) + +[English](./README.EN.md) diff --git a/aspnet-core/framework/cloud-tencent/README.md b/aspnet-core/framework/cloud-tencent/README.md new file mode 100644 index 000000000..10b839f4b --- /dev/null +++ b/aspnet-core/framework/cloud-tencent/README.md @@ -0,0 +1,42 @@ +# LINGYUN.Abp.Tencent 模块概述 + +## 简介 +LINGYUN.Abp.Tencent 模块集成了腾讯云的各项服务,提供了对腾讯云服务的全面支持,包括对象存储、短信服务、QQ 互联和语音合成等功能。 + +## 包含的项目列表 +- **LINGYUN.Abp.Tencent** +- **LINGYUN.Abp.BlobStoring.Tencent** +- **LINGYUN.Abp.Sms.Tencent** +- **LINGYUN.Abp.Tencent.QQ** +- **LINGYUN.Abp.Tencent.SettingManagement** +- **LINGYUN.Abp.Tencent.TTS** + +## 每个项目的主要功能概述 + +### LINGYUN.Abp.Tencent +- 提供腾讯云 SDK 客户端工厂,支持动态创建腾讯云各项服务的客户端。 +- 支持多租户配置和多语言本地化。 +- 提供统一的腾讯云服务配置管理。 + +### LINGYUN.Abp.BlobStoring.Tencent +- 支持腾讯云对象存储服务,自动创建存储桶。 +- 支持多区域配置和文件大小限制。 + +### LINGYUN.Abp.Sms.Tencent +- 支持腾讯云短信服务的发送功能,支持多手机号批量发送。 +- 内置错误处理和日志记录。 + +### LINGYUN.Abp.Tencent.QQ +- 支持 QQ 互联快速登录,支持多租户配置。 + +### LINGYUN.Abp.Tencent.SettingManagement +- 提供腾讯云服务的配置管理界面,支持全局和租户级别的配置管理。 + +### LINGYUN.Abp.Tencent.TTS +- 支持腾讯云语音合成服务,提供 TTS 客户端工厂。 + +## 模块的整体用途和重要性 +该模块为开发者提供了与腾讯云服务的无缝集成,简化了云服务的使用和管理,提升了应用程序的灵活性和可扩展性。 + +## 如何使用或集成该模块 +在项目中引用相应的模块,并根据需要配置腾讯云的相关参数。确保与 ABP 框架的其他模块配合使用,以实现最佳效果。 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/README.EN.md new file mode 100644 index 000000000..6e557659d --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/README.EN.md @@ -0,0 +1,94 @@ +# LINGYUN.Abp.BackgroundJobs.Hangfire + +English | [简体中文](README.md) + +## 1. Introduction + +`LINGYUN.Abp.BackgroundJobs.Hangfire` is an ABP background job module implemented based on [Hangfire](https://www.hangfire.io/). It provides a reliable background job execution framework that supports immediate, delayed, and recurring task execution. + +## 2. Features + +* Support for immediate task execution +* Support for delayed task execution +* Support for recurring tasks (using Cron expressions) +* Seamless integration with ABP background job system +* Job execution status tracking +* Job retry mechanism + +## 3. Installation + +```bash +dotnet add package LINGYUN.Abp.BackgroundJobs.Hangfire +``` + +## 4. Usage + +1. Add `AbpBackgroundJobsHangfireModule` to your module dependencies: + +```csharp +[DependsOn(typeof(AbpBackgroundJobsHangfireModule))] +public class YourModule : AbpModule +{ +} +``` + +2. Configure background jobs: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.IsJobExecutionEnabled = true; // Enable job execution + }); +} +``` + +3. Use background jobs: + +```csharp +public class YourService +{ + private readonly IBackgroundJobManager _backgroundJobManager; + + public YourService(IBackgroundJobManager backgroundJobManager) + { + _backgroundJobManager = backgroundJobManager; + } + + public async Task CreateJobAsync() + { + // Create immediate job + await _backgroundJobManager.EnqueueAsync(new YourArgs()); + + // Create delayed job + await _backgroundJobManager.EnqueueAsync( + new YourArgs(), + delay: TimeSpan.FromMinutes(5) + ); + + // Create recurring job + await _backgroundJobManager.EnqueueAsync( + "0 0 * * *", // Cron expression: Execute at 00:00 every day + new YourArgs() + ); + } +} +``` + +## 5. Configuration + +### 5.1 Job Configuration + +* `AbpBackgroundJobOptions.IsJobExecutionEnabled`: Whether to enable job execution. Default value: `true` + +## 6. Dependencies + +* Volo.Abp.BackgroundJobs +* Hangfire.Core +* Hangfire.AspNetCore + +## 7. Documentation and Resources + +* [Hangfire Official Documentation](https://docs.hangfire.io/) +* [ABP Framework Documentation](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/README.md b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/README.md new file mode 100644 index 000000000..15bed0155 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/README.md @@ -0,0 +1,94 @@ +# LINGYUN.Abp.BackgroundJobs.Hangfire + +[English](README.EN.md) | 简体中文 + +## 1. 介绍 + +`LINGYUN.Abp.BackgroundJobs.Hangfire` 是基于 [Hangfire](https://www.hangfire.io/) 实现的ABP后台作业模块。它提供了一个可靠的后台作业执行框架,支持即时任务、延迟任务和周期性任务的执行。 + +## 2. 功能特性 + +* 支持即时任务执行 +* 支持延迟任务执行 +* 支持周期性任务(使用Cron表达式) +* 与ABP后台作业系统无缝集成 +* 支持作业执行状态跟踪 +* 支持作业重试机制 + +## 3. 安装 + +```bash +dotnet add package LINGYUN.Abp.BackgroundJobs.Hangfire +``` + +## 4. 使用方法 + +1. 添加 `AbpBackgroundJobsHangfireModule` 到模块依赖中: + +```csharp +[DependsOn(typeof(AbpBackgroundJobsHangfireModule))] +public class YourModule : AbpModule +{ +} +``` + +2. 配置后台作业: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.IsJobExecutionEnabled = true; // 启用作业执行 + }); +} +``` + +3. 使用后台作业: + +```csharp +public class YourService +{ + private readonly IBackgroundJobManager _backgroundJobManager; + + public YourService(IBackgroundJobManager backgroundJobManager) + { + _backgroundJobManager = backgroundJobManager; + } + + public async Task CreateJobAsync() + { + // 创建即时任务 + await _backgroundJobManager.EnqueueAsync(new YourArgs()); + + // 创建延迟任务 + await _backgroundJobManager.EnqueueAsync( + new YourArgs(), + delay: TimeSpan.FromMinutes(5) + ); + + // 创建周期性任务 + await _backgroundJobManager.EnqueueAsync( + "0 0 * * *", // Cron表达式:每天0点执行 + new YourArgs() + ); + } +} +``` + +## 5. 配置项 + +### 5.1 作业配置 + +* `AbpBackgroundJobOptions.IsJobExecutionEnabled`: 是否启用作业执行。默认值: `true` + +## 6. 依赖项 + +* Volo.Abp.BackgroundJobs +* Hangfire.Core +* Hangfire.AspNetCore + +## 7. 文档和资源 + +* [Hangfire官方文档](https://docs.hangfire.io/) +* [ABP框架文档](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/README.EN.md new file mode 100644 index 000000000..7dbf9e43b --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/README.EN.md @@ -0,0 +1,82 @@ +# LINGYUN.Abp.BackgroundWorkers.Hangfire + +English | [简体中文](README.md) + +## 1. Introduction + +`LINGYUN.Abp.BackgroundWorkers.Hangfire` is an ABP background worker module implemented based on Hangfire. It provides a reliable way to manage and execute long-running background tasks, supporting automatic start, stop, and periodic execution features. + +## 2. Features + +* Support for automatic start and stop of background workers +* Support for periodically executing background tasks +* Seamless integration with ABP background worker system +* Worker status management +* Dependency injection support + +## 3. Installation + +```bash +dotnet add package LINGYUN.Abp.BackgroundWorkers.Hangfire +``` + +## 4. Usage + +1. Add `AbpBackgroundWorkersHangfireModule` to your module dependencies: + +```csharp +[DependsOn(typeof(AbpBackgroundWorkersHangfireModule))] +public class YourModule : AbpModule +{ +} +``` + +2. Create background worker: + +```csharp +public class YourBackgroundWorker : AsyncPeriodicBackgroundWorkerBase +{ + public YourBackgroundWorker( + AbpAsyncTimer timer, + IServiceScopeFactory serviceScopeFactory) + : base(timer, serviceScopeFactory) + { + Timer.Period = 5000; // Execute every 5 seconds + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + // Implement your background task logic here + await Task.CompletedTask; + } +} +``` + +3. Register background worker: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddTransient(); + Configure(options => + { + options.IsEnabled = true; // Enable background workers + }); +} +``` + +## 5. Configuration + +### 5.1 Worker Configuration + +* `AbpBackgroundWorkerOptions.IsEnabled`: Whether to enable background workers. Default value: `true` + +## 6. Dependencies + +* Volo.Abp.BackgroundWorkers +* LINGYUN.Abp.BackgroundJobs.Hangfire + +## 7. Documentation and Resources + +* [Hangfire Official Documentation](https://docs.hangfire.io/) +* [ABP Framework Documentation](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/README.md b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/README.md new file mode 100644 index 000000000..83127d6c3 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/README.md @@ -0,0 +1,82 @@ +# LINGYUN.Abp.BackgroundWorkers.Hangfire + +[English](README.EN.md) | 简体中文 + +## 1. 介绍 + +`LINGYUN.Abp.BackgroundWorkers.Hangfire` 是一个基于Hangfire实现的ABP后台工作者模块。它提供了一种可靠的方式来管理和执行长期运行的后台任务,支持自动启动、停止和定期执行等功能。 + +## 2. 功能特性 + +* 支持后台工作者的自动启动和停止 +* 支持定期执行的后台任务 +* 与ABP后台工作者系统无缝集成 +* 支持工作者状态管理 +* 支持依赖注入 + +## 3. 安装 + +```bash +dotnet add package LINGYUN.Abp.BackgroundWorkers.Hangfire +``` + +## 4. 使用方法 + +1. 添加 `AbpBackgroundWorkersHangfireModule` 到模块依赖中: + +```csharp +[DependsOn(typeof(AbpBackgroundWorkersHangfireModule))] +public class YourModule : AbpModule +{ +} +``` + +2. 创建后台工作者: + +```csharp +public class YourBackgroundWorker : AsyncPeriodicBackgroundWorkerBase +{ + public YourBackgroundWorker( + AbpAsyncTimer timer, + IServiceScopeFactory serviceScopeFactory) + : base(timer, serviceScopeFactory) + { + Timer.Period = 5000; // 每5秒执行一次 + } + + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + // 在这里实现你的后台任务逻辑 + await Task.CompletedTask; + } +} +``` + +3. 注册后台工作者: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddTransient(); + Configure(options => + { + options.IsEnabled = true; // 启用后台工作者 + }); +} +``` + +## 5. 配置项 + +### 5.1 工作者配置 + +* `AbpBackgroundWorkerOptions.IsEnabled`: 是否启用后台工作者。默认值: `true` + +## 6. 依赖项 + +* Volo.Abp.BackgroundWorkers +* LINGYUN.Abp.BackgroundJobs.Hangfire + +## 7. 文档和资源 + +* [Hangfire官方文档](https://docs.hangfire.io/) +* [ABP框架文档](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/README.EN.md new file mode 100644 index 000000000..745d34c1d --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/README.EN.md @@ -0,0 +1,85 @@ +# LINGYUN.Abp.BlobStoring.Aliyun + +Aliyun OSS implementation of the ABP framework's object storage provider **IBlobProvider**. + +## Features + +* Implements ABP's IBlobProvider interface using Aliyun OSS service +* Supports multi-tenant Blob storage +* Automatic Bucket creation +* Configurable Bucket access control +* STS Token access support +* Customizable Blob naming strategy + +## Module Reference + +First, define the **appsettings.json** file: + +```json +{ + "Aliyun": { + "OSS": { + "BucketName": "your-bucket-name", + "Endpoint": "http://oss-cn-shanghai.aliyuncs.com", + "CreateBucketIfNotExists": true + } + } +} +``` + +Then reference the module in your project: + +```csharp +[DependsOn(typeof(AbpBlobStoringAliyunModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +### OSS Configuration + +* **BucketName** + * Description: OSS storage space name + * Type: Optional + * Default: Container name + +* **Endpoint** + * Description: OSS service access point + * Type: Required + * Example: http://oss-cn-shanghai.aliyuncs.com + +* **CreateBucketIfNotExists** + * Description: Whether to automatically create the bucket if it doesn't exist + * Type: Optional + * Default: false + +* **CreateBucketReferer** + * Description: Bucket access whitelist + * Type: Optional + +### Blob Naming Rules + +* Container (Bucket) naming rules: + * Length must be between 3-63 characters + * Can only contain lowercase letters, numbers, and hyphens + * Must start with a letter or number + * Cannot start or end with a hyphen + +* Blob naming rules: + * Tenant: `tenants/{tenantId}/{blobName}` + * Host: `host/{blobName}` + +## Performance Optimization + +* Uses distributed caching for STS Token storage +* Supports data redundancy configuration +* Configurable Bucket access control for enhanced security + +## Related Modules + +* [LINGYUN.Abp.Aliyun](../../cloud-aliyun/LINGYUN.Abp.Aliyun/README.md) - Provides Aliyun basic integration + +[点击查看中文文档](README.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/README.md b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/README.md index 7973666c7..9d2fb7590 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/README.md +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/README.md @@ -1,12 +1,19 @@ # LINGYUN.Abp.BlobStoring.Aliyun -abp框架对象存储提供者**IBlobProvider**的阿里云实现 +ABP框架对象存储提供者**IBlobProvider**的阿里云OSS实现。 -## 配置使用 +## 功能特性 -模块按需引用 +* 实现ABP的IBlobProvider接口,使用阿里云OSS服务 +* 支持多租户Blob存储 +* 自动创建Bucket +* 可配置的Bucket访问控制 +* 支持STS Token访问 +* 可自定义的Blob命名策略 -事先定义**appsettings.json**文件 +## 模块引用 + +首先定义**appsettings.json**文件: ```json { @@ -18,13 +25,61 @@ abp框架对象存储提供者**IBlobProvider**的阿里云实现 } } } - ``` +然后在项目中引用模块: + ```csharp [DependsOn(typeof(AbpBlobStoringAliyunModule))] public class YouProjectModule : AbpModule { // other } -``` \ No newline at end of file +``` + +## 配置说明 + +### OSS配置 + +* **BucketName** + * 说明:OSS存储空间名称 + * 类型:可选 + * 默认值:容器名称 + +* **Endpoint** + * 说明:OSS服务的接入点 + * 类型:必须 + * 示例:http://oss-cn-shanghai.aliyuncs.com + +* **CreateBucketIfNotExists** + * 说明:如果Bucket不存在是否自动创建 + * 类型:可选 + * 默认值:false + +* **CreateBucketReferer** + * 说明:Bucket访问白名单 + * 类型:可选 + +### Blob命名规则 + +* 容器(Bucket)名称规则: + * 长度必须在3-63字符之间 + * 只能包含小写字母、数字和短横线 + * 必须以字母或数字开头 + * 不能以短横线开头或结尾 + +* Blob名称规则: + * 租户:`tenants/{tenantId}/{blobName}` + * 宿主:`host/{blobName}` + +## 性能优化 + +* 使用分布式缓存存储STS Token +* 支持数据冗余配置 +* 可配置的Bucket访问控制以提高安全性 + +## 相关模块 + +* [LINGYUN.Abp.Aliyun](../../cloud-aliyun/LINGYUN.Abp.Aliyun/README.md) - 提供阿里云基础集成 + +[Click to view English documentation](README.EN.md) \ No newline at end of file diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Core/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Core/README.EN.md new file mode 100644 index 000000000..2bb4de3eb --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Core/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.Core + +## Introduction + +`LINGYUN.Abp.Core` is a basic core module that provides some common functionalities and extensions. + +## Features + +* Dynamic Options Provider (`DynamicOptionsProvider`) + * Simplifies the complex steps of calling interfaces before using configuration + * Supports lazy loading of configuration values + * Provides one-time running mechanism to ensure configuration is loaded only once + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Core +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpCommonModule))]` to your module class. + +```csharp +[DependsOn(typeof(AbpCommonModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Use Dynamic Options Provider: + +```csharp +public class YourOptionsProvider : DynamicOptionsProvider +{ + public YourOptionsProvider(IOptions options) + : base(options) + { + } +} +``` + +## Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Core/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Core/README.md new file mode 100644 index 000000000..6afd486dd --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Core/README.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.Core + +## 介绍 + +`LINGYUN.Abp.Core` 是一个基础核心模块,提供了一些通用的功能和扩展。 + +## 功能 + +* 动态选项提供者 (`DynamicOptionsProvider`) + * 简化需要在使用配置前自行调用接口的繁复步骤 + * 支持延迟加载配置值 + * 提供一次性运行机制,确保配置只被加载一次 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Core +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpCommonModule))]` 到你的模块类上。 + +```csharp +[DependsOn(typeof(AbpCommonModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 使用动态选项提供者: + +```csharp +public class YourOptionsProvider : DynamicOptionsProvider +{ + public YourOptionsProvider(IOptions options) + : base(options) + { + } +} +``` + +## 链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md new file mode 100644 index 000000000..996edb9c7 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md @@ -0,0 +1,68 @@ +# LINGYUN.Abp.ExceptionHandling.Emailing + +An email notification type based on the ABP framework's **IExceptionSubscriber** interface. + +## Features + +* Supports exception email notifications +* Supports custom email templates +* Supports multilingual email content +* Supports stack trace sending +* Supports mapping between exception types and recipient mailboxes + +## Configuration and Usage + +Before use, you need to configure **AbpExceptionHandlingOptions** to define which exceptions need notifications, +then configure **AbpEmailExceptionHandlingOptions** to define specific exception type notification methods. + +```csharp + [DependsOn( + typeof(AbpEmailingExceptionHandlingModule) + )] + public class YouProjectModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Customize exceptions to handle + Configure(options => + { + // Add exception types that need to be handled + options.Handlers.Add(); + }); + // Customize exception types that need email notifications + Configure(options => + { + // Whether to send stack trace information + options.SendStackTrace = true; + // Default receiving email for unspecified exception receivers + options.DefaultReceiveEmail = "colin.in@foxmail.com"; + // Specify which email to send for a certain exception type + options.HandReceivedException("colin.in@foxmail.com"); + }); + } + } +``` + +## Configuration Options + +* `SendStackTrace`: Whether to include exception stack trace in the email +* `DefaultTitle`: Default email title +* `DefaultContentHeader`: Default email content header +* `DefaultContentFooter`: Default email content footer +* `DefaultReceiveEmail`: Default exception receiving email +* `Handlers`: Dictionary mapping exception types to receiving emails + +## Localization Resources + +The module includes localization resources in the following languages: +* en +* zh-Hans + +## Related Links + +* [Base Exception Handling Module](../LINGYUN.Abp.ExceptionHandling/README.EN.md) +* [Exception Real-time Notification Module](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md) + +## More + +For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin). diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md index c870a6afe..5f448bdbf 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md @@ -2,13 +2,20 @@ 基于abp框架底层的**IExceptionSubscriber**的邮件通知类型 +## 功能特性 + +* 支持异常邮件通知 +* 支持自定义邮件模板 +* 支持多语言邮件内容 +* 支持堆栈信息发送 +* 支持异常类型与接收邮箱映射 + ## 配置使用 使用前需要配置**AbpExceptionHandlingOptions**定义需要发送通知的异常 然后配置**AbpEmailExceptionHandlingOptions**定义具体异常类型通知方式 ```csharp - [DependsOn( typeof(AbpEmailingExceptionHandlingModule) )] @@ -34,4 +41,28 @@ }); } } -``` \ No newline at end of file +``` + +## 配置项说明 + +* `SendStackTrace`: 是否在邮件中包含异常堆栈信息 +* `DefaultTitle`: 默认邮件标题 +* `DefaultContentHeader`: 默认邮件内容头部 +* `DefaultContentFooter`: 默认邮件内容底部 +* `DefaultReceiveEmail`: 默认异常接收邮箱 +* `Handlers`: 异常类型与接收邮箱的映射字典 + +## 本地化资源 + +模块包含以下语言的本地化资源: +* en +* zh-Hans + +## 相关链接 + +* [基础异常处理模块](../LINGYUN.Abp.ExceptionHandling/README.md) +* [异常实时通知模块](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md) + +## 更多 + +有关更多信息和配置示例,请参阅[文档](https://github.com/colinin/abp-next-admin)。 \ No newline at end of file diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.EN.md new file mode 100644 index 000000000..ae1887fd6 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.ExceptionHandling + +A secondary extension based on the ABP framework's **IExceptionSubscriber** interface, used for customizing exception notification methods. + +## Features + +* Provides unified exception handling and notification mechanism +* Supports custom exception handlers +* Supports exception notification filtering +* Supports integration with other notification modules (such as email, real-time notifications, etc.) + +## Configuration and Usage + +Just configure **AbpExceptionHandlingOptions** to define which exceptions need to send notifications. + +```csharp + [DependsOn( + typeof(AbpExceptionHandlingModule) + )] + public class YouProjectModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Customize exception handling + Configure(options => + { + // Add exception types that need to be handled + options.Handlers.Add(); + }); + } + } +``` + +## Configuration Options + +* `Handlers`: List of exception handlers, used to define which exception types need to be handled +* `HasNotifierError`: Check if an exception needs to send notifications + +## Extension Modules + +* [LINGYUN.Abp.ExceptionHandling.Emailing](../LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md): Exception email notification module +* [LINGYUN.Abp.ExceptionHandling.Notifications](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md): Exception real-time notification module + +## More + +For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin). diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.md b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.md index fb0e77b7a..545130d1c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.md +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.md @@ -2,12 +2,18 @@ 基于abp框架底层的**IExceptionSubscriber**实现二次扩展,用于自定义异常通知方式 +## 功能特性 + +* 提供统一的异常处理和通知机制 +* 支持自定义异常处理程序 +* 支持异常通知筛选 +* 支持与其他通知模块集成(如邮件、实时通知等) + ## 配置使用 使用前只需配置**AbpExceptionHandlingOptions**定义需要发送通知的异常即可。 ```csharp - [DependsOn( typeof(AbpExceptionHandlingModule) )] @@ -23,4 +29,18 @@ }); } } -``` \ No newline at end of file +``` + +## 配置项说明 + +* `Handlers`: 异常处理程序列表,用于定义需要处理的异常类型 +* `HasNotifierError`: 检查异常是否需要发送通知 + +## 扩展模块 + +* [LINGYUN.Abp.ExceptionHandling.Emailing](../LINGYUN.Abp.ExceptionHandling.Emailing/README.md): 异常邮件通知模块 +* [LINGYUN.Abp.ExceptionHandling.Notifications](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md): 异常实时通知模块 + +## 更多 + +有关更多信息和配置示例,请参阅[文档](https://github.com/colinin/abp-next-admin)。 \ No newline at end of file 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/common/LINGYUN.Abp.Hangfire.Dashboard/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/README.EN.md new file mode 100644 index 000000000..269781fad --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/README.EN.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.Hangfire.Dashboard + +English | [简体中文](README.md) + +## 1. Introduction + +`LINGYUN.Abp.Hangfire.Dashboard` is an ABP module for integrating the Hangfire dashboard, providing a user-friendly web interface for monitoring and managing Hangfire background jobs. This module supports permission control and authentication to ensure secure access to the dashboard. + +## 2. Features + +* Integration with Hangfire dashboard +* Access control based on ABP permission system +* Support for loading dashboard in iframe +* Access token authentication support +* Dashboard permission caching mechanism + +## 3. Installation + +```bash +dotnet add package LINGYUN.Abp.Hangfire.Dashboard +``` + +## 4. Usage + +1. Add `AbpHangfireDashboardModule` to your module dependencies: + +```csharp +[DependsOn(typeof(AbpHangfireDashboardModule))] +public class YourModule : AbpModule +{ +} +``` + +2. Configure middleware: + +```csharp +public override void OnApplicationInitialization(ApplicationInitializationContext context) +{ + var app = context.GetApplicationBuilder(); + + // Add Hangfire authentication middleware + app.UseHangfireAuthorication(); +} +``` + +3. Configure dashboard options: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(options => + { + options.Authorization = new[] + { + new DashboardAuthorizationFilter("YourPermissionName") + }; + }); +} +``` + +## 5. Authentication and Authorization + +### 5.1 Authentication Methods + +The module supports the following authentication methods: +* Pass access token via URL parameter: `?access_token=your_token` +* Pass access token via Cookie +* Pass access token via Authorization Header + +### 5.2 Permission Caching + +Permission check results are cached for 5 minutes to improve performance. + +## 6. Dependencies + +* Volo.Abp.Authorization +* Volo.Abp.Hangfire +* Microsoft.Extensions.Caching.Memory + +## 7. Documentation and Resources + +* [Hangfire Official Documentation](https://docs.hangfire.io/) +* [ABP Framework Documentation](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/README.md new file mode 100644 index 000000000..f188aa235 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/README.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.Hangfire.Dashboard + +[English](README.EN.md) | 简体中文 + +## 1. 介绍 + +`LINGYUN.Abp.Hangfire.Dashboard` 是一个用于集成Hangfire仪表板的ABP模块,它提供了一个用户友好的Web界面来监控和管理Hangfire后台作业。该模块支持权限控制和认证,确保仪表板的安全访问。 + +## 2. 功能特性 + +* 集成Hangfire仪表板 +* 基于ABP权限系统的访问控制 +* 支持通过iframe加载仪表板 +* 支持访问令牌认证 +* 仪表板权限缓存机制 + +## 3. 安装 + +```bash +dotnet add package LINGYUN.Abp.Hangfire.Dashboard +``` + +## 4. 使用方法 + +1. 添加 `AbpHangfireDashboardModule` 到模块依赖中: + +```csharp +[DependsOn(typeof(AbpHangfireDashboardModule))] +public class YourModule : AbpModule +{ +} +``` + +2. 配置中间件: + +```csharp +public override void OnApplicationInitialization(ApplicationInitializationContext context) +{ + var app = context.GetApplicationBuilder(); + + // 添加Hangfire认证中间件 + app.UseHangfireAuthorication(); +} +``` + +3. 配置仪表板选项: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(options => + { + options.Authorization = new[] + { + new DashboardAuthorizationFilter("YourPermissionName") + }; + }); +} +``` + +## 5. 认证和授权 + +### 5.1 认证方式 + +模块支持以下认证方式: +* 通过URL参数传递访问令牌: `?access_token=your_token` +* 通过Cookie传递访问令牌 +* 通过Authorization Header传递访问令牌 + +### 5.2 权限缓存 + +权限检查结果会被缓存5分钟,以提高性能。 + +## 6. 依赖项 + +* Volo.Abp.Authorization +* Volo.Abp.Hangfire +* Microsoft.Extensions.Caching.Memory + +## 7. 文档和资源 + +* [Hangfire官方文档](https://docs.hangfire.io/) +* [ABP框架文档](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/README.EN.md new file mode 100644 index 000000000..b793dfc5b --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/README.EN.md @@ -0,0 +1,77 @@ +# LINGYUN.Abp.Hangfire.Storage.MySql + +English | [简体中文](README.md) + +## 1. Introduction + +`LINGYUN.Abp.Hangfire.Storage.MySql` is an ABP module for configuring Hangfire to use MySQL as storage. This module provides a simple configuration approach to easily use MySQL as Hangfire's persistent storage. + +## 2. Features + +* Simple MySQL storage configuration +* Custom connection string support +* MySQL storage options configuration +* Seamless integration with ABP configuration system + +## 3. Installation + +```bash +dotnet add package LINGYUN.Abp.Hangfire.Storage.MySql +``` + +## 4. Usage + +1. Add `AbpHangfireMySqlStorageModule` to your module dependencies: + +```csharp +[DependsOn(typeof(AbpHangfireMySqlStorageModule))] +public class YourModule : AbpModule +{ +} +``` + +2. Configure connection string and storage options in appsettings.json: + +```json +{ + "Hangfire": { + "MySql": { + "Connection": "Server=localhost;Database=YourDb;Uid=root;Pwd=123456;", + "TablePrefix": "Hangfire", + "CommandBatchMaxTimeout": "00:05:00", + "SlidingInvisibilityTimeout": "00:05:00", + "QueuePollInterval": "00:00:00", + "UseRecommendedIsolationLevel": true, + "DisableGlobalLocks": true + } + } +} +``` + +## 5. Configuration + +### 5.1 Connection String Configuration + +The module looks for connection string in the following order: +1. `Hangfire:MySql:Connection` +2. `ConnectionStrings:Default` + +### 5.2 Storage Options + +* `TablePrefix`: Table prefix for database tables +* `CommandBatchMaxTimeout`: Maximum timeout for command batches +* `SlidingInvisibilityTimeout`: Sliding invisibility timeout +* `QueuePollInterval`: Queue polling interval +* `UseRecommendedIsolationLevel`: Whether to use recommended isolation level +* `DisableGlobalLocks`: Whether to disable global locks + +## 6. Dependencies + +* Volo.Abp.Hangfire +* Hangfire.MySql.Core + +## 7. Documentation and Resources + +* [Hangfire Official Documentation](https://docs.hangfire.io/) +* [Hangfire.MySql.Core Documentation](https://github.com/arnoldasgudas/Hangfire.MySqlStorage) +* [ABP Framework Documentation](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/README.md new file mode 100644 index 000000000..31dc54ba4 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/README.md @@ -0,0 +1,77 @@ +# LINGYUN.Abp.Hangfire.Storage.MySql + +[English](README.EN.md) | 简体中文 + +## 1. 介绍 + +`LINGYUN.Abp.Hangfire.Storage.MySql` 是一个用于配置Hangfire使用MySQL作为存储的ABP模块。该模块提供了简单的配置方式,让你能够轻松地将MySQL作为Hangfire的持久化存储。 + +## 2. 功能特性 + +* 简单的MySQL存储配置 +* 支持自定义连接字符串 +* 支持MySQL存储选项配置 +* 与ABP配置系统无缝集成 + +## 3. 安装 + +```bash +dotnet add package LINGYUN.Abp.Hangfire.Storage.MySql +``` + +## 4. 使用方法 + +1. 添加 `AbpHangfireMySqlStorageModule` 到模块依赖中: + +```csharp +[DependsOn(typeof(AbpHangfireMySqlStorageModule))] +public class YourModule : AbpModule +{ +} +``` + +2. 在appsettings.json中配置连接字符串和存储选项: + +```json +{ + "Hangfire": { + "MySql": { + "Connection": "Server=localhost;Database=YourDb;Uid=root;Pwd=123456;", + "TablePrefix": "Hangfire", + "CommandBatchMaxTimeout": "00:05:00", + "SlidingInvisibilityTimeout": "00:05:00", + "QueuePollInterval": "00:00:00", + "UseRecommendedIsolationLevel": true, + "DisableGlobalLocks": true + } + } +} +``` + +## 5. 配置项 + +### 5.1 连接字符串配置 + +模块会按以下顺序查找连接字符串: +1. `Hangfire:MySql:Connection` +2. `ConnectionStrings:Default` + +### 5.2 存储选项 + +* `TablePrefix`: 数据表前缀 +* `CommandBatchMaxTimeout`: 命令批处理最大超时时间 +* `SlidingInvisibilityTimeout`: 滑动不可见超时时间 +* `QueuePollInterval`: 队列轮询间隔 +* `UseRecommendedIsolationLevel`: 是否使用推荐的隔离级别 +* `DisableGlobalLocks`: 是否禁用全局锁 + +## 6. 依赖项 + +* Volo.Abp.Hangfire +* Hangfire.MySql.Core + +## 7. 文档和资源 + +* [Hangfire官方文档](https://docs.hangfire.io/) +* [Hangfire.MySql.Core文档](https://github.com/arnoldasgudas/Hangfire.MySqlStorage) +* [ABP框架文档](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/README.EN.md new file mode 100644 index 000000000..1187c9a80 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/README.EN.md @@ -0,0 +1,75 @@ +# LINGYUN.Abp.Hangfire.Storage.SqlServer + +English | [简体中文](README.md) + +## 1. Introduction + +`LINGYUN.Abp.Hangfire.Storage.SqlServer` is an ABP module for configuring Hangfire to use SQL Server as storage. This module provides a simple configuration approach to easily use SQL Server as Hangfire's persistent storage. + +## 2. Features + +* Simple SQL Server storage configuration +* Custom connection string support +* SQL Server storage options configuration +* Seamless integration with ABP configuration system + +## 3. Installation + +```bash +dotnet add package LINGYUN.Abp.Hangfire.Storage.SqlServer +``` + +## 4. Usage + +1. Add `AbpHangfireSqlServerStorageModule` to your module dependencies: + +```csharp +[DependsOn(typeof(AbpHangfireSqlServerStorageModule))] +public class YourModule : AbpModule +{ +} +``` + +2. Configure connection string and storage options in appsettings.json: + +```json +{ + "Hangfire": { + "SqlServer": { + "Connection": "Server=localhost;Database=YourDb;Trusted_Connection=True;", + "CommandBatchMaxTimeout": "00:05:00", + "SlidingInvisibilityTimeout": "00:05:00", + "QueuePollInterval": "00:00:00", + "UseRecommendedIsolationLevel": true, + "DisableGlobalLocks": true + } + } +} +``` + +## 5. Configuration + +### 5.1 Connection String Configuration + +The module looks for connection string in the following order: +1. `Hangfire:SqlServer:Connection` +2. `ConnectionStrings:Default` + +### 5.2 Storage Options + +* `CommandBatchMaxTimeout`: Maximum timeout for command batches +* `SlidingInvisibilityTimeout`: Sliding invisibility timeout +* `QueuePollInterval`: Queue polling interval +* `UseRecommendedIsolationLevel`: Whether to use recommended isolation level +* `DisableGlobalLocks`: Whether to disable global locks + +## 6. Dependencies + +* Volo.Abp.Hangfire +* Hangfire.SqlServer + +## 7. Documentation and Resources + +* [Hangfire Official Documentation](https://docs.hangfire.io/) +* [Hangfire.SqlServer Documentation](https://docs.hangfire.io/en/latest/configuration/using-sql-server.html) +* [ABP Framework Documentation](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/README.md new file mode 100644 index 000000000..076ede94e --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/README.md @@ -0,0 +1,75 @@ +# LINGYUN.Abp.Hangfire.Storage.SqlServer + +[English](README.EN.md) | 简体中文 + +## 1. 介绍 + +`LINGYUN.Abp.Hangfire.Storage.SqlServer` 是一个用于配置Hangfire使用SQL Server作为存储的ABP模块。该模块提供了简单的配置方式,让你能够轻松地将SQL Server作为Hangfire的持久化存储。 + +## 2. 功能特性 + +* 简单的SQL Server存储配置 +* 支持自定义连接字符串 +* 支持SQL Server存储选项配置 +* 与ABP配置系统无缝集成 + +## 3. 安装 + +```bash +dotnet add package LINGYUN.Abp.Hangfire.Storage.SqlServer +``` + +## 4. 使用方法 + +1. 添加 `AbpHangfireSqlServerStorageModule` 到模块依赖中: + +```csharp +[DependsOn(typeof(AbpHangfireSqlServerStorageModule))] +public class YourModule : AbpModule +{ +} +``` + +2. 在appsettings.json中配置连接字符串和存储选项: + +```json +{ + "Hangfire": { + "SqlServer": { + "Connection": "Server=localhost;Database=YourDb;Trusted_Connection=True;", + "CommandBatchMaxTimeout": "00:05:00", + "SlidingInvisibilityTimeout": "00:05:00", + "QueuePollInterval": "00:00:00", + "UseRecommendedIsolationLevel": true, + "DisableGlobalLocks": true + } + } +} +``` + +## 5. 配置项 + +### 5.1 连接字符串配置 + +模块会按以下顺序查找连接字符串: +1. `Hangfire:SqlServer:Connection` +2. `ConnectionStrings:Default` + +### 5.2 存储选项 + +* `CommandBatchMaxTimeout`: 命令批处理最大超时时间 +* `SlidingInvisibilityTimeout`: 滑动不可见超时时间 +* `QueuePollInterval`: 队列轮询间隔 +* `UseRecommendedIsolationLevel`: 是否使用推荐的隔离级别 +* `DisableGlobalLocks`: 是否禁用全局锁 + +## 6. 依赖项 + +* Volo.Abp.Hangfire +* Hangfire.SqlServer + +## 7. 文档和资源 + +* [Hangfire官方文档](https://docs.hangfire.io/) +* [Hangfire.SqlServer文档](https://docs.hangfire.io/en/latest/configuration/using-sql-server.html) +* [ABP框架文档](https://docs.abp.io/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/README.EN.md new file mode 100644 index 000000000..5830516f3 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/README.EN.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.Http.Client.Wrapper + +HTTP client wrapper module for automatically adding wrapper request headers in HTTP client requests. + +[简体中文](./README.md) + +## Features + +* Automatic addition of wrapper request headers +* Integration with ABP HTTP client +* Support for global wrapper configuration + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Http.Client.Wrapper +``` + +## Configuration + +```csharp +[DependsOn(typeof(AbpHttpClientWrapperModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Enable wrapper + options.IsEnabled = true; + }); + } +} +``` + +## How It Works + +When the wrapper is enabled (`AbpWrapperOptions.IsEnabled = true`), the module automatically adds the `_AbpWrapResult` header to all HTTP client requests. +When the wrapper is disabled (`AbpWrapperOptions.IsEnabled = false`), the module automatically adds the `_AbpDontWrapResult` header to all HTTP client requests. + +This ensures that the HTTP client request results remain consistent with the server-side wrapper configuration. + +## Source Code + +[LINGYUN.Abp.Http.Client.Wrapper](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/README.md new file mode 100644 index 000000000..4d8b8c220 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/README.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.Http.Client.Wrapper + +HTTP客户端包装器模块,用于在HTTP客户端请求中自动添加包装器请求头。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动添加包装器请求头 +* 与ABP HTTP客户端集成 +* 支持全局配置包装器开关 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Http.Client.Wrapper +``` + +## 配置使用 + +```csharp +[DependsOn(typeof(AbpHttpClientWrapperModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // 启用包装器 + options.IsEnabled = true; + }); + } +} +``` + +## 工作原理 + +当启用包装器时(`AbpWrapperOptions.IsEnabled = true`),模块会自动为所有HTTP客户端请求添加 `_AbpWrapResult` 请求头。 +当禁用包装器时(`AbpWrapperOptions.IsEnabled = false`),模块会自动为所有HTTP客户端请求添加 `_AbpDontWrapResult` 请求头。 + +这样可以确保HTTP客户端的请求结果与服务器端的包装配置保持一致。 + +## 源码位置 + +[LINGYUN.Abp.Http.Client.Wrapper](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.IP2Region/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.IP2Region/README.EN.md new file mode 100644 index 000000000..ad65a6fc7 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.IP2Region/README.EN.md @@ -0,0 +1,106 @@ +# LINGYUN.Abp.IP2Region + +## Introduction + +`LINGYUN.Abp.IP2Region` is an ABP framework module based on IP2Region, providing IP address query functionality. This module integrates the IP2Region.Net library and provides convenient IP address query services. + +## Features + +* Provides IP address query service +* Supports multiple caching strategies +* Built-in IP database file +* Supports ABP virtual file system + +## Installation + +```bash +dotnet add package LINGYUN.Abp.IP2Region +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpIP2RegionModule))]` to your module class. + +```csharp +[DependsOn(typeof(AbpIP2RegionModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Inject and use the IP query service: + +```csharp +public class YourService +{ + private readonly ISearcher _searcher; + + public YourService(ISearcher searcher) + { + _searcher = searcher; + } + + public async Task SearchIpInfo(string ip) + { + return await _searcher.SearchAsync(ip); + } +} +``` + +## IP2Region.Net Library Description + +### Installation + +Install the package with [NuGet](https://www.nuget.org/packages/IP2Region.Net) + +```bash +Install-Package IP2Region.Net +``` + +### Usage + +```csharp +using IP2Region.Net.Abstractions; +using IP2Region.Net.XDB; + +ISearcher searcher = new Searcher(CachePolicy , "your xdb file path"); +``` + +### Cache Policy Description +| Cache Policy | Description | Thread Safe | +|-------------------------|------------------------------------------------------------------------------------------------------------|-------------| +| CachePolicy.Content | Cache the entire `xdb` data. | Yes | +| CachePolicy.VectorIndex | Cache `vecotorIndex` to speed up queries and reduce system io pressure by reducing one fixed IO operation. | Yes | +| CachePolicy.File | Completely file-based queries | Yes | + +### XDB File Description +Generate using [maker](https://github.com/lionsoul2014/ip2region/tree/master/maker/csharp), or [download](https://github.com/lionsoul2014/ip2region/blob/master/data/ip2region.xdb) pre-generated xdb files + +## Performance + +``` ini +BenchmarkDotNet=v0.13.2, OS=macOS 13.4.1 (c) (22F770820d) [Darwin 22.5.0] +Apple M1, 1 CPU, 8 logical and 8 physical cores +.NET SDK=7.0.306 + [Host] : .NET 6.0.20 (6.0.2023.32017), Arm64 RyuJIT AdvSIMD + DefaultJob : .NET 6.0.20 (6.0.2023.32017), Arm64 RyuJIT AdvSIMD +``` + +| Method | Mean | Error | StdDev | +|-------------------------|-----------:|---------:|---------:| +| CachePolicy_Content | 155.7 ns | 0.46 ns | 0.39 ns | +| CachePolicy_File | 2,186.8 ns | 34.27 ns | 32.06 ns | +| CachePolicy_VectorIndex | 1,570.3 ns | 27.53 ns | 22.99 ns | + +## Contributing +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. + +Please make sure to update tests as appropriate. + +## License +[Apache License 2.0](https://github.com/lionsoul2014/ip2region/blob/master/LICENSE.md) + +## Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.IP2Region/README.md b/aspnet-core/framework/common/LINGYUN.Abp.IP2Region/README.md index 8f8c78c98..da3373d90 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.IP2Region/README.md +++ b/aspnet-core/framework/common/LINGYUN.Abp.IP2Region/README.md @@ -1,8 +1,56 @@ -# IP2Region.Net +# LINGYUN.Abp.IP2Region -.NET client library for IP2Region +## 介绍 -## Installation +`LINGYUN.Abp.IP2Region` 是一个基于IP2Region的ABP框架模块,提供IP地址查询功能。本模块集成了IP2Region.Net库,提供了便捷的IP地址查询服务。 + +## 功能 + +* 提供IP地址查询服务 +* 支持多种缓存策略 +* 内置IP数据库文件 +* 支持ABP虚拟文件系统 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.IP2Region +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpIP2RegionModule))]` 到你的模块类上。 + +```csharp +[DependsOn(typeof(AbpIP2RegionModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 注入并使用IP查询服务: + +```csharp +public class YourService +{ + private readonly ISearcher _searcher; + + public YourService(ISearcher searcher) + { + _searcher = searcher; + } + + public async Task SearchIpInfo(string ip) + { + return await _searcher.SearchAsync(ip); + } +} +``` + +## IP2Region.Net 库说明 + +### Installation Install the package with [NuGet](https://www.nuget.org/packages/IP2Region.Net) @@ -10,7 +58,7 @@ Install the package with [NuGet](https://www.nuget.org/packages/IP2Region.Net) Install-Package IP2Region.Net ``` -## Usage +### Usage ```csharp using IP2Region.Net.Abstractions; @@ -18,6 +66,7 @@ using IP2Region.Net.XDB; ISearcher searcher = new Searcher(CachePolicy , "your xdb file path"); ``` + ### Cache Policy Description | Cache Policy | Description | Thread Safe | |-------------------------|------------------------------------------------------------------------------------------------------------|-------------| @@ -51,12 +100,14 @@ Apple M1, 1 CPU, 8 logical and 8 physical cores | CachePolicy_File | 2,186.8 ns | 34.27 ns | 32.06 ns | | CachePolicy_VectorIndex | 1,570.3 ns | 27.53 ns | 22.99 ns | - - ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. ## License -[Apache License 2.0](https://github.com/lionsoul2014/ip2region/blob/master/LICENSE.md) \ No newline at end of file +[Apache License 2.0](https://github.com/lionsoul2014/ip2region/blob/master/LICENSE.md) + +## 链接 + +* [English document](./README.EN.md) \ No newline at end of file diff --git a/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/README.EN.md new file mode 100644 index 000000000..2f128734c --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/README.EN.md @@ -0,0 +1,73 @@ +# LINGYUN.Abp.IdGenerator + +## Introduction + +`LINGYUN.Abp.IdGenerator` is a distributed ID generator module that implements the Snowflake algorithm to generate distributed unique IDs. + +## Features + +* Snowflake Algorithm ID Generator (`SnowflakeIdGenerator`) + * Support for custom worker ID and datacenter ID + * Support for custom sequence bits + * Support for time rollback handling + * Provides unique ID generation in distributed environments + +## Configuration + +### SnowflakeIdOptions + +* `WorkerIdBits` (default: 5) - Number of bits for worker ID +* `DatacenterIdBits` (default: 5) - Number of bits for datacenter ID +* `Sequence` (default: 0) - Initial value for sequence +* `SequenceBits` (default: 12) - Number of bits for sequence +* `UsePreviousInTimeRollback` (default: true) - Whether to use previous timestamp when time rolls back +* `WorkerId` - Worker ID, if not specified, gets from environment variable WORKERID or generates randomly +* `DatacenterId` - Datacenter ID, if not specified, gets from environment variable DATACENTERID or generates randomly + +## Installation + +```bash +dotnet add package LINGYUN.Abp.IdGenerator +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpIdGeneratorModule))]` to your module class. + +```csharp +[DependsOn(typeof(AbpIdGeneratorModule))] +public class YourModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.WorkerId = 1; + options.DatacenterId = 1; + }); + } +} +``` + +2. Inject and use the ID generator: + +```csharp +public class YourService +{ + private readonly IDistributedIdGenerator _idGenerator; + + public YourService(IDistributedIdGenerator idGenerator) + { + _idGenerator = idGenerator; + } + + public long CreateId() + { + return _idGenerator.Create(); + } +} +``` + +## Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/README.md b/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/README.md new file mode 100644 index 000000000..20f8d2e76 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/README.md @@ -0,0 +1,73 @@ +# LINGYUN.Abp.IdGenerator + +## 介绍 + +`LINGYUN.Abp.IdGenerator` 是一个分布式ID生成器模块,主要实现了雪花算法(Snowflake)来生成分布式唯一ID。 + +## 功能 + +* 雪花算法ID生成器 (`SnowflakeIdGenerator`) + * 支持自定义工作机器ID和数据中心ID + * 支持自定义序列号位数 + * 支持时间回退处理 + * 提供分布式环境下的唯一ID生成 + +## 配置项 + +### SnowflakeIdOptions + +* `WorkerIdBits` (默认: 5) - 工作机器ID位数 +* `DatacenterIdBits` (默认: 5) - 数据中心ID位数 +* `Sequence` (默认: 0) - 序列号起始值 +* `SequenceBits` (默认: 12) - 序列号位数 +* `UsePreviousInTimeRollback` (默认: true) - 是否在时间回退时使用上一个时间戳 +* `WorkerId` - 工作机器ID,如未指定则从环境变量WORKERID获取或随机生成 +* `DatacenterId` - 数据中心ID,如未指定则从环境变量DATACENTERID获取或随机生成 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.IdGenerator +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpIdGeneratorModule))]` 到你的模块类上。 + +```csharp +[DependsOn(typeof(AbpIdGeneratorModule))] +public class YourModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.WorkerId = 1; + options.DatacenterId = 1; + }); + } +} +``` + +2. 注入并使用ID生成器: + +```csharp +public class YourService +{ + private readonly IDistributedIdGenerator _idGenerator; + + public YourService(IDistributedIdGenerator idGenerator) + { + _idGenerator = idGenerator; + } + + public long CreateId() + { + return _idGenerator.Create(); + } +} +``` + +## 链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/README.EN.md new file mode 100644 index 000000000..cfee94d1a --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/README.EN.md @@ -0,0 +1,98 @@ +# LINGYUN.Abp.Idempotent + +Interface idempotency check module for preventing duplicate submissions and ensuring interface call idempotency. + +## Features + +* Automatic idempotency checking +* Support for custom idempotent key generation +* Flexible timeout configuration +* Distributed lock support +* Multi-language error messages +* Support for ignoring specific interfaces or methods + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Idempotent +``` + +## Configuration + +```csharp +[DependsOn(typeof(AbpIdempotentModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Enable idempotency check globally + options.IsEnabled = true; + // Default 5-second timeout for each interface + options.DefaultTimeout = 5000; + // Idempotent token name, passed through HttpHeader + options.IdempotentTokenName = "X-With-Idempotent-Token"; + // HTTP status code when idempotency check fails + options.HttpStatusCode = 429; + }); + } +} +``` + +## Configuration Options + +* `IsEnabled` - Whether to enable idempotency checking, default: false +* `DefaultTimeout` - Default idempotency check timeout (milliseconds), default: 5000 +* `IdempotentTokenName` - HTTP header name for idempotency token, default: X-With-Idempotent-Token +* `HttpStatusCode` - HTTP status code when idempotency check fails, default: 429 (Too Many Requests) + +## Usage Examples + +### 1. Basic Usage + +```csharp +[Idempotent] +public class OrderAppService : ApplicationService +{ + public async Task CreateAsync(CreateOrderDto input) + { + // Method will automatically perform idempotency check + return await _orderRepository.CreateAsync(input); + } +} +``` + +### 2. Custom Idempotent Key + +```csharp +[Idempotent( + iodempotentKey: "custom-key", + timeout: 10000, + keyMap: new[] { "orderId", "userId" })] +public async Task UpdateAsync(UpdateOrderDto input) +{ + return await _orderRepository.UpdateAsync(input); +} +``` + +### 3. Ignore Idempotency Check + +```csharp +[IgnoreIdempotent] +public async Task QueryAsync(string orderId) +{ + return await _orderRepository.GetAsync(orderId); +} +``` + +## Important Notes + +1. By default, idempotency checking is enabled for all services inheriting from `ICreateAppService`, `IUpdateAppService`, and `IDeleteAppService` +2. You can use the `[IgnoreIdempotent]` attribute to ignore idempotency checking for specific methods +3. Idempotency checking is implemented based on distributed locks to ensure correctness in distributed environments +4. It is recommended to enable idempotency checking on all interfaces that modify data + +## Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/README.md index 94bf862d4..1646fba3f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/README.md +++ b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/README.md @@ -1,6 +1,21 @@ # LINGYUN.Abp.Idempotent -接口幂等性检查模块 +接口幂等性检查模块,用于防止接口重复提交和确保接口调用的幂等性。 + +## 功能 + +* 自动幂等性检查 +* 支持自定义幂等键生成 +* 灵活的超时配置 +* 支持分布式锁 +* 支持多语言错误消息 +* 支持忽略特定接口或方法 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Idempotent +``` ## 配置使用 @@ -8,23 +23,76 @@ [DependsOn(typeof(AbpIdempotentModule))] public class YouProjectModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - // 全局启用幂等检查 - options.IsEnabled = true; - // 默认每个接口提供5秒超时 - options.DefaultTimeout = 5000; - // 幂等token名称, 通过HttpHeader传递 - options.IdempotentTokenName = "X-With-Idempotent-Token"; - // 幂等校验失败时Http响应代码 - options.HttpStatusCode = 429; + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // 全局启用幂等检查 + options.IsEnabled = true; + // 默认每个接口提供5秒超时 + options.DefaultTimeout = 5000; + // 幂等token名称, 通过HttpHeader传递 + options.IdempotentTokenName = "X-With-Idempotent-Token"; + // 幂等校验失败时Http响应代码 + options.HttpStatusCode = 429; }); - } + } } ``` + ## 配置项说明 -## 其他 +* `IsEnabled` - 是否启用幂等检查,默认:false +* `DefaultTimeout` - 默认幂等性检查超时时间(毫秒),默认:5000 +* `IdempotentTokenName` - 幂等性Token的HTTP头名称,默认:X-With-Idempotent-Token +* `HttpStatusCode` - 幂等性检查失败时的HTTP状态码,默认:429 (Too Many Requests) + +## 使用示例 + +### 1. 基本使用 + +```csharp +[Idempotent] +public class OrderAppService : ApplicationService +{ + public async Task CreateAsync(CreateOrderDto input) + { + // 方法会自动进行幂等性检查 + return await _orderRepository.CreateAsync(input); + } +} +``` + +### 2. 自定义幂等键 + +```csharp +[Idempotent( + iodempotentKey: "custom-key", + timeout: 10000, + keyMap: new[] { "orderId", "userId" })] +public async Task UpdateAsync(UpdateOrderDto input) +{ + return await _orderRepository.UpdateAsync(input); +} +``` + +### 3. 忽略幂等性检查 + +```csharp +[IgnoreIdempotent] +public async Task QueryAsync(string orderId) +{ + return await _orderRepository.GetAsync(orderId); +} +``` + +## 注意事项 + +1. 默认对所有继承自 `ICreateAppService`、`IUpdateAppService` 和 `IDeleteAppService` 的服务启用幂等性检查 +2. 可以通过 `[IgnoreIdempotent]` 特性来忽略特定方法的幂等性检查 +3. 幂等性检查基于分布式锁实现,确保在分布式环境中的正确性 +4. 建议在所有修改数据的接口上启用幂等性检查 + +## 链接 +* [English document](./README.EN.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/README.EN.md new file mode 100644 index 000000000..2e59e5e26 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/README.EN.md @@ -0,0 +1,137 @@ +# LINGYUN.Abp.Location.Baidu + +## Introduction + +`LINGYUN.Abp.Location.Baidu` is a location service implementation module based on Baidu Maps API, providing functionalities such as geocoding, reverse geocoding, IP location, and more. + +## Features + +* Geocoding: Convert structured addresses into latitude and longitude coordinates +* Reverse Geocoding: Convert coordinates into structured addresses +* IP Location: Get location information based on IP addresses +* POI (Points of Interest) Information: Get information about nearby businesses, restaurants, and other points of interest +* Road Information: Get information about nearby roads +* Administrative Region Information: Get detailed administrative region hierarchy information + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Location.Baidu +``` + +## Configuration + +1. Add module dependency: + +```csharp +[DependsOn(typeof(AbpBaiduLocationModule))] +public class YourModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Set Baidu Maps API key + options.AccessKey = "your-baidu-map-ak"; + // Optional: Set security key (for sn verification) + options.SecurityKey = "your-baidu-map-sk"; + // Optional: Set coordinate system type (default is bd09ll) + options.CoordType = "bd09ll"; + // Optional: Set output format (default is json) + options.Output = "json"; + }); + } +} +``` + +## Usage + +1. Inject and use the location resolution service: + +```csharp +public class YourLocationService +{ + private readonly ILocationResolveProvider _locationProvider; + + public YourLocationService(ILocationResolveProvider locationProvider) + { + _locationProvider = locationProvider; + } + + // Geocoding: Convert address to coordinates + public async Task GeocodeAsync(string address) + { + // city parameter is optional, used to specify the city of the address + return await _locationProvider.GeocodeAsync(address, "Beijing"); + } + + // Reverse Geocoding: Convert coordinates to address + public async Task ReGeocodeAsync(double lat, double lng) + { + // radius parameter is optional, specifies search radius (in meters) + return await _locationProvider.ReGeocodeAsync(lat, lng, 1000); + } + + // IP Geolocation + public async Task IPGeocodeAsync(string ipAddress) + { + return await _locationProvider.IPGeocodeAsync(ipAddress); + } +} +``` + +## Response Data Description + +### Geocoding Response Data + +```json +{ + "location": { + "lat": 39.915119, // Latitude value + "lng": 116.403963 // Longitude value + }, + "precise": 1, // Additional location info, precise match or not (1 for precise, 0 for not precise) + "confidence": 80, // Confidence level + "comprehension": 100, // Address understanding level + "level": "门址" // Address type +} +``` + +### Reverse Geocoding Response Data + +```json +{ + "location": { + "lat": 39.915119, // Latitude value + "lng": 116.403963 // Longitude value + }, + "formatted_address": "Dongchangan Street, Dongcheng District, Beijing", // Structured address + "business": "Tiananmen", // Business area information + "addressComponent": { + "country": "China", // Country + "province": "Beijing", // Province + "city": "Beijing", // City + "district": "Dongcheng District", // District + "street": "Dongchangan Street", // Street + "street_number": "1" // Street number + }, + "pois": [ // Nearby POIs + { + "name": "Tiananmen", // POI name + "type": "Tourist Attraction", // POI type + "distance": "100" // Distance (meters) + } + ], + "roads": [ // Nearby roads + { + "name": "Dongchangan Street", // Road name + "distance": "50" // Distance (meters) + } + ] +} +``` + +## More Information + +* [中文文档](./README.md) +* [Baidu Maps Open Platform](https://lbsyun.baidu.com/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/README.md new file mode 100644 index 000000000..0fcc51411 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/README.md @@ -0,0 +1,137 @@ +# LINGYUN.Abp.Location.Baidu + +## 介绍 + +`LINGYUN.Abp.Location.Baidu` 是基于百度地图API的位置服务实现模块,提供了地理编码、反向地理编码、IP定位等功能。 + +## 功能特性 + +* 地理编码:将详细的结构化地址转换为对应的经纬度坐标 +* 反向地理编码:将经纬度坐标转换为对应的结构化地址 +* IP定位:根据IP地址获取位置信息 +* POI(兴趣点)信息:获取周边的商铺、餐厅等兴趣点信息 +* 道路信息:获取附近的道路信息 +* 行政区划信息:获取详细的行政区划层级信息 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Location.Baidu +``` + +## 配置 + +1. 添加模块依赖: + +```csharp +[DependsOn(typeof(AbpBaiduLocationModule))] +public class YourModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // 设置百度地图API密钥 + options.AccessKey = "your-baidu-map-ak"; + // 可选:设置安全密钥(sn校验) + options.SecurityKey = "your-baidu-map-sk"; + // 可选:设置坐标系类型(默认为bd09ll) + options.CoordType = "bd09ll"; + // 可选:设置输出格式(默认为json) + options.Output = "json"; + }); + } +} +``` + +## 使用方法 + +1. 注入并使用位置解析服务: + +```csharp +public class YourLocationService +{ + private readonly ILocationResolveProvider _locationProvider; + + public YourLocationService(ILocationResolveProvider locationProvider) + { + _locationProvider = locationProvider; + } + + // 地理编码:地址转坐标 + public async Task GeocodeAsync(string address) + { + // city参数可选,用于指定地址所在城市 + return await _locationProvider.GeocodeAsync(address, "北京市"); + } + + // 反向地理编码:坐标转地址 + public async Task ReGeocodeAsync(double lat, double lng) + { + // radius参数可选,指定搜索半径(米) + return await _locationProvider.ReGeocodeAsync(lat, lng, 1000); + } + + // IP地理位置解析 + public async Task IPGeocodeAsync(string ipAddress) + { + return await _locationProvider.IPGeocodeAsync(ipAddress); + } +} +``` + +## 返回数据说明 + +### 地理编码返回数据 + +```json +{ + "location": { + "lat": 39.915119, // 纬度值 + "lng": 116.403963 // 经度值 + }, + "precise": 1, // 位置的附加信息,是否精确查找(1为精确,0为不精确) + "confidence": 80, // 可信度 + "comprehension": 100, // 地址理解程度 + "level": "门址" // 地址类型 +} +``` + +### 反向地理编码返回数据 + +```json +{ + "location": { + "lat": 39.915119, // 纬度值 + "lng": 116.403963 // 经度值 + }, + "formatted_address": "北京市东城区东长安街", // 结构化地址信息 + "business": "天安门", // 商圈信息 + "addressComponent": { + "country": "中国", // 国家 + "province": "北京市", // 省份 + "city": "北京市", // 城市 + "district": "东城区", // 区县 + "street": "东长安街", // 街道 + "street_number": "1号" // 门牌号 + }, + "pois": [ // 周边POI信息 + { + "name": "天安门", // POI名称 + "type": "旅游景点", // POI类型 + "distance": "100" // 距离(米) + } + ], + "roads": [ // 周边道路信息 + { + "name": "东长安街", // 道路名称 + "distance": "50" // 距离(米) + } + ] +} +``` + +## 更多信息 + +* [English Documentation](./README.EN.md) +* [百度地图开放平台](https://lbsyun.baidu.com/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/README.EN.md new file mode 100644 index 000000000..d05ee909e --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/README.EN.md @@ -0,0 +1,144 @@ +# LINGYUN.Abp.Location.Tencent + +## Introduction + +`LINGYUN.Abp.Location.Tencent` is a location service implementation module based on Tencent Maps API, providing functionalities such as geocoding, reverse geocoding, IP location, and more. + +## Features + +* Geocoding: Convert structured addresses into latitude and longitude coordinates +* Reverse Geocoding: Convert coordinates into structured addresses +* IP Location: Get location information based on IP addresses +* POI (Points of Interest) Information: Get information about nearby businesses, restaurants, and other points of interest +* Administrative Region Information: Get detailed administrative region hierarchy information +* Address Parsing: Intelligent address parsing supporting multiple formats + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Location.Tencent +``` + +## Configuration + +1. Add module dependency: + +```csharp +[DependsOn(typeof(AbpTencentLocationModule))] +public class YourModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Set Tencent Maps API key + options.Key = "your-tencent-map-key"; + // Optional: Set security key (for SK verification) + options.SecretKey = "your-tencent-map-sk"; + }); + } +} +``` + +## Usage + +1. Inject and use the location resolution service: + +```csharp +public class YourLocationService +{ + private readonly ILocationResolveProvider _locationProvider; + + public YourLocationService(ILocationResolveProvider locationProvider) + { + _locationProvider = locationProvider; + } + + // Geocoding: Convert address to coordinates + public async Task GeocodeAsync(string address) + { + // city parameter is optional, used to specify the city of the address + return await _locationProvider.GeocodeAsync(address, "Beijing"); + } + + // Reverse Geocoding: Convert coordinates to address + public async Task ReGeocodeAsync(double lat, double lng) + { + // radius parameter is optional, specifies search radius (in meters) + return await _locationProvider.ReGeocodeAsync(lat, lng, 1000); + } + + // IP Geolocation + public async Task IPGeocodeAsync(string ipAddress) + { + return await _locationProvider.IPGeocodeAsync(ipAddress); + } +} +``` + +## Response Data Description + +### Geocoding Response Data + +```json +{ + "location": { + "lat": 39.915119, // Latitude value + "lng": 116.403963 // Longitude value + }, + "title": "Tiananmen", // Place name + "address": "Dongchangan Street, Dongcheng District, Beijing", // Address + "category": "Tourist Attraction", // Category + "adcode": "110101", // Administrative region code + "similarity": 0.8, // Similarity (0-1) + "reliability": 7, // Reliability (1-10) + "level": 11 // Address type +} +``` + +### Reverse Geocoding Response Data + +```json +{ + "location": { + "lat": 39.915119, // Latitude value + "lng": 116.403963 // Longitude value + }, + "address": "Dongchangan Street, Dongcheng District, Beijing", // Complete address + "formatted_addresses": { + "recommend": "Tiananmen, Dongcheng District", // Recommended address + "rough": "Dongcheng District, Beijing" // Rough address + }, + "address_component": { + "nation": "China", // Country + "province": "Beijing", // Province + "city": "Beijing", // City + "district": "Dongcheng District", // District + "street": "Dongchangan Street", // Street + "street_number": "1" // Street number + }, + "pois": [ // Nearby POIs + { + "title": "Tiananmen", // POI name + "address": "Dongchangan Street, Dongcheng District, Beijing", // POI address + "category": "Tourist Attraction", // POI type + "distance": 100, // Distance (meters) + "_distance": 100.0, // Distance (meters, float) + "tel": "", // Phone number + "ad_info": { // Administrative region info + "adcode": "110101", // Administrative region code + "name": "Dongcheng District", // Administrative region name + "location": { // Administrative region center point + "lat": 39.915119, + "lng": 116.403963 + } + } + } + ] +} +``` + +## More Information + +* [中文文档](./README.md) +* [Tencent Location Service](https://lbs.qq.com/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/README.md new file mode 100644 index 000000000..384e1b4cd --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/README.md @@ -0,0 +1,144 @@ +# LINGYUN.Abp.Location.Tencent + +## 介绍 + +`LINGYUN.Abp.Location.Tencent` 是基于腾讯地图API的位置服务实现模块,提供了地理编码、反向地理编码、IP定位等功能。 + +## 功能特性 + +* 地理编码:将详细的结构化地址转换为对应的经纬度坐标 +* 反向地理编码:将经纬度坐标转换为对应的结构化地址 +* IP定位:根据IP地址获取位置信息 +* POI(兴趣点)信息:获取周边的商铺、餐厅等兴趣点信息 +* 行政区划信息:获取详细的行政区划层级信息 +* 地址解析:智能解析地址信息,支持多种格式 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Location.Tencent +``` + +## 配置 + +1. 添加模块依赖: + +```csharp +[DependsOn(typeof(AbpTencentLocationModule))] +public class YourModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // 设置腾讯地图API密钥 + options.Key = "your-tencent-map-key"; + // 可选:设置安全密钥(SK校验) + options.SecretKey = "your-tencent-map-sk"; + }); + } +} +``` + +## 使用方法 + +1. 注入并使用位置解析服务: + +```csharp +public class YourLocationService +{ + private readonly ILocationResolveProvider _locationProvider; + + public YourLocationService(ILocationResolveProvider locationProvider) + { + _locationProvider = locationProvider; + } + + // 地理编码:地址转坐标 + public async Task GeocodeAsync(string address) + { + // city参数可选,用于指定地址所在城市 + return await _locationProvider.GeocodeAsync(address, "北京市"); + } + + // 反向地理编码:坐标转地址 + public async Task ReGeocodeAsync(double lat, double lng) + { + // radius参数可选,指定搜索半径(米) + return await _locationProvider.ReGeocodeAsync(lat, lng, 1000); + } + + // IP地理位置解析 + public async Task IPGeocodeAsync(string ipAddress) + { + return await _locationProvider.IPGeocodeAsync(ipAddress); + } +} +``` + +## 返回数据说明 + +### 地理编码返回数据 + +```json +{ + "location": { + "lat": 39.915119, // 纬度值 + "lng": 116.403963 // 经度值 + }, + "title": "天安门", // 地点名称 + "address": "北京市东城区东长安街", // 地址 + "category": "旅游景点", // 类别 + "adcode": "110101", // 行政区划代码 + "similarity": 0.8, // 相似度(0-1) + "reliability": 7, // 可信度(1-10) + "level": 11 // 地址类型 +} +``` + +### 反向地理编码返回数据 + +```json +{ + "location": { + "lat": 39.915119, // 纬度值 + "lng": 116.403963 // 经度值 + }, + "address": "北京市东城区东长安街", // 完整地址 + "formatted_addresses": { + "recommend": "东城区天安门", // 推荐地址 + "rough": "北京市东城区" // 粗略地址 + }, + "address_component": { + "nation": "中国", // 国家 + "province": "北京市", // 省份 + "city": "北京市", // 城市 + "district": "东城区", // 区县 + "street": "东长安街", // 街道 + "street_number": "1号" // 门牌号 + }, + "pois": [ // 周边POI信息 + { + "title": "天安门", // POI名称 + "address": "北京市东城区东长安街", // POI地址 + "category": "旅游景点", // POI类型 + "distance": 100, // 距离(米) + "_distance": 100.0, // 距离(米,浮点数) + "tel": "", // 电话 + "ad_info": { // 行政区划信息 + "adcode": "110101", // 行政区划代码 + "name": "东城区", // 行政区划名称 + "location": { // 行政区划中心点 + "lat": 39.915119, + "lng": 116.403963 + } + } + } + ] +} +``` + +## 更多信息 + +* [English Documentation](./README.EN.md) +* [腾讯位置服务](https://lbs.qq.com/) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Location/README.EN.md new file mode 100644 index 000000000..56fd2eee6 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/README.EN.md @@ -0,0 +1,151 @@ +# LINGYUN.Abp.Location + +## Introduction + +`LINGYUN.Abp.Location` is a location service foundation module that provides geographic location-related functionality, including geocoding (forward/reverse), distance calculation, and more. + +## Features + +* Geocoding and Reverse Geocoding +* IP Geolocation Resolution +* Location distance calculation (based on Google algorithm, error <0.2m) +* Location offset calculation +* Support for POI (Points of Interest) and road information +* Extensible location resolution providers + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Location +``` + +## Usage + +1. Add module dependency: + +```csharp +[DependsOn(typeof(AbpLocationModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Inject and use the location resolution service: + +```csharp +public class YourLocationService +{ + private readonly ILocationResolveProvider _locationProvider; + + public YourLocationService(ILocationResolveProvider locationProvider) + { + _locationProvider = locationProvider; + } + + // Geocoding: Convert address to coordinates + public async Task GeocodeAsync(string address) + { + return await _locationProvider.GeocodeAsync(address); + } + + // Reverse Geocoding: Convert coordinates to address + public async Task ReGeocodeAsync(double lat, double lng) + { + return await _locationProvider.ReGeocodeAsync(lat, lng); + } + + // IP Geolocation Resolution + public async Task IPGeocodeAsync(string ipAddress) + { + return await _locationProvider.IPGeocodeAsync(ipAddress); + } +} +``` + +## Advanced Usage + +### 1. Distance Calculation + +```csharp +// Create location objects +var location1 = new Location { Latitude = 39.9042, Longitude = 116.4074 }; // Beijing +var location2 = new Location { Latitude = 31.2304, Longitude = 121.4737 }; // Shanghai + +// Calculate distance between two points (in meters) +double distance = location1.CalcDistance(location2); + +// Calculate location offset +var offset = location1.CalcOffset(1000, 45); // Offset 1000 meters to the northeast +``` + +### 2. Calculate Location Offset Range + +```csharp +var location = new Location { Latitude = 39.9042, Longitude = 116.4074 }; +// Calculate offset range for specified distance (meters) +var position = Location.CalcOffsetDistance(location, 1000); // 1km range +``` + +### 3. Custom Location Resolution Provider + +```csharp +public class CustomLocationProvider : ILocationResolveProvider +{ + public async Task IPGeocodeAsync(string ipAddress) + { + // Implement IP geolocation resolution + } + + public async Task GeocodeAsync(string address, string city = null) + { + // Implement geocoding + } + + public async Task ReGeocodeAsync(double lat, double lng, int radius = 50) + { + // Implement reverse geocoding + } +} +``` + +## Custom Location Resolution Provider Implementation + +To implement a custom location resolution provider: + +1. Implement the `ILocationResolveProvider` interface: + +```csharp +public class CustomLocationProvider : ILocationResolveProvider +{ + public async Task IPGeocodeAsync(string ipAddress) + { + // Implement IP geolocation resolution + } + + public async Task GeocodeAsync(string address, string city = null) + { + // Implement geocoding + } + + public async Task ReGeocodeAsync(double lat, double lng, int radius = 50) + { + // Implement reverse geocoding + } +} +``` + +2. Register your implementation in your module: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddTransient(); +} +``` + +## Links + +* [中文文档](./README.md) +* [Baidu Maps Location Service](./LINGYUN.Abp.Location.Baidu/README.EN.md) +* [Tencent Maps Location Service](./LINGYUN.Abp.Location.Tencent/README.EN.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Location/README.md new file mode 100644 index 000000000..d5b587ee1 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/README.md @@ -0,0 +1,121 @@ +# LINGYUN.Abp.Location + +## 介绍 + +`LINGYUN.Abp.Location` 是一个位置服务基础模块,提供了地理位置相关的功能,包括地理编码(正向/反向)、距离计算等功能。 + +## 功能特性 + +* 地理编码(Geocoding)和反向地理编码(Reverse Geocoding) +* IP地理位置解析 +* 位置距离计算(基于Google算法,误差<0.2米) +* 位置偏移量计算 +* 支持POI(兴趣点)和道路信息 +* 可扩展的位置解析提供程序 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Location +``` + +## 使用方法 + +1. 添加模块依赖: + +```csharp +[DependsOn(typeof(AbpLocationModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 注入并使用位置解析服务: + +```csharp +public class YourLocationService +{ + private readonly ILocationResolveProvider _locationProvider; + + public YourLocationService(ILocationResolveProvider locationProvider) + { + _locationProvider = locationProvider; + } + + // 地理编码:地址转坐标 + public async Task GeocodeAsync(string address) + { + return await _locationProvider.GeocodeAsync(address); + } + + // 反向地理编码:坐标转地址 + public async Task ReGeocodeAsync(double lat, double lng) + { + return await _locationProvider.ReGeocodeAsync(lat, lng); + } + + // IP地理位置解析 + public async Task IPGeocodeAsync(string ipAddress) + { + return await _locationProvider.IPGeocodeAsync(ipAddress); + } +} +``` + +## 位置计算 + +模块提供了强大的位置计算功能: + +```csharp +// 创建位置对象 +var location1 = new Location { Latitude = 39.9042, Longitude = 116.4074 }; // 北京 +var location2 = new Location { Latitude = 31.2304, Longitude = 121.4737 }; // 上海 + +// 计算两点之间的距离(米) +double distance = location1.CalcDistance(location2); + +// 计算位置的偏移 +var offset = location1.CalcOffset(1000, 45); // 向东北方向偏移1000米 +``` + +## 自定义位置解析提供程序 + +要实现自定义的位置解析提供程序,需要: + +1. 实现 `ILocationResolveProvider` 接口: + +```csharp +public class CustomLocationProvider : ILocationResolveProvider +{ + public async Task IPGeocodeAsync(string ipAddress) + { + // 实现IP地理位置解析 + } + + public async Task GeocodeAsync(string address, string city = null) + { + // 实现地理编码 + } + + public async Task ReGeocodeAsync(double lat, double lng, int radius = 50) + { + // 实现反向地理编码 + } +} +``` + +2. 在模块中注册你的实现: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddTransient(); +} +``` + +## 更多信息 + +* [English Documentation](./README.EN.md) +* [百度地图定位服务](./LINGYUN.Abp.Location.Baidu/README.md) +* [腾讯地图定位服务](./LINGYUN.Abp.Location.Tencent/README.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/README.EN.md new file mode 100644 index 000000000..239c25779 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/README.EN.md @@ -0,0 +1,95 @@ +# LINGYUN.Abp.RealTime + +## Introduction + +`LINGYUN.Abp.RealTime` is a real-time communication foundation module that provides infrastructure for real-time message delivery. This module is mainly used for handling real-time notifications, messages, and event delivery. + +## Features + +* Real-time event delivery infrastructure +* Support for localized string handling +* Distributed event integration +* Extensible event handling mechanism + +## Installation + +```bash +dotnet add package LINGYUN.Abp.RealTime +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpRealTimeModule))]` to your module class. + +```csharp +[DependsOn(typeof(AbpRealTimeModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Create real-time event data transfer object: + +```csharp +public class YourRealTimeEto : RealTimeEto +{ + public YourRealTimeEto(YourData data) + : base(data) + { + } +} +``` + +3. Use localized strings: + +```csharp +public class LocalizedMessage +{ + private readonly LocalizableStringInfo _localizableString; + + public LocalizedMessage() + { + _localizableString = new LocalizableStringInfo( + "YourResource", + "MessageKey", + new Dictionary + { + { "param1", "value1" } + }); + } +} +``` + +## Advanced Usage + +### 1. Custom Real-Time Events + +```csharp +[EventName("your-custom-event")] +public class CustomRealTimeEto : RealTimeEto +{ + public CustomRealTimeEto(CustomData data) + : base(data) + { + } +} +``` + +### 2. Real-Time Event Handling + +```csharp +public class YourRealTimeEventHandler : + IDistributedEventHandler, + ITransientDependency +{ + public async Task HandleEventAsync(YourRealTimeEto eventData) + { + // Handle real-time event + } +} +``` + +## Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/README.md b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/README.md new file mode 100644 index 000000000..e4fca3ded --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/README.md @@ -0,0 +1,95 @@ +# LINGYUN.Abp.RealTime + +## 介绍 + +`LINGYUN.Abp.RealTime` 是一个实时通信基础模块,提供了实时消息传递的基础设施。该模块主要用于处理实时通知、消息和事件的传递。 + +## 功能 + +* 实时事件传递基础设施 +* 支持本地化字符串处理 +* 分布式事件集成 +* 可扩展的事件处理机制 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.RealTime +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpRealTimeModule))]` 到你的模块类上。 + +```csharp +[DependsOn(typeof(AbpRealTimeModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 创建实时事件数据传输对象: + +```csharp +public class YourRealTimeEto : RealTimeEto +{ + public YourRealTimeEto(YourData data) + : base(data) + { + } +} +``` + +3. 使用本地化字符串: + +```csharp +public class LocalizedMessage +{ + private readonly LocalizableStringInfo _localizableString; + + public LocalizedMessage() + { + _localizableString = new LocalizableStringInfo( + "YourResource", + "MessageKey", + new Dictionary + { + { "param1", "value1" } + }); + } +} +``` + +## 高级用法 + +### 1. 自定义实时事件 + +```csharp +[EventName("your-custom-event")] +public class CustomRealTimeEto : RealTimeEto +{ + public CustomRealTimeEto(CustomData data) + : base(data) + { + } +} +``` + +### 2. 实时事件处理 + +```csharp +public class YourRealTimeEventHandler : + IDistributedEventHandler, + ITransientDependency +{ + public async Task HandleEventAsync(YourRealTimeEto eventData) + { + // 处理实时事件 + } +} +``` + +## 链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/README.EN.md b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/README.EN.md new file mode 100644 index 000000000..1196d1bf1 --- /dev/null +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/README.EN.md @@ -0,0 +1,105 @@ +# LINGYUN.Abp.Wrapper + +A wrapper module for unifying API response results and exception handling. + +## Features + +* Unified response result wrapping +* Flexible exception handling mechanism +* Support for multiple ignore strategies +* Configurable empty result handling +* Custom exception handlers + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Wrapper +``` + +## Configuration + +```csharp +[DependsOn(typeof(AbpWrapperModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Enable wrapper + options.IsEnabled = true; + + // Custom error code for unhandled exceptions + options.CodeWithUnhandled = "500"; + + // Ignore specific URL prefixes + options.IgnorePrefixUrls.Add("/api/health"); + + // Add custom exception handler + options.AddHandler(new CustomExceptionHandler()); + }); + } +} +``` + +## Configuration Options + +* `AbpWrapperOptions.IsEnabled` - Whether to wrap return results, default: false +* `AbpWrapperOptions.CodeWithUnhandled` - Error code for unhandled exceptions, default: 500 +* `AbpWrapperOptions.CodeWithSuccess` - Success code for successful operations, default: 0 +* `AbpWrapperOptions.ErrorWithEmptyResult` - Whether to return error message when resource is empty, default: false +* `AbpWrapperOptions.HttpStatusCode` - Http response code after wrapping, default: 200 +* `AbpWrapperOptions.CodeWithEmptyResult` - Error code when returning empty object, default: 404 +* `AbpWrapperOptions.MessageWithEmptyResult` - Error message when returning empty object, default: Not Found + +* `AbpWrapperOptions.IgnorePrefixUrls` - Specify which URL prefixes to ignore +* `AbpWrapperOptions.IgnoreNamespaces` - Specify which namespaces to ignore +* `AbpWrapperOptions.IgnoreControllers` - Specify which controllers to ignore +* `AbpWrapperOptions.IgnoreReturnTypes` - Specify which return types to ignore +* `AbpWrapperOptions.IgnoreExceptions` - Specify which exception types to ignore +* `AbpWrapperOptions.IgnoredInterfaces` - Specify which interfaces to ignore (by default, implements **IWrapDisabled** interface will not be processed) + +## Usage Examples + +### 1. Basic Usage + +```csharp +public class TestController : AbpController +{ + public async Task> GetAsync() + { + return new WrapResult("0", "Hello World"); + } +} +``` + +### 2. Ignore Wrapping + +```csharp +[IgnoreWrapResult] +public class HealthController : AbpController +{ + public async Task GetAsync() + { + return "OK"; + } +} +``` + +### 3. Custom Exception Handler + +```csharp +public class CustomExceptionHandler : IExceptionWrapHandler +{ + public void Wrap(ExceptionWrapContext context) + { + context.WithCode("CUSTOM_ERROR") + .WithMessage("Custom exception occurred") + .WithDetails(context.Exception.Message); + } +} +``` + +## Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/README.md b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/README.md index 98c0e2aae..f90816cfd 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/README.md +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/README.md @@ -1,6 +1,20 @@ # LINGYUN.Abp.Wrapper -包装器模块 +包装器模块,用于统一包装API返回结果和异常处理。 + +## 功能 + +* 统一的返回结果包装 +* 灵活的异常处理机制 +* 支持多种忽略策略 +* 可配置的空结果处理 +* 自定义异常处理器 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Wrapper +``` ## 配置使用 @@ -8,16 +22,26 @@ [DependsOn(typeof(AbpWrapperModule))] public class YouProjectModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - // 启用包装器 - options.IsEnabled = true; + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // 启用包装器 + options.IsEnabled = true; + + // 自定义未处理异常的错误代码 + options.CodeWithUnhandled = "500"; + + // 忽略特定前缀的URL + options.IgnorePrefixUrls.Add("/api/health"); + + // 添加自定义异常处理器 + options.AddHandler(new CustomExceptionHandler()); }); - } + } } ``` + ## 配置项说明 * AbpWrapperOptions.IsEnabled 是否包装返回结果,默认: false @@ -36,5 +60,47 @@ public class YouProjectModule : AbpModule * AbpWrapperOptions.IgnoredInterfaces 指定哪些接口不需要处理(默认实现**IWrapDisabled**接口不进行处理) -## 其他 +## 使用示例 + +### 1. 基本使用 + +```csharp +public class TestController : AbpController +{ + public async Task> GetAsync() + { + return new WrapResult("0", "Hello World"); + } +} +``` + +### 2. 忽略包装 + +```csharp +[IgnoreWrapResult] +public class HealthController : AbpController +{ + public async Task GetAsync() + { + return "OK"; + } +} +``` + +### 3. 自定义异常处理 + +```csharp +public class CustomExceptionHandler : IExceptionWrapHandler +{ + public void Wrap(ExceptionWrapContext context) + { + context.WithCode("CUSTOM_ERROR") + .WithMessage("发生自定义异常") + .WithDetails(context.Exception.Message); + } +} +``` + +## 链接 +* [English document](./README.EN.md) diff --git a/aspnet-core/framework/common/README.md b/aspnet-core/framework/common/README.md new file mode 100644 index 000000000..bbb1c7e35 --- /dev/null +++ b/aspnet-core/framework/common/README.md @@ -0,0 +1,59 @@ +# common 模块概述 + +## 模块简介 +`common`模块是ABP框架的基础模块,提供了一系列通用功能和服务,旨在支持各种应用程序的开发和扩展。该模块包含多个子模块,每个子模块实现了特定的功能,帮助开发者快速构建高效的应用程序。 + +## 包含的项目列表 +1. **LINGYUN.Abp.Aliyun.Authorization** + - 提供阿里云基础认证功能,支持AppKeyId和AccessKeySecret的配置。 + +2. **LINGYUN.Abp.AspNetCore.HttpOverrides** + - 实现HTTP传输标头的重写,支持获取反向代理中的真实客户地址。 + +3. **LINGYUN.Abp.AspNetCore.Mvc.Client** + - 提供可配置的用户配置缓存时间,支持多租户接口。 + +4. **LINGYUN.Abp.BackgroundJobs.Hangfire** + - 基于Hangfire实现的后台作业模块,支持即时、延迟和周期性任务。 + +5. **LINGYUN.Abp.ExceptionHandling** + - 提供统一的异常处理和通知机制,支持自定义异常处理程序。 + +6. **LINGYUN.Abp.Location** + - 提供地理编码、反向地理编码和IP地理位置解析功能。 + +7. **LINGYUN.Abp.IdGenerator** + - 实现分布式唯一ID生成器,支持雪花算法。 + +8. **LINGYUN.Abp.Wrapper** + - 统一包装API返回结果和异常处理。 + +## 每个项目的主要功能概述 +- **阿里云认证模块**: 提供阿里云的认证功能,简化了对阿里云服务的访问。 +- **HTTP重写模块**: 处理HTTP请求中的标头,确保获取真实的客户端地址。 +- **MVC客户端模块**: 提供用户配置缓存,支持多租户架构。 +- **后台作业模块**: 支持任务的调度和执行,确保后台任务的可靠性。 +- **异常处理模块**: 处理应用中的异常,提供统一的通知机制。 +- **位置服务模块**: 提供地理位置相关的功能,支持地址与坐标之间的转换。 +- **ID生成模块**: 生成分布式唯一ID,确保在高并发环境下的唯一性。 +- **包装器模块**: 统一处理API的返回结果和异常,提升API的可用性。 + +## 模块的整体用途和重要性 +`common`模块为ABP框架提供了基础设施,支持开发者在构建应用时快速集成常用功能,减少重复工作,提高开发效率。通过这些模块,开发者能够更专注于业务逻辑的实现,而无需担心底层的实现细节。 + +## 如何使用或集成该模块的简要说明 +在项目中使用`common`模块时,只需在模块类中添加相应的依赖项,并在`ConfigureServices`方法中进行必要的配置。例如: + +```csharp +[DependsOn(typeof(LINGYUN.Abp.Aliyun.Authorization))] +public class YourProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // 配置服务 + } +} +``` + +## 提示 +本项目中的README是由AI模型分析代码逻辑后自动生成的,如有误,请提issues或PR。 diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/README.EN.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/README.EN.md new file mode 100644 index 000000000..b144b172a --- /dev/null +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/README.EN.md @@ -0,0 +1,181 @@ +# LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper + +Dapr Actors ASP.NET Core wrapper module for handling Actor method call response wrapping and unwrapping. + +## Features + +* Automatic Actor response result wrapping/unwrapping +* Integration with ABP's wrapper system +* Error handling for Actor method calls +* Support for success/error code configuration +* Integration with Dapr.Actors.AspNetCore +* Support for custom response wrapper format +* Flexible wrapping control options + +## Basic Usage + +Module reference as needed: + +```csharp +[DependsOn( + typeof(AbpDaprActorsAspNetCoreModule), + typeof(AbpWrapperModule) +)] +public class YouProjectModule : AbpModule +{ +} +``` + +## Configuration Options + +The module uses `AbpWrapperOptions` from the `LINGYUN.Abp.Wrapper` package for configuration: + +```json +{ + "Wrapper": { + "IsEnabled": true, // Enable/disable response wrapping + "CodeWithSuccess": "0", // Success code in wrapped response + "HttpStatusCode": 200, // Default HTTP status code for wrapped responses + "WrapOnError": true, // Whether to wrap error responses + "WrapOnSuccess": true // Whether to wrap success responses + } +} +``` + +## Implementation Example + +1. Actor Interface Definition + +```csharp +public interface ICounterActor : IActor +{ + Task GetCountAsync(); + Task IncrementCountAsync(); +} +``` + +2. Actor Implementation + +```csharp +public class CounterActor : Actor, ICounterActor +{ + private const string CountStateName = "count"; + + public CounterActor(ActorHost host) : base(host) + { + } + + public async Task GetCountAsync() + { + var count = await StateManager.TryGetStateAsync(CountStateName); + return count.HasValue ? count.Value : 0; + } + + public async Task IncrementCountAsync() + { + var currentCount = await GetCountAsync(); + await StateManager.SetStateAsync(CountStateName, currentCount + 1); + } +} +``` + +## Response Format + +When wrapping is enabled, Actor method responses will be in the following format: + +```json +{ + "code": "0", // Response code, "0" indicates success by default + "message": "Success", // Response message + "details": null, // Additional details (optional) + "result": { // Actual response data + // ... Actor method return value + } +} +``` + +## Error Handling + +The module automatically handles Actor method call errors: +* For wrapped responses: + * Unwraps the response and checks the code + * If code doesn't match `CodeWithSuccess`, throws `AbpRemoteCallException` + * Includes error message, details, and code in the exception + * Supports custom error code mapping +* For Actor runtime errors: + * Automatically wraps as standard error response + * Preserves original exception information + * Includes Actor-related context information + +### Error Response Example + +```json +{ + "code": "ERROR_001", + "message": "Actor method call failed", + "details": "Failed to access state for actor 'counter'", + "result": null +} +``` + +## Advanced Usage + +### 1. Controlling Response Wrapping + +Response wrapping can be controlled per Actor call using HTTP headers: + +```csharp +// Add to request headers +var headers = new Dictionary +{ + { "X-Abp-Wrap-Result", "true" }, // Force enable wrapping + // or + { "X-Abp-Dont-Wrap-Result", "true" } // Force disable wrapping +}; + +// Use in Actor method +public async Task GetCountAsync() +{ + var context = ActorContext.GetContext(); + context.Headers.Add("X-Abp-Wrap-Result", "true"); + + var count = await StateManager.TryGetStateAsync(CountStateName); + return count.HasValue ? count.Value : 0; +} +``` + +### 2. Custom Error Handling + +```csharp +public class CustomActorErrorHandler : IAbpWrapperErrorHandler +{ + public Task HandleAsync(AbpWrapperErrorContext context) + { + if (context.Exception is ActorMethodInvocationException actorException) + { + // Custom Actor error handling logic + context.Response = new WrapperResponse + { + Code = "ACTOR_ERROR", + Message = actorException.Message, + Details = actorException.ActorId + }; + } + return Task.CompletedTask; + } +} +``` + +## Important Notes + +* Response wrapping can be controlled through: + * Global settings in configuration + * HTTP headers for individual requests + * Dynamic control in Actor methods +* Error responses maintain original error structure for Actor methods +* The module integrates with ABP's remote service error handling system +* Recommended to use response wrapping consistently in microservices architecture +* Wrapper format can be customized by implementing `IAbpWrapperResponseBuilder` +* Actor state operation errors are properly wrapped and handled + +[查看中文](README.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/README.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/README.md new file mode 100644 index 000000000..11b7ba6de --- /dev/null +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/README.md @@ -0,0 +1,181 @@ +# LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper + +Dapr Actors ASP.NET Core响应包装模块,用于处理Actor方法调用的响应包装和解包。 + +## 功能特性 + +* Actor响应结果自动包装/解包 +* 与ABP包装系统集成 +* 支持Actor方法调用的错误处理 +* 支持成功/错误代码配置 +* 与Dapr.Actors.AspNetCore集成 +* 支持自定义响应包装格式 +* 灵活的包装控制选项 + +## 配置使用 + +模块按需引用: + +```csharp +[DependsOn( + typeof(AbpDaprActorsAspNetCoreModule), + typeof(AbpWrapperModule) +)] +public class YouProjectModule : AbpModule +{ +} +``` + +## 配置选项 + +模块使用来自`LINGYUN.Abp.Wrapper`包的`AbpWrapperOptions`进行配置: + +```json +{ + "Wrapper": { + "IsEnabled": true, // 启用/禁用响应包装 + "CodeWithSuccess": "0", // 包装响应中的成功代码 + "HttpStatusCode": 200, // 包装响应的默认HTTP状态码 + "WrapOnError": true, // 是否包装错误响应 + "WrapOnSuccess": true // 是否包装成功响应 + } +} +``` + +## 实现示例 + +1. Actor接口定义 + +```csharp +public interface ICounterActor : IActor +{ + Task GetCountAsync(); + Task IncrementCountAsync(); +} +``` + +2. Actor实现 + +```csharp +public class CounterActor : Actor, ICounterActor +{ + private const string CountStateName = "count"; + + public CounterActor(ActorHost host) : base(host) + { + } + + public async Task GetCountAsync() + { + var count = await StateManager.TryGetStateAsync(CountStateName); + return count.HasValue ? count.Value : 0; + } + + public async Task IncrementCountAsync() + { + var currentCount = await GetCountAsync(); + await StateManager.SetStateAsync(CountStateName, currentCount + 1); + } +} +``` + +## 响应格式 + +当启用包装时,Actor方法的响应将采用以下格式: + +```json +{ + "code": "0", // 响应代码,默认"0"表示成功 + "message": "Success", // 响应消息 + "details": null, // 附加详情(可选) + "result": { // 实际响应数据 + // ... Actor方法的返回值 + } +} +``` + +## 错误处理 + +模块自动处理Actor方法调用的错误: +* 对于包装的响应: + * 解包响应并检查代码 + * 如果代码与`CodeWithSuccess`不匹配,抛出`AbpRemoteCallException` + * 在异常中包含错误消息、详情和代码 + * 支持自定义错误代码映射 +* 对于Actor运行时错误: + * 自动包装为标准错误响应 + * 保留原始异常信息 + * 包含Actor相关的上下文信息 + +### 错误响应示例 + +```json +{ + "code": "ERROR_001", + "message": "Actor方法调用失败", + "details": "Actor 'counter' 的状态访问失败", + "result": null +} +``` + +## 高级用法 + +### 1. 控制响应包装 + +可以通过HTTP头控制单个Actor调用的响应包装: + +```csharp +// 在请求头中添加 +var headers = new Dictionary +{ + { "X-Abp-Wrap-Result", "true" }, // 强制启用包装 + // 或 + { "X-Abp-Dont-Wrap-Result", "true" } // 强制禁用包装 +}; + +// 在Actor方法中使用 +public async Task GetCountAsync() +{ + var context = ActorContext.GetContext(); + context.Headers.Add("X-Abp-Wrap-Result", "true"); + + var count = await StateManager.TryGetStateAsync(CountStateName); + return count.HasValue ? count.Value : 0; +} +``` + +### 2. 自定义错误处理 + +```csharp +public class CustomActorErrorHandler : IAbpWrapperErrorHandler +{ + public Task HandleAsync(AbpWrapperErrorContext context) + { + if (context.Exception is ActorMethodInvocationException actorException) + { + // 自定义Actor错误处理逻辑 + context.Response = new WrapperResponse + { + Code = "ACTOR_ERROR", + Message = actorException.Message, + Details = actorException.ActorId + }; + } + return Task.CompletedTask; + } +} +``` + +## 注意事项 + +* 响应包装可以通过以下方式控制: + * 配置文件中的全局设置 + * HTTP头控制单个请求 + * Actor方法中的动态控制 +* Actor方法的错误响应会保持原始错误结构 +* 模块与ABP的远程服务错误处理系统集成 +* 建议在微服务架构中统一使用响应包装 +* 包装格式可以通过继承`IAbpWrapperResponseBuilder`自定义 +* Actor状态操作的错误会被正确包装和处理 + +[查看英文](README.EN.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/README.EN.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/README.EN.md new file mode 100644 index 000000000..9485b63b9 --- /dev/null +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/README.EN.md @@ -0,0 +1,123 @@ +# LINGYUN.Abp.Dapr.Actors.AspNetCore + +Integration of Dapr.Actors with ASP.NET Core in the ABP framework. This module automatically scans and registers Actor services defined within assemblies as Dapr.Actors. + +## Features + +* Automatic Actor service registration +* Integration with ABP's dependency injection system +* Support for custom Actor type names through `RemoteServiceAttribute` +* Actor runtime configuration through `ActorRuntimeOptions` +* Automatic Actor endpoint mapping +* Actor interface validation + +## Basic Usage + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpDaprActorsAspNetCoreModule))] +public class YourProjectModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // Configure Actor runtime options + PreConfigure(options => + { + options.ActorIdleTimeout = TimeSpan.FromMinutes(60); + options.ActorScanInterval = TimeSpan.FromSeconds(30); + options.DrainOngoingCallTimeout = TimeSpan.FromSeconds(30); + options.DrainRebalancedActors = true; + options.RemindersStoragePartitions = 7; + }); + } +} +``` + +## Implementation Example + +1. Define Actor Interface + +```csharp +[RemoteService("counter")] // Optional: customize Actor type name +public interface ICounterActor : IActor +{ + Task GetCountAsync(); + Task IncrementCountAsync(); +} +``` + +2. Implement Actor + +```csharp +public class CounterActor : Actor, ICounterActor +{ + private const string CountStateName = "count"; + + public CounterActor(ActorHost host) : base(host) + { + } + + public async Task GetCountAsync() + { + var count = await StateManager.TryGetStateAsync(CountStateName); + return count.HasValue ? count.Value : 0; + } + + public async Task IncrementCountAsync() + { + var currentCount = await GetCountAsync(); + await StateManager.SetStateAsync(CountStateName, currentCount + 1); + } +} +``` + +The module will automatically: +1. Detect the `CounterActor` implementation +2. Register it with Dapr.Actors +3. Configure the Actor runtime +4. Map the Actor endpoints + +## Actor Runtime Configuration + +The module supports all standard Dapr Actor runtime configurations through `ActorRuntimeOptions`: + +```csharp +PreConfigure(options => +{ + // Actor timeout settings + options.ActorIdleTimeout = TimeSpan.FromMinutes(60); + options.ActorScanInterval = TimeSpan.FromSeconds(30); + + // Draining settings + options.DrainOngoingCallTimeout = TimeSpan.FromSeconds(30); + options.DrainRebalancedActors = true; + + // Reminders settings + options.RemindersStoragePartitions = 7; + + // Custom serialization settings + options.JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }; +}); +``` + +## Important Notes + +* Actor implementations must be registered in the dependency injection container +* Actor interfaces must inherit from `IActor` +* Actor type names can be customized using the `RemoteServiceAttribute` +* The module automatically maps Actor endpoints using ABP's endpoint routing system +* Actor runtime options should be configured in the `PreConfigureServices` phase + +## Endpoint Mapping + +The module automatically maps the following Actor endpoints: +* `/dapr/actors/{actorType}/{actorId}/method/{methodName}` +* `/dapr/actors/{actorType}/{actorId}/state` +* `/dapr/actors/{actorType}/{actorId}/reminders/{reminderName}` +* `/dapr/actors/{actorType}/{actorId}/timers/{timerName}` + +[查看中文](README.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/README.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/README.md index f1e15535c..a80813802 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/README.md +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/README.md @@ -2,6 +2,15 @@ Dapr.Asp.NetCore的Abp框架集成,扫描程序集内部实现的Actor服务列表,批量注册为Dapr.Actors +## 功能特性 + +* 自动Actor服务注册 +* 与ABP依赖注入系统集成 +* 通过`RemoteServiceAttribute`支持自定义Actor类型名称 +* 通过`ActorRuntimeOptions`配置Actor运行时 +* 自动Actor端点映射 +* Actor接口验证 + ## 配置使用 模块按需引用 @@ -10,10 +19,105 @@ Dapr.Asp.NetCore的Abp框架集成,扫描程序集内部实现的Actor服务列 [DependsOn(typeof(AbpDaprActorsAspNetCoreModule))] public class YouProjectModule : AbpModule { - // other + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // 配置Actor运行时选项 + PreConfigure(options => + { + options.ActorIdleTimeout = TimeSpan.FromMinutes(60); + options.ActorScanInterval = TimeSpan.FromSeconds(30); + options.DrainOngoingCallTimeout = TimeSpan.FromSeconds(30); + options.DrainRebalancedActors = true; + options.RemindersStoragePartitions = 7; + }); + } +} +``` + +## 实现示例 + +1. 定义Actor接口 + +```csharp +[RemoteService("counter")] // 可选:自定义Actor类型名称 +public interface ICounterActor : IActor +{ + Task GetCountAsync(); + Task IncrementCountAsync(); +} +``` + +2. 实现Actor + +```csharp +public class CounterActor : Actor, ICounterActor +{ + private const string CountStateName = "count"; + + public CounterActor(ActorHost host) : base(host) + { + } + + public async Task GetCountAsync() + { + var count = await StateManager.TryGetStateAsync(CountStateName); + return count.HasValue ? count.Value : 0; + } + + public async Task IncrementCountAsync() + { + var currentCount = await GetCountAsync(); + await StateManager.SetStateAsync(CountStateName, currentCount + 1); + } } ``` -## 配置项说明 +模块将自动: +1. 检测`CounterActor`实现 +2. 将其注册到Dapr.Actors +3. 配置Actor运行时 +4. 映射Actor端点 + +## Actor运行时配置 + +模块通过`ActorRuntimeOptions`支持所有标准的Dapr Actor运行时配置: + +```csharp +PreConfigure(options => +{ + // Actor超时设置 + options.ActorIdleTimeout = TimeSpan.FromMinutes(60); + options.ActorScanInterval = TimeSpan.FromSeconds(30); + + // 清理设置 + options.DrainOngoingCallTimeout = TimeSpan.FromSeconds(30); + options.DrainRebalancedActors = true; + + // 提醒器设置 + options.RemindersStoragePartitions = 7; + + // 自定义序列化设置 + options.JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }; +}); +``` + +## 重要说明 + +* Actor实现必须在依赖注入容器中注册 +* Actor接口必须继承自`IActor` +* Actor类型名称可以使用`RemoteServiceAttribute`自定义 +* 模块使用ABP的端点路由系统自动映射Actor端点 +* Actor运行时选项应在`PreConfigureServices`阶段配置 + +## 端点映射 + +模块自动映射以下Actor端点: +* `/dapr/actors/{actorType}/{actorId}/method/{methodName}` +* `/dapr/actors/{actorType}/{actorId}/state` +* `/dapr/actors/{actorType}/{actorId}/reminders/{reminderName}` +* `/dapr/actors/{actorType}/{actorId}/timers/{timerName}` -## 其他 +[View English](README.EN.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/README.EN.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/README.EN.md new file mode 100644 index 000000000..7a58229b5 --- /dev/null +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/README.EN.md @@ -0,0 +1,129 @@ +# LINGYUN.Abp.Dapr.Actors + +Dapr.IActor client proxy module + +## Features + +* Dynamic proxy generation for Dapr Actors +* Integration with ABP's remote service system +* Support for Actor authentication and authorization +* Multi-tenant support +* Automatic request/response handling +* Custom error handling +* Culture and language header support + +## Basic Usage + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpDaprActorsModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Register proxies similar to Volo.Abp.Http.Client module + context.Services.AddDaprActorProxies( + typeof(YouProjectActorInterfaceModule).Assembly, // Search for IActor definitions in YouProjectActorInterfaceModule + RemoteServiceName + ); + } +} +``` + +## Configuration Options + +```json +{ + "RemoteServices": { + "Default": { + "BaseUrl": "http://localhost:3500", // Required, Dapr HTTP endpoint + "DaprApiToken": "your-api-token", // Optional, Dapr API Token + "RequestTimeout": "30000" // Optional, request timeout in milliseconds (default: 30000) + } + } +} +``` + +## Implementation Example + +1. Actor Interface Definition + +```csharp +public interface ICounterActor : IActor +{ + Task GetCountAsync(); + Task IncrementCountAsync(); +} +``` + +2. Actor Implementation + +```csharp +public class CounterActor : Actor, ICounterActor +{ + private const string CountStateName = "count"; + + public CounterActor(ActorHost host) : base(host) + { + } + + public async Task GetCountAsync() + { + var count = await StateManager.TryGetStateAsync(CountStateName); + return count.HasValue ? count.Value : 0; + } + + public async Task IncrementCountAsync() + { + var currentCount = await GetCountAsync(); + await StateManager.SetStateAsync(CountStateName, currentCount + 1); + } +} +``` + +3. Client Usage + +```csharp +public class CounterService +{ + private readonly ICounterActor _counterActor; + + public CounterService(ICounterActor counterActor) + { + _counterActor = counterActor; + } + + public async Task GetAndIncrementCountAsync() + { + var count = await _counterActor.GetCountAsync(); + await _counterActor.IncrementCountAsync(); + return count; + } +} +``` + +## Important Notes + +* Actor methods must return `Task` or `Task` +* Actor methods can have at most one parameter +* Actor instances are single-threaded, processing one request at a time +* Actor state is managed by the Dapr runtime +* The module automatically handles: + * Authentication headers + * Tenant context + * Culture information + * Request timeouts + * Error handling + +## Error Handling + +The module provides custom error handling for Actor calls: +* `AbpDaprActorCallException`: Thrown when an Actor method call fails +* `ActorMethodInvocationException`: Contains detailed information about the failure +* Error responses include: + * Error message + * Error code + * Original exception type + +[查看中文](README.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/README.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/README.md index 1baa45e79..e133373e9 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/README.md +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/README.md @@ -1,6 +1,16 @@ # LINGYUN.Abp.Dapr.Actors -Dapr.IActor客户端代理 +Dapr.IActor客户端代理模块 + +## 功能特性 + +* Dapr Actors的动态代理生成 +* 与ABP远程服务系统集成 +* 支持Actor认证和授权 +* 多租户支持 +* 自动请求/响应处理 +* 自定义错误处理 +* 文化和语言标头支持 ## 配置使用 @@ -10,7 +20,7 @@ Dapr.IActor客户端代理 [DependsOn(typeof(AbpDaprActorsModule))] public class YouProjectModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) { // 注册代理类似于 Volo.Abp.Http.Client 模块 context.Services.AddDaprActorProxies( @@ -20,7 +30,100 @@ public class YouProjectModule : AbpModule } } ``` -## 配置项说明 +## 配置选项 + +```json +{ + "RemoteServices": { + "Default": { + "BaseUrl": "http://localhost:3500", // 必需,Dapr HTTP端点 + "DaprApiToken": "your-api-token", // 可选,Dapr API Token + "RequestTimeout": "30000" // 可选,请求超时时间(毫秒,默认:30000) + } + } +} +``` + +## 实现示例 + +1. Actor接口定义 + +```csharp +public interface ICounterActor : IActor +{ + Task GetCountAsync(); + Task IncrementCountAsync(); +} +``` + +2. Actor实现 + +```csharp +public class CounterActor : Actor, ICounterActor +{ + private const string CountStateName = "count"; + + public CounterActor(ActorHost host) : base(host) + { + } + + public async Task GetCountAsync() + { + var count = await StateManager.TryGetStateAsync(CountStateName); + return count.HasValue ? count.Value : 0; + } + + public async Task IncrementCountAsync() + { + var currentCount = await GetCountAsync(); + await StateManager.SetStateAsync(CountStateName, currentCount + 1); + } +} +``` + +3. 客户端使用 + +```csharp +public class CounterService +{ + private readonly ICounterActor _counterActor; + + public CounterService(ICounterActor counterActor) + { + _counterActor = counterActor; + } + + public async Task GetAndIncrementCountAsync() + { + var count = await _counterActor.GetCountAsync(); + await _counterActor.IncrementCountAsync(); + return count; + } +} +``` + +## 注意事项 + +* Actor方法必须返回`Task`或`Task` +* Actor方法最多只能有一个参数 +* Actor实例是单线程的,一次只能处理一个请求 +* Actor状态由Dapr运行时管理 +* 模块自动处理: + * 认证标头 + * 租户上下文 + * 文化信息 + * 请求超时 + * 错误处理 + +## 错误处理 + +模块为Actor调用提供自定义错误处理: +* `AbpDaprActorCallException`:当Actor方法调用失败时抛出 +* `ActorMethodInvocationException`:包含有关失败的详细信息 +* 错误响应包括: + * 错误消息 + * 错误代码 + * 原始异常类型 -## 其他 +[查看更多](README.EN.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/README.EN.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/README.EN.md new file mode 100644 index 000000000..6feb2fc59 --- /dev/null +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/README.EN.md @@ -0,0 +1,189 @@ +# LINGYUN.Abp.Dapr.Client.Wrapper + +Dapr service-to-service invocation module that handles wrapped response result unpacking. + +## Features + +* Automatic response result wrapping/unwrapping +* Integration with ABP's wrapper system +* Custom error handling for wrapped responses +* Support for success/error code configuration +* HTTP status code mapping +* Support for custom response wrapper format +* Flexible wrapping control options + +## Basic Usage + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpDaprClientModule))] +public class AbpDaprClientWrapperModule : AbpModule +{ +} +``` + +## Configuration Options + +The module uses `AbpWrapperOptions` from the `LINGYUN.Abp.Wrapper` package for configuration: + +```json +{ + "Wrapper": { + "IsEnabled": true, // Enable/disable response wrapping + "CodeWithSuccess": "0", // Success code in wrapped response + "HttpStatusCode": 200, // Default HTTP status code for wrapped responses + "WrapOnError": true, // Whether to wrap error responses + "WrapOnSuccess": true // Whether to wrap success responses + } +} +``` + +## Implementation Example + +1. Service Definition + +```csharp +public interface IProductService +{ + Task GetAsync(string id); + Task> GetListAsync(); + Task CreateAsync(CreateProductDto input); +} +``` + +2. Service Implementation + +```csharp +public class ProductService : IProductService +{ + private readonly DaprClient _daprClient; + + public ProductService(DaprClient daprClient) + { + _daprClient = daprClient; + } + + public async Task GetAsync(string id) + { + // Response wrapping is handled automatically + return await _daprClient.InvokeMethodAsync( + "product-service", // Target service ID + $"api/products/{id}", // Method path + HttpMethod.Get + ); + } + + public async Task> GetListAsync() + { + return await _daprClient.InvokeMethodAsync>( + "product-service", + "api/products", + HttpMethod.Get + ); + } + + public async Task CreateAsync(CreateProductDto input) + { + return await _daprClient.InvokeMethodAsync( + "product-service", + "api/products", + HttpMethod.Post, + input + ); + } +} +``` + +## Response Format + +When wrapping is enabled, the response will be in the following format: + +```json +{ + "code": "0", // Response code, "0" indicates success by default + "message": "Success", // Response message + "details": null, // Additional details (optional) + "result": { // Actual response data + // ... response content + } +} +``` + +## Error Handling + +The module automatically handles error responses: +* For wrapped responses (with `AbpWrapResult` header): + * Unwraps the response and checks the code + * If code doesn't match `CodeWithSuccess`, throws `AbpRemoteCallException` + * Includes error message, details, and code in the exception + * Supports custom error code mapping +* For unwrapped responses: + * Passes through the original response + * Uses standard HTTP error handling + * Maintains original error information + +### Error Response Example + +```json +{ + "code": "ERROR_001", + "message": "Product not found", + "details": "Product with ID '123' does not exist", + "result": null +} +``` + +## Advanced Usage + +### 1. Controlling Response Wrapping + +Response wrapping can be controlled per request using HTTP headers: + +```csharp +// Add to request headers +var headers = new Dictionary +{ + { "X-Abp-Wrap-Result", "true" }, // Force enable wrapping + // or + { "X-Abp-Dont-Wrap-Result", "true" } // Force disable wrapping +}; + +await _daprClient.InvokeMethodAsync( + "product-service", + "api/products", + HttpMethod.Get, + null, + headers +); +``` + +### 2. Custom Error Handling + +```csharp +public class CustomErrorHandler : IAbpWrapperErrorHandler +{ + public Task HandleAsync(AbpWrapperErrorContext context) + { + // Custom error handling logic + if (context.Response.Code == "CUSTOM_ERROR") + { + // Special handling + } + return Task.CompletedTask; + } +} +``` + +## Important Notes + +* Response wrapping can be controlled through: + * Global settings in configuration + * HTTP headers for individual requests + * Dynamic control in code +* Error responses maintain original error structure when possible +* The module integrates with ABP's remote service error handling system +* Recommended to use response wrapping consistently in microservices architecture +* Wrapper format can be customized by implementing `IAbpWrapperResponseBuilder` + +[查看中文](README.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/README.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/README.md index a5a138290..de9601245 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/README.md +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/README.md @@ -2,6 +2,16 @@ Dapr服务间调用,对包装后的响应结果解包 +## 功能特性 + +* 自动响应结果包装/解包 +* 与ABP包装系统集成 +* 自定义包装响应的错误处理 +* 支持成功/错误代码配置 +* HTTP状态码映射 +* 支持自定义响应包装格式 +* 灵活的包装控制选项 + ## 配置使用 模块按需引用 @@ -13,4 +23,167 @@ public class AbpDaprClientWrapperModule : AbpModule } ``` -## 其他 +## 配置选项 + +模块使用来自`LINGYUN.Abp.Wrapper`包的`AbpWrapperOptions`进行配置: + +```json +{ + "Wrapper": { + "IsEnabled": true, // 启用/禁用响应包装 + "CodeWithSuccess": "0", // 包装响应中的成功代码 + "HttpStatusCode": 200, // 包装响应的默认HTTP状态码 + "WrapOnError": true, // 是否包装错误响应 + "WrapOnSuccess": true // 是否包装成功响应 + } +} +``` + +## 实现示例 + +1. 服务定义 + +```csharp +public interface IProductService +{ + Task GetAsync(string id); + Task> GetListAsync(); + Task CreateAsync(CreateProductDto input); +} +``` + +2. 服务实现 + +```csharp +public class ProductService : IProductService +{ + private readonly DaprClient _daprClient; + + public ProductService(DaprClient daprClient) + { + _daprClient = daprClient; + } + + public async Task GetAsync(string id) + { + // 调用会自动处理响应包装 + return await _daprClient.InvokeMethodAsync( + "product-service", // 目标服务ID + $"api/products/{id}", // 方法路径 + HttpMethod.Get + ); + } + + public async Task> GetListAsync() + { + return await _daprClient.InvokeMethodAsync>( + "product-service", + "api/products", + HttpMethod.Get + ); + } + + public async Task CreateAsync(CreateProductDto input) + { + return await _daprClient.InvokeMethodAsync( + "product-service", + "api/products", + HttpMethod.Post, + input + ); + } +} +``` + +## 响应格式 + +当启用包装时,响应将采用以下格式: + +```json +{ + "code": "0", // 响应代码,默认"0"表示成功 + "message": "Success", // 响应消息 + "details": null, // 附加详情(可选) + "result": { // 实际响应数据 + // ... 响应内容 + } +} +``` + +## 错误处理 + +模块自动处理错误响应: +* 对于包装的响应(带有`AbpWrapResult`头): + * 解包响应并检查代码 + * 如果代码与`CodeWithSuccess`不匹配,抛出`AbpRemoteCallException` + * 在异常中包含错误消息、详情和代码 + * 支持自定义错误代码映射 +* 对于未包装的响应: + * 传递原始响应 + * 使用标准HTTP错误处理 + * 保持原始错误信息 + +### 错误响应示例 + +```json +{ + "code": "ERROR_001", + "message": "产品未找到", + "details": "ID为'123'的产品不存在", + "result": null +} +``` + +## 高级用法 + +### 1. 控制响应包装 + +可以通过HTTP头控制单个请求的响应包装: + +```csharp +// 在请求头中添加 +var headers = new Dictionary +{ + { "X-Abp-Wrap-Result", "true" }, // 强制启用包装 + // 或 + { "X-Abp-Dont-Wrap-Result", "true" } // 强制禁用包装 +}; + +await _daprClient.InvokeMethodAsync( + "product-service", + "api/products", + HttpMethod.Get, + null, + headers +); +``` + +### 2. 自定义错误处理 + +```csharp +public class CustomErrorHandler : IAbpWrapperErrorHandler +{ + public Task HandleAsync(AbpWrapperErrorContext context) + { + // 自定义错误处理逻辑 + if (context.Response.Code == "CUSTOM_ERROR") + { + // 特殊处理 + } + return Task.CompletedTask; + } +} +``` + +## 注意事项 + +* 响应包装可以通过以下方式控制: + * 配置文件中的全局设置 + * HTTP头控制单个请求 + * 代码中的动态控制 +* 错误响应尽可能保持原始错误结构 +* 模块与ABP的远程服务错误处理系统集成 +* 建议在微服务架构中统一使用响应包装 +* 包装格式可以通过继承`IAbpWrapperResponseBuilder`自定义 + +[查看英文](README.EN.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/README.EN.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/README.EN.md new file mode 100644 index 000000000..5b0e27f1c --- /dev/null +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/README.EN.md @@ -0,0 +1,277 @@ +[Actors](../README.md) | Dapr.Client Documentation + +# LINGYUN.Abp.Dapr.Client + +Implements service-to-service invocation as described in the Dapr documentation. The project design is consistent with Volo.Abp.Http.Client and can seamlessly replace Volo.Abp.Http.Client through configuration. + +For configuration reference, see [AbpRemoteServiceOptions](https://docs.abp.io/en/abp/latest/API/Dynamic-CSharp-API-Clients#abpremoteserviceoptions) + +## Features + +* Integration with ABP remote service system +* Dynamic proxy generation +* Service discovery and load balancing +* Custom request and response handling +* Error handling and formatting +* Multiple service endpoint configuration +* Request/response interceptors +* Custom DaprClient behavior support + +## Configuration Options + +```json +{ + "RemoteServices": { + "Default": { + "AppId": "default-app", // Dapr application ID + "BaseUrl": "http://localhost:3500", // Dapr HTTP endpoint + "HealthCheckUrl": "/health", // Health check endpoint + "RequestTimeout": 30000, // Request timeout in milliseconds + "RetryCount": 3, // Number of retry attempts + "RetryWaitTime": 1000 // Retry wait time in milliseconds + }, + "System": { + "AppId": "system-app", + "BaseUrl": "http://localhost:50000", + "Headers": { // Custom request headers + "Tenant": "Default", + "Culture": "en-US" + } + } + } +} +``` + +## Basic Usage + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpDaprClientModule))] +public class YourProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Register proxies similar to Volo.Abp.Http.Client module + context.Services.AddDaprClientProxies( + typeof(YourProjectInterfaceModule).Assembly, // Search for remote service definitions + RemoteServiceName + ); + + // Configure proxy options + Configure(options => + { + // Configure request interceptor + options.ProxyRequestActions.Add((appId, request) => + { + request.Headers.Add("Custom-Header", "Value"); + }); + + // Configure response handling + options.OnResponse(async (response, serviceProvider) => + { + return await response.Content.ReadAsStringAsync(); + }); + + // Configure error handling + options.OnError(async (response, serviceProvider) => + { + var error = await response.Content.ReadAsStringAsync(); + return new RemoteServiceErrorInfo + { + Code = response.StatusCode.ToString(), + Message = error + }; + }); + }); + } +} +``` + +## Implementation Example + +### 1. Interface Definition + +```csharp +// IApplicationService implements IRemoteService +public interface ISystemAppService : IApplicationService +{ + Task GetAsync(); + Task CreateAsync(CreateSystemDto input); + Task> GetListAsync(); + Task DeleteAsync(string id); +} + +public class SystemInterfaceModule : AbpModule +{ +} +``` + +### 2. Server Implementation + +```csharp +[DependsOn( + typeof(SystemInterfaceModule), + typeof(AbpAspNetCoreMvcModule) +)] +public class SystemServerModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(SystemServerModule).Assembly); + }); + } +} + +public class SystemAppService : ApplicationService, ISystemAppService +{ + private readonly ISystemRepository _systemRepository; + + public SystemAppService(ISystemRepository systemRepository) + { + _systemRepository = systemRepository; + } + + public async Task GetAsync() + { + return "System"; + } + + public async Task CreateAsync(CreateSystemDto input) + { + var system = await _systemRepository.CreateAsync( + new System + { + Name = input.Name, + Description = input.Description + } + ); + return ObjectMapper.Map(system); + } + + public async Task> GetListAsync() + { + var systems = await _systemRepository.GetListAsync(); + return ObjectMapper.Map, List>(systems); + } + + public async Task DeleteAsync(string id) + { + await _systemRepository.DeleteAsync(id); + } +} +``` + +### 3. Client Usage + +```csharp +[DependsOn(typeof(AbpDaprClientModule))] +public class SystemClientModule : AbpModule +{ + private const string RemoteServiceName = "System"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Register proxies + context.Services.AddDaprClientProxies( + typeof(SystemInterfaceModule).Assembly, + RemoteServiceName + ); + + // Configure retry policy + context.Services.AddDaprClientBuilder(builder => + { + builder.ConfigureHttpClient((sp, client) => + { + client.Timeout = TimeSpan.FromSeconds(30); + }); + }); + } +} + +public class SystemService +{ + private readonly ISystemAppService _systemAppService; + + public SystemService(ISystemAppService systemAppService) + { + _systemAppService = systemAppService; + } + + public async Task> GetSystemsAsync() + { + try + { + return await _systemAppService.GetListAsync(); + } + catch (AbpRemoteCallException ex) + { + // Handle remote call exception + _logger.LogError(ex, "Failed to get systems"); + throw; + } + } +} +``` + +## Advanced Usage + +### 1. Custom Request Handling + +```csharp +public class CustomRequestHandler +{ + public void Configure(HttpRequestMessage request) + { + request.Headers.Add("Correlation-Id", Guid.NewGuid().ToString()); + request.Headers.Add("Client-Version", "1.0.0"); + } +} + +// Register in module +Configure(options => +{ + options.ProxyRequestActions.Add((appId, request) => + { + new CustomRequestHandler().Configure(request); + }); +}); +``` + +### 2. Custom Response Handling + +```csharp +public class CustomResponseHandler +{ + public async Task HandleAsync(HttpResponseMessage response) + { + var content = await response.Content.ReadAsStringAsync(); + // Custom response handling logic + return content; + } +} + +// Register in module +Configure(options => +{ + options.OnResponse(async (response, sp) => + { + return await new CustomResponseHandler().HandleAsync(response); + }); +}); +``` + +## Important Notes + +* Remote service interfaces must inherit `IRemoteService` +* Configuration changes require recreating proxy instances +* Configure appropriate timeout and retry policies +* Error handling should consider network exceptions and service unavailability +* Enable service discovery in production environments +* Use health checks to ensure service availability +* Request header configuration should consider security and authentication requirements +* Logging is important for problem diagnosis + +[查看中文](README.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/README.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/README.md index b82e7471c..345d7f04f 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/README.md +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/README.md @@ -2,72 +2,118 @@ # LINGYUN.Abp.Dapr.Client -实现了Dapr文档中的服务间调用,项目设计与Volo.Abp.Http.Client一致,通过配置文件即可无缝替代Volo.Abp.Http.Client +实现了Dapr文档中的服务间调用,项目设计与Volo.Abp.Http.Client一致,通过配置文件即可无缝替代Volo.Abp.Http.Client。 -配置参考 [AbpRemoteServiceOptions](https://docs.abp.io/zh-Hans/abp/latest/API/Dynamic-CSharp-API-Clients#abpremoteserviceoptions) +配置参考 [AbpRemoteServiceOptions](https://docs.abp.io/zh-Hans/abp/latest/API/Dynamic-CSharp-API-Clients#abpremoteserviceoptions) + +## 功能特性 + +* 与ABP远程服务系统集成 +* 支持动态代理生成 +* 支持服务发现和负载均衡 +* 支持自定义请求和响应处理 +* 支持错误处理和格式化 +* 支持多服务端点配置 +* 支持请求/响应拦截器 +* 支持自定义DaprClient行为 + +## 配置选项 + +```json +{ + "RemoteServices": { + "Default": { + "AppId": "default-app", // Dapr应用ID + "BaseUrl": "http://localhost:3500", // Dapr HTTP端点 + "HealthCheckUrl": "/health", // 健康检查端点 + "RequestTimeout": 30000, // 请求超时时间(毫秒) + "RetryCount": 3, // 重试次数 + "RetryWaitTime": 1000 // 重试等待时间(毫秒) + }, + "System": { + "AppId": "system-app", + "BaseUrl": "http://localhost:50000", + "Headers": { // 自定义请求头 + "Tenant": "Default", + "Culture": "zh-Hans" + } + } + } +} +``` ## 配置使用 -模块按需引用 +模块按需引用: ```csharp [DependsOn(typeof(AbpDaprClientModule))] public class YouProjectModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) { - // 注册代理类似于 Volo.Abp.Http.Client 模块 + // 注册代理,类似于 Volo.Abp.Http.Client 模块 context.Services.AddDaprClientProxies( - typeof(YouProjectInterfaceModule).Assembly, // 搜索 YouProjectInterfaceModule 模块下的远程服务定义 + typeof(YouProjectInterfaceModule).Assembly, // 搜索模块下的远程服务定义 RemoteServiceName ); + + // 配置代理选项 + Configure(options => + { + // 配置请求拦截器 + options.ProxyRequestActions.Add((appId, request) => + { + request.Headers.Add("Custom-Header", "Value"); + }); + + // 配置响应处理 + options.OnResponse(async (response, serviceProvider) => + { + return await response.Content.ReadAsStringAsync(); + }); + + // 配置错误处理 + options.OnError(async (response, serviceProvider) => + { + var error = await response.Content.ReadAsStringAsync(); + return new RemoteServiceErrorInfo + { + Code = response.StatusCode.ToString(), + Message = error + }; + }); + }); } } ``` +## 实现示例 -### 1、接口定义 - -```c# +### 1. 接口定义 +```csharp // IApplicationService 实现了 IRemoteService public interface ISystemAppService : IApplicationService { Task GetAsync(); + Task CreateAsync(CreateSystemDto input); + Task> GetListAsync(); + Task DeleteAsync(string id); } public class SystemInterfaceModule : AbpModule { - -} - -``` - -### 2、服务端 - -引用 Volo.Abp.AspNetCore.Mvc - -* 实现接口 - -```c# - -public class SystemAppService : ApplicationService, ISystemAppService -{ - public Task GetAsync() - { - retuen Task.FromResult("System"); - } } - ``` -* 创建模块 - -```c# +### 2. 服务端实现 +```csharp [DependsOn( - typeof(SystemInterfaceModule), - typeof(AbpAspNetCoreMvcModule))] + typeof(SystemInterfaceModule), + typeof(AbpAspNetCoreMvcModule) +)] public class SystemServerModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) @@ -79,93 +125,153 @@ public class SystemServerModule : AbpModule } } -``` - -* 发布到Dapr - -```shell -# --app-port .net程序映射端口 -# -H 对外暴露 http 监听端口 -# -G 对外暴露 grpc 监听端口 -dapr run --app-id myapp --app-port 5000 -H 50000 -G 40001 -- dotnet run - -``` +public class SystemAppService : ApplicationService, ISystemAppService +{ + private readonly ISystemRepository _systemRepository; -### 3、客户端 + public SystemAppService(ISystemRepository systemRepository) + { + _systemRepository = systemRepository; + } -引用 LINGYUN.Abp.Dapr.Client + public async Task GetAsync() + { + return "System"; + } -* 配置文件 **appsettings.json** + public async Task CreateAsync(CreateSystemDto input) + { + var system = await _systemRepository.CreateAsync( + new System + { + Name = input.Name, + Description = input.Description + } + ); + return ObjectMapper.Map(system); + } -```json + public async Task> GetListAsync() + { + var systems = await _systemRepository.GetListAsync(); + return ObjectMapper.Map, List>(systems); + } -{ - "RemoteServices": { - "System": { - "AppId": "myapp", - "BaseUrl": "http://127.0.0.1:50000" - } + public async Task DeleteAsync(string id) + { + await _systemRepository.DeleteAsync(id); } } - ``` -* 客户端代码 - -```c# +### 3. 客户端使用 -// 模块依赖 -[DependsOn( - typeof(AbpDaprClientModule))] -public class SystemActorClientModule : AbpModule +```csharp +[DependsOn(typeof(AbpDaprClientModule))] +public class SystemClientModule : AbpModule { private const string RemoteServiceName = "System"; public override void ConfigureServices(ServiceConfigurationContext context) { - // 注册代理类似于 Volo.Abp.Http.Client 模块 + // 注册代理 context.Services.AddDaprClientProxies( - typeof(SystemInterfaceModule).Assembly, // 搜索 SystemInterfaceModule 模块下的IRemoteService定义创建代理 + typeof(SystemInterfaceModule).Assembly, RemoteServiceName ); + + // 配置重试策略 + context.Services.AddDaprClientBuilder(builder => + { + builder.ConfigureHttpClient((sp, client) => + { + client.Timeout = TimeSpan.FromSeconds(30); + }); + }); } } -// 调用方法,直接依赖注入即可 -public class InvokeClass +public class SystemService { private readonly ISystemAppService _systemAppService; - public InvokeClass(ISystemAppService systemAppService) + public SystemService(ISystemAppService systemAppService) { - _systemAppService = systemAppService; + _systemAppService = systemAppService; } - public async Task InvokeAsync() + public async Task> GetSystemsAsync() { - await _systemAppService.GetAsync(); + try + { + return await _systemAppService.GetListAsync(); + } + catch (AbpRemoteCallException ex) + { + // 处理远程调用异常 + _logger.LogError(ex, "Failed to get systems"); + throw; + } } } - ``` +## 高级用法 -## 配置项说明 - -* AbpRemoteServiceOptions.RemoteServices 配置Dapr.AppId +### 1. 自定义请求处理 -```json +```csharp +public class CustomRequestHandler +{ + public void Configure(HttpRequestMessage request) + { + request.Headers.Add("Correlation-Id", Guid.NewGuid().ToString()); + request.Headers.Add("Client-Version", "1.0.0"); + } +} +// 在模块中注册 +Configure(options => { - "RemoteServices": { - "System": { - "AppId": "myapp", - "BaserUrl": "http://127.0.0.1:50000" - } + options.ProxyRequestActions.Add((appId, request) => + { + new CustomRequestHandler().Configure(request); + }); +}); +``` + +### 2. 自定义响应处理 + +```csharp +public class CustomResponseHandler +{ + public async Task HandleAsync(HttpResponseMessage response) + { + var content = await response.Content.ReadAsStringAsync(); + // 自定义响应处理逻辑 + return content; } } +// 在模块中注册 +Configure(options => +{ + options.OnResponse(async (response, sp) => + { + return await new CustomResponseHandler().HandleAsync(response); + }); +}); ``` +## 注意事项 + +* 远程服务接口必须继承`IRemoteService` +* 配置更改需要重新创建代理实例才能生效 +* 建议配置适当的超时和重试策略 +* 错误处理应该考虑网络异常和服务不可用的情况 +* 在生产环境中应该启用服务发现 +* 建议使用健康检查确保服务可用性 +* 请求头配置应考虑安全性和身份验证需求 +* 日志记录对于问题诊断很重要 -## 其他 +[查看英文](README.EN.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/README.EN.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/README.EN.md new file mode 100644 index 000000000..4de14dc6a --- /dev/null +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/README.EN.md @@ -0,0 +1,204 @@ +# LINGYUN.Abp.Dapr + +Dapr integration base module, implementing the named singleton DaprClient as described in the Dapr documentation. + +See: https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-client/dotnet-daprclient-usage + +## Features + +* Support for creating default and named DaprClient instances +* Support for configuring HTTP and gRPC endpoints +* Support for custom JSON serialization options +* Support for Dapr API Token authentication +* Support for gRPC channel configuration +* Support for DaprClient instance configuration and builder configuration extensions +* Support for multiple Dapr Sidecar connections +* Support for custom DaprClient behaviors + +## Configuration Options + +```json +{ + "Dapr": { + "Client": { + "DaprApiToken": "your-api-token", // Optional, Dapr API Token + "HttpEndpoint": "http://localhost:3500", // Optional, HTTP endpoint + "GrpcEndpoint": "http://localhost:50001", // Optional, gRPC endpoint + "JsonSerializerOptions": { // Optional, JSON serialization options + "PropertyNamingPolicy": "CamelCase", + "PropertyNameCaseInsensitive": true, + "WriteIndented": true, + "DefaultIgnoreCondition": "WhenWritingNull" + }, + "GrpcChannelOptions": { // Optional, gRPC channel options + "Credentials": "Insecure", + "MaxReceiveMessageSize": 1048576, + "MaxSendMessageSize": 1048576 + } + } + } +} +``` + +## Basic Usage + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpDaprModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Create a DaprClient + context.Services.AddDaprClient(); + + // Create a named DaprClient + context.Services.AddDaprClient("__DaprClient"); + + // Configure DaprClient options + Configure(options => + { + options.HttpEndpoint = "http://localhost:3500"; + options.GrpcEndpoint = "http://localhost:50001"; + options.DaprApiToken = "your-api-token"; + + // Add DaprClient configuration actions + options.DaprClientActions.Add(client => + { + // Configure DaprClient instance + }); + + // Add DaprClientBuilder configuration actions + options.DaprClientBuilderActions.Add(builder => + { + // Configure DaprClientBuilder + }); + }); + } +} +``` + +## Advanced Usage + +### 1. Configure DaprClient + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + // Configure named DaprClient + context.Services.AddDaprClient("CustomClient", builder => + { + // Configure HTTP endpoint + builder.UseHttpEndpoint("http://localhost:3500"); + + // Configure gRPC endpoint + builder.UseGrpcEndpoint("http://localhost:50001"); + + // Configure API Token + builder.UseDaprApiToken("your-api-token"); + + // Configure JSON serialization options + builder.UseJsonSerializerOptions(new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + PropertyNameCaseInsensitive = true + }); + + // Configure gRPC channel options + builder.UseGrpcChannelOptions(new GrpcChannelOptions + { + MaxReceiveMessageSize = 1024 * 1024, + MaxSendMessageSize = 1024 * 1024 + }); + }); +} +``` + +### 2. Using DaprClient + +```csharp +public class YourService +{ + private readonly IDaprClientFactory _daprClientFactory; + + public YourService(IDaprClientFactory daprClientFactory) + { + _daprClientFactory = daprClientFactory; + } + + public async Task InvokeMethodAsync() + { + // Use default client + var defaultClient = _daprClientFactory.CreateClient(); + + // Use named client + var namedClient = _daprClientFactory.CreateClient("CustomClient"); + + // Invoke service method + var response = await defaultClient.InvokeMethodAsync( + HttpMethod.Get, + "order-service", // Target service ID + "api/orders/1", // Method path + new { id = 1 } // Request parameters + ); + + // Publish event + await defaultClient.PublishEventAsync( + "pubsub", // Pub/sub component name + "order-created", // Topic name + response // Event data + ); + + // Save state + await defaultClient.SaveStateAsync( + "statestore", // State store component name + "order-1", // Key + response // Value + ); + + // Get state + var state = await defaultClient.GetStateAsync( + "statestore", // State store component name + "order-1" // Key + ); + } +} +``` + +### 3. Custom DaprClient Behavior + +```csharp +public class CustomDaprClientBehavior +{ + public void Configure(DaprClient client) + { + // Configure custom behavior + } +} + +// Register in module +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.DaprClientActions.Add(client => + { + new CustomDaprClientBehavior().Configure(client); + }); + }); +} +``` + +## Important Notes + +* DaprClient instances are thread-safe, singleton pattern is recommended +* Named DaprClients can have different configurations, suitable for scenarios requiring connections to different Dapr Sidecars +* Configuration changes require recreating the DaprClient instance to take effect +* Pay attention to performance and resource consumption when configuring gRPC channels +* JSON serialization options affect all requests using that DaprClient +* API Tokens should be managed through secure configuration management systems +* Recommended to use different named DaprClients for different microservices +* Configure appropriate timeout and retry policies in production environments + +[查看中文](README.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/README.md b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/README.md index d7bb22855..05256bf96 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/README.md +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/README.md @@ -4,23 +4,201 @@ Dapr 集成基础模块, 实现dapr文档中的命名单例DaprClient See: https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-client/dotnet-daprclient-usage +## 功能特性 + +* 支持创建默认和具名DaprClient实例 +* 支持配置HTTP和gRPC端点 +* 支持自定义JSON序列化选项 +* 支持Dapr API Token认证 +* 支持gRPC通道配置 +* 支持DaprClient实例配置和构建配置的扩展 +* 支持多个Dapr Sidecar连接 +* 支持自定义DaprClient行为 + +## 配置选项 + +```json +{ + "Dapr": { + "Client": { + "DaprApiToken": "your-api-token", // 可选,Dapr API Token + "HttpEndpoint": "http://localhost:3500", // 可选,HTTP端点 + "GrpcEndpoint": "http://localhost:50001", // 可选,gRPC端点 + "JsonSerializerOptions": { // 可选,JSON序列化选项 + "PropertyNamingPolicy": "CamelCase", + "PropertyNameCaseInsensitive": true, + "WriteIndented": true, + "DefaultIgnoreCondition": "WhenWritingNull" + }, + "GrpcChannelOptions": { // 可选,gRPC通道选项 + "Credentials": "Insecure", + "MaxReceiveMessageSize": 1048576, + "MaxSendMessageSize": 1048576 + } + } + } +} +``` + ## 配置使用 -模块按需引用 +模块按需引用: ```csharp [DependsOn(typeof(AbpDaprModule))] public class YouProjectModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) { // 创建一个DaprClient context.Services.AddDaprClient(); // 创建一个具名DaprClient context.Services.AddDaprClient("__DaprClient"); + + // 配置DaprClient选项 + Configure(options => + { + options.HttpEndpoint = "http://localhost:3500"; + options.GrpcEndpoint = "http://localhost:50001"; + options.DaprApiToken = "your-api-token"; + + // 添加DaprClient配置动作 + options.DaprClientActions.Add(client => + { + // 配置DaprClient实例 + }); + + // 添加DaprClientBuilder配置动作 + options.DaprClientBuilderActions.Add(builder => + { + // 配置DaprClientBuilder + }); + }); + } +} +``` + +## 高级用法 + +### 1. 配置DaprClient + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + // 配置具名DaprClient + context.Services.AddDaprClient("CustomClient", builder => + { + // 配置HTTP端点 + builder.UseHttpEndpoint("http://localhost:3500"); + + // 配置gRPC端点 + builder.UseGrpcEndpoint("http://localhost:50001"); + + // 配置API Token + builder.UseDaprApiToken("your-api-token"); + + // 配置JSON序列化选项 + builder.UseJsonSerializerOptions(new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + PropertyNameCaseInsensitive = true + }); + + // 配置gRPC通道选项 + builder.UseGrpcChannelOptions(new GrpcChannelOptions + { + MaxReceiveMessageSize = 1024 * 1024, + MaxSendMessageSize = 1024 * 1024 + }); + }); +} +``` + +### 2. 使用DaprClient + +```csharp +public class YourService +{ + private readonly IDaprClientFactory _daprClientFactory; + + public YourService(IDaprClientFactory daprClientFactory) + { + _daprClientFactory = daprClientFactory; + } + + public async Task InvokeMethodAsync() + { + // 使用默认客户端 + var defaultClient = _daprClientFactory.CreateClient(); + + // 使用具名客户端 + var namedClient = _daprClientFactory.CreateClient("CustomClient"); + + // 调用服务方法 + var response = await defaultClient.InvokeMethodAsync( + HttpMethod.Get, + "order-service", // 目标服务ID + "api/orders/1", // 方法路径 + new { id = 1 } // 请求参数 + ); + + // 发布事件 + await defaultClient.PublishEventAsync( + "pubsub", // Pub/sub组件名称 + "order-created", // 主题名称 + response // 事件数据 + ); + + // 保存状态 + await defaultClient.SaveStateAsync( + "statestore", // 状态存储组件名称 + "order-1", // 键 + response // 值 + ); + + // 获取状态 + var state = await defaultClient.GetStateAsync( + "statestore", // 状态存储组件名称 + "order-1" // 键 + ); } } ``` -## 其他 +### 3. 自定义DaprClient行为 + +```csharp +public class CustomDaprClientBehavior +{ + public void Configure(DaprClient client) + { + // 配置自定义行为 + } +} + +// 在模块中注册 +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.DaprClientActions.Add(client => + { + new CustomDaprClientBehavior().Configure(client); + }); + }); +} +``` + +## 注意事项 + +* DaprClient实例是线程安全的,建议使用单例模式 +* 具名DaprClient可以有不同的配置,适用于需要连接不同Dapr Sidecar的场景 +* 配置更改后需要重新创建DaprClient实例才能生效 +* gRPC通道配置需要注意性能和资源消耗 +* JSON序列化选项会影响所有使用该DaprClient的请求 +* API Token应该通过安全的配置管理系统管理 +* 建议为不同的微服务使用不同的具名DaprClient +* 在生产环境中应该适当配置超时和重试策略 + +[查看英文](README.EN.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/README.EN.md b/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/README.EN.md new file mode 100644 index 000000000..c16e23a09 --- /dev/null +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/README.EN.md @@ -0,0 +1,256 @@ +# LINGYUN.Abp.DistributedLocking.Dapr + +An ABP distributed locking implementation based on the Dapr distributed lock API. This module provides seamless integration with Dapr's distributed locking service, supporting cross-service and cross-instance locking capabilities. + +Reference: [Dapr Distributed Lock API](https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/distributed-lock-api-overview/) + +## Features + +* Integration with ABP distributed locking system +* Support for custom lock resource owner identification +* Configurable lock timeout duration +* Automatic lock release support +* Multiple lock storage component support +* Lock acquisition and release event notifications +* Distributed lock health check support + +## Configuration Options + +```json +{ + "DistributedLocking": { + "Dapr": { + "StoreName": "lockstore", // Storage name defined in Dapr component + "DefaultIdentifier": "dapr-lock-owner", // Default lock resource owner identifier + "DefaultTimeout": "00:00:30" // Default lock timeout (30 seconds) + } + } +} +``` + +## Basic Usage + +### 1. Module Configuration + +```csharp +[DependsOn(typeof(AbpDistributedLockingDaprModule))] +public class YourProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Basic configuration + Configure(options => + { + options.StoreName = "redis-lock"; // Use Redis as lock storage + options.DefaultIdentifier = "my-service"; // Custom lock owner identifier + options.DefaultTimeout = TimeSpan.FromMinutes(1); // Set default timeout to 1 minute + }); + } +} +``` + +### 2. Basic Usage + +```csharp +public class OrderService +{ + private readonly IDistributedLockProvider _lockProvider; + + public OrderService(IDistributedLockProvider lockProvider) + { + _lockProvider = lockProvider; + } + + public async Task ProcessOrderAsync(string orderId) + { + // Try to acquire lock + using (var handle = await _lockProvider.TryAcquireAsync($"order:{orderId}")) + { + if (handle != null) + { + try + { + // Execute business logic that requires locking + await ProcessOrderInternalAsync(orderId); + } + catch (Exception ex) + { + // Handle exception + _logger.LogError(ex, "Error occurred while processing order"); + throw; + } + } + else + { + throw new ConcurrencyException("Order is being processed by another process"); + } + } + } +} +``` + +### 3. Advanced Usage + +```csharp +public class InventoryService +{ + private readonly IDistributedLockProvider _lockProvider; + private readonly ILogger _logger; + + public InventoryService( + IDistributedLockProvider lockProvider, + ILogger logger) + { + _lockProvider = lockProvider; + _logger = logger; + } + + public async Task UpdateInventoryAsync(string productId, int quantity) + { + // Custom lock configuration + var lockOptions = new DistributedLockOptions + { + Timeout = TimeSpan.FromSeconds(10), // Custom timeout + RetryDelay = TimeSpan.FromMilliseconds(100) // Retry delay + }; + + try + { + using (var handle = await _lockProvider.TryAcquireAsync( + $"inventory:{productId}", + lockOptions)) + { + if (handle == null) + { + _logger.LogWarning("Unable to acquire inventory lock for product ID: {ProductId}", productId); + throw new ConcurrencyException("Unable to acquire inventory lock"); + } + + // Execute inventory update operation + await UpdateInventoryInternalAsync(productId, quantity); + } + } + catch (Exception ex) when (ex is not ConcurrencyException) + { + _logger.LogError(ex, "Error occurred while updating inventory"); + throw; + } + } +} +``` + +## Component Configuration + +### Redis Lock Store Configuration Example + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: redis-lock # Corresponds to StoreName configuration +spec: + type: lock.redis + version: v1 + metadata: + - name: redisHost + value: localhost:6379 + - name: redisPassword + value: "" + - name: enableTLS + value: false + - name: maxRetries + value: 5 + - name: maxRetryBackoff + value: 5s +``` + +### Consul Lock Store Configuration Example + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: consul-lock +spec: + type: lock.consul + version: v1 + metadata: + - name: host + value: localhost:8500 + - name: sessionTTL + value: 10 + - name: scheme + value: http +``` + +## Core Interfaces + +### ILockOwnerFinder + +Interface for providing lock resource owner identification. + +```csharp +public interface ILockOwnerFinder +{ + string GetOwner(); +} +``` + +The default implementation `LockOwnerFinder`: +1. Primarily uses the current user ID as the lock owner identifier +2. Falls back to the configured `DefaultIdentifier` if no user is logged in + +### Custom Lock Owner Identifier Implementation + +```csharp +public class CustomLockOwnerFinder : ILockOwnerFinder +{ + private readonly ICurrentTenant _currentTenant; + + public CustomLockOwnerFinder(ICurrentTenant currentTenant) + { + _currentTenant = currentTenant; + } + + public string GetOwner() + { + // Use combination of tenant ID and machine name as lock owner identifier + return $"{_currentTenant.Id ?? "host"}-{Environment.MachineName}"; + } +} + +// Register custom implementation +context.Services.AddTransient(); +``` + +## Best Practices + +1. **Set Appropriate Timeout Duration** + - Set timeout based on expected execution time of business operations + - Avoid setting excessively long timeouts to prevent deadlocks + +2. **Proper Lock Granularity** + - Keep lock scope as small as possible, only lock necessary resources + - Avoid holding locks for extended periods, release promptly + +3. **Exception Handling** + - Always use locks within using blocks + - Handle lock acquisition failures appropriately + - Log critical lock operations + +4. **Performance Optimization** + - Use appropriate storage components + - Configure suitable retry policies + - Monitor lock usage + +## Important Notes + +* Ensure Dapr Sidecar is properly configured and running +* Distributed lock component must be correctly defined in Dapr configuration +* Set appropriate lock timeouts to avoid deadlocks +* Handle lock acquisition failures properly +* Consider performance impact in high-concurrency scenarios +* Configure health checks for lock components +* Add logging for important operations + +[查看中文](README.md) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/README.md b/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/README.md index 587e065ea..a5be5fad3 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/README.md +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/README.md @@ -1,38 +1,256 @@ # LINGYUN.Abp.DistributedLocking.Dapr -Abp分布式锁的Dapr实现 +基于Dapr分布式锁API的ABP分布式锁实现。该模块提供了与Dapr分布式锁服务的无缝集成,支持跨服务、跨实例的分布式锁定功能。 -See: https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/distributed-lock-api-overview/ +参考文档: [Dapr Distributed Lock API](https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/distributed-lock-api-overview/) -## 配置使用 +## 功能特性 -模块按需引用 +* 与ABP分布式锁系统集成 +* 支持自定义锁资源拥有者标识 +* 支持可配置的锁定超时时间 +* 支持锁资源自动释放 +* 支持多种锁存储组件 +* 支持锁获取和释放的事件通知 +* 支持分布式锁的健康检查 + +## 配置选项 + +```json +{ + "DistributedLocking": { + "Dapr": { + "StoreName": "lockstore", // Dapr组件中定义的存储名称 + "DefaultIdentifier": "dapr-lock-owner", // 默认锁资源拥有者标识 + "DefaultTimeout": "00:00:30" // 默认锁定超时时间(30秒) + } + } +} +``` + +## 基础使用 + +### 1. 模块配置 ```csharp [DependsOn(typeof(AbpDistributedLockingDaprModule))] -public class YouProjectModule : AbpModule +public class YourProjectModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { + // 基础配置 Configure(options => { - options.StoreName = "store-name"; - options.DefaultIdentifier = "default-owner-id"; - options.DefaultTimeout = TimeSpan.FromSeconds(30); + options.StoreName = "redis-lock"; // 使用Redis作为锁存储 + options.DefaultIdentifier = "my-service"; // 自定义锁拥有者标识 + options.DefaultTimeout = TimeSpan.FromMinutes(1); // 设置默认超时时间为1分钟 }); } } ``` -## 配置说明 +### 2. 基本用法 + +```csharp +public class OrderService +{ + private readonly IDistributedLockProvider _lockProvider; + + public OrderService(IDistributedLockProvider lockProvider) + { + _lockProvider = lockProvider; + } + + public async Task ProcessOrderAsync(string orderId) + { + // 尝试获取锁 + using (var handle = await _lockProvider.TryAcquireAsync($"order:{orderId}")) + { + if (handle != null) + { + try + { + // 执行需要加锁的业务逻辑 + await ProcessOrderInternalAsync(orderId); + } + catch (Exception ex) + { + // 处理异常 + _logger.LogError(ex, "处理订单时发生错误"); + throw; + } + } + else + { + throw new ConcurrencyException("订单正在被其他进程处理"); + } + } + } +} +``` + +### 3. 高级用法 + +```csharp +public class InventoryService +{ + private readonly IDistributedLockProvider _lockProvider; + private readonly ILogger _logger; + + public InventoryService( + IDistributedLockProvider lockProvider, + ILogger logger) + { + _lockProvider = lockProvider; + _logger = logger; + } + + public async Task UpdateInventoryAsync(string productId, int quantity) + { + // 自定义锁配置 + var lockOptions = new DistributedLockOptions + { + Timeout = TimeSpan.FromSeconds(10), // 自定义超时时间 + RetryDelay = TimeSpan.FromMilliseconds(100) // 重试延迟 + }; + + try + { + using (var handle = await _lockProvider.TryAcquireAsync( + $"inventory:{productId}", + lockOptions)) + { + if (handle == null) + { + _logger.LogWarning("无法获取库存锁,产品ID: {ProductId}", productId); + throw new ConcurrencyException("无法获取库存锁"); + } + + // 执行库存更新操作 + await UpdateInventoryInternalAsync(productId, quantity); + } + } + catch (Exception ex) when (ex is not ConcurrencyException) + { + _logger.LogError(ex, "更新库存时发生错误"); + throw; + } + } +} +``` + +## 组件配置 + +### Redis锁存储配置示例 + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: redis-lock # 对应StoreName配置 +spec: + type: lock.redis + version: v1 + metadata: + - name: redisHost + value: localhost:6379 + - name: redisPassword + value: "" + - name: enableTLS + value: false + - name: maxRetries + value: 5 + - name: maxRetryBackoff + value: 5s +``` + +### Consul锁存储配置示例 + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: consul-lock +spec: + type: lock.consul + version: v1 + metadata: + - name: host + value: localhost:8500 + - name: sessionTTL + value: 10 + - name: scheme + value: http +``` + +## 核心接口 + +### ILockOwnerFinder + +提供锁资源持有者标识的接口。 + +```csharp +public interface ILockOwnerFinder +{ + string GetOwner(); +} +``` + +默认实现 `LockOwnerFinder` 会: +1. 优先使用当前用户ID作为锁拥有者标识 +2. 如果用户未登录,则使用配置的 `DefaultIdentifier` + +### 自定义锁拥有者标识实现 + +```csharp +public class CustomLockOwnerFinder : ILockOwnerFinder +{ + private readonly ICurrentTenant _currentTenant; + + public CustomLockOwnerFinder(ICurrentTenant currentTenant) + { + _currentTenant = currentTenant; + } + + public string GetOwner() + { + // 使用租户ID和机器名称组合作为锁拥有者标识 + return $"{_currentTenant.Id ?? "host"}-{Environment.MachineName}"; + } +} + +// 注册自定义实现 +context.Services.AddTransient(); +``` + +## 最佳实践 + +1. **合理设置超时时间** + - 根据业务操作的预期执行时间设置合适的超时时间 + - 避免设置过长的超时时间,以防止死锁 + +2. **正确的锁粒度** + - 锁的范围应该尽可能小,只锁定必要的资源 + - 避免长时间持有锁,及时释放 + +3. **异常处理** + - 始终在 using 块中使用锁 + - 妥善处理锁获取失败的情况 + - 记录关键的锁操作日志 -* AbpDistributedLockingDaprOptions.StoreName 在dapr component文件中定义的metadata name,默认: lockstore; -* AbpDistributedLockingDaprOptions.DefaultIdentifier 默认锁资源拥有者标识,默认: dapr-lock-owner; -* AbpDistributedLockingDaprOptions.DefaultTimeout 默认锁定超时时间,默认: 30s. +4. **性能优化** + - 使用合适的存储组件 + - 配置适当的重试策略 + - 监控锁的使用情况 -## 接口说明 +## 注意事项 -[ILockOwnerFinder](./LINGYUN/Abp/DistributedLocking/Dapr/ILockOwnerFinder), 提供锁资源持有者标识 -默认实现 [LockOwnerFinder](./LINGYUN/Abp/DistributedLocking/Dapr/LockOwnerFinder), 获取用户标识,如果不存在,返回DefaultIdentifier +* 确保Dapr Sidecar已正确配置并运行 +* 分布式锁组件需要在Dapr配置中正确定义 +* 合理设置锁的超时时间,避免死锁 +* 正确处理锁获取失败的情况 +* 在高并发场景下注意性能影响 +* 建议配置锁组件的健康检查 +* 重要操作建议添加日志记录 -## 其他 +[查看英文](README.EN.md) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/README.EN.md b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/README.EN.md new file mode 100644 index 000000000..d330d4139 --- /dev/null +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/README.EN.md @@ -0,0 +1,30 @@ +# LINGYUN.Abp.DataProtection.Abstractions + +Data protection abstraction module, providing interface definitions and basic types for data protection. + +## Features + +* `IDataProtected` - Data protection interface, marking entities that need data protection control +* `DataProtectedAttribute` - Data protection attribute, marking methods or classes that need data protection control +* `DisableDataProtectedAttribute` - Disable data protection attribute, marking methods or classes that don't need data protection control + +## Data Operation Types + +* `DataAccessOperation.Read` - Query operation +* `DataAccessOperation.Write` - Update operation +* `DataAccessOperation.Delete` - Delete operation + +## Data Filtering + +* `DataAccessFilterLogic` - Data filter logic + * `And` - Logical AND + * `Or` - Logical OR +* `DataAccessFilterRule` - Data filter rule + * `Field` - Field name + * `Value` - Field value + * `Operate` - Operator + * `IsLeft` - Is left parenthesis + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/README.md b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/README.md new file mode 100644 index 000000000..d2e8fa8cd --- /dev/null +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/README.md @@ -0,0 +1,30 @@ +# LINGYUN.Abp.DataProtection.Abstractions + +数据权限抽象模块,提供数据权限相关的接口定义和基础类型。 + +## 功能 + +* `IDataProtected` - 数据权限接口,标记实体需要进行数据权限控制 +* `DataProtectedAttribute` - 数据权限特性,标记方法或类需要进行数据权限控制 +* `DisableDataProtectedAttribute` - 禁用数据权限特性,标记方法或类不进行数据权限控制 + +## 数据操作类型 + +* `DataAccessOperation.Read` - 查询操作 +* `DataAccessOperation.Write` - 更新操作 +* `DataAccessOperation.Delete` - 删除操作 + +## 数据过滤 + +* `DataAccessFilterLogic` - 数据过滤逻辑 + * `And` - 且 + * `Or` - 或 +* `DataAccessFilterRule` - 数据过滤规则 + * `Field` - 字段名 + * `Value` - 字段值 + * `Operate` - 操作符 + * `IsLeft` - 是否左括号 + +## 相关链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/README.EN.md b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..8d020b229 --- /dev/null +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/README.EN.md @@ -0,0 +1,105 @@ +# LINGYUN.Abp.DataProtection.EntityFrameworkCore + +Data protection EntityFramework Core implementation module + +## Interface Description + +* DisableDataProtectedAttribute: Automatically implements DataFilter.Disable() through interceptor, data filter will be disabled in the current scope + +## Important Notes + +* When using repository interfaces, try to avoid using *await GetDbSetAsync()* directly, use *await GetQueryableAsync()* instead, because due to the **DbSet** design pattern, it cannot be processed at the moment +* Your repository interface should inherit from **EfCoreDataProtectionRepository**, and your *DbContext* should inherit from **AbpDataProtectionDbContext** + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpDataProtectionEntityFrameworkCoreModule) + )] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Persist protected entity list + options.AddEntities(typeof(YouResource), new Type[] + { + typeof(YouProtectionObject), + }); + + // Format as follows + // options.AddEntities(typeof(IdentityResource), new Type[] + // { + // typeof(IdentityUser), + // typeof(IdentityRole), + // typeof(OrganizationUnit), + // }); + }); + } +} + +public class YouDbContext : AbpDataProtectionDbContext +{ + public DbSet ProtectionObjects { get; set; } + public YouDbContext( + DbContextOptions options) : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + modelBuilder.Entity(b => + { + // ... + }); + } +} + +public class EfCoreYouProtectionObjectRepository : + EfCoreDataProtectionRepository, + IYouProtectionObjectRepository +{ + protected IDataFilter DataFilter { get; } + public EfCoreYouProtectionObjectRepository( + [NotNull] IDbContextProvider dbContextProvider, + [NotNull] IDataAuthorizationService dataAuthorizationService, + [NotNull] IEntityTypeFilterBuilder entityTypeFilterBuilder, + IDataFilter dataFilter) + : base(dbContextProvider, dataAuthorizationService, entityTypeFilterBuilder) + { + DataFilter = dataFilter; + } + + // Get protected data list + public async virtual Task> GetProtectedListAsync() + { + return await (await GetQueryableAsync()) + .ToListAsync(); + } + + // Mark with DisableDataProtected to get all data list, automatically handle DataFilter.Disable() through interceptor + [DisableDataProtected] + public async virtual Task> GetUnProtectedListAsync() + { + return await (await GetQueryableAsync()) + .ToListAsync(); + } + + // Disable IDataProtected filter to get all data list (can be used anywhere) + public async virtual Task> GetUnProtectedByFilterListAsync() + { + using (DataFilter.Disable()) + { + return await (await GetQueryableAsync()) + .ToListAsync(); + } + } +} +``` + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/README.EN.md b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/README.EN.md new file mode 100644 index 000000000..845f1f646 --- /dev/null +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/README.EN.md @@ -0,0 +1,103 @@ +# LINGYUN.Abp.DataProtection + +Data protection implementation module, providing core implementation of data protection. + +## Features + +* Data Protection Interceptor - Automatically intercepts methods marked with data protection attributes +* Data Authorization Service - Provides data protection validation functionality +* Data Protection Resource Store - Provides in-memory storage implementation for data protection resources + +## Configuration + +```csharp +public class AbpDataProtectionOptions +{ + /// + /// Whether to enable data protection + /// Default: true + /// + public bool IsEnabled { get; set; } + + /// + /// List of data access subject contributors + /// + public IList SubjectContributors { get; } + + /// + /// Dictionary of data access keyword contributors + /// + public IDictionary KeywordContributors { get; } + + /// + /// Dictionary of data access operation contributors + /// + public IDictionary OperateContributors { get; } + + /// + /// List of ignored audit properties + /// Default includes: Id, LastModifierId, LastModificationTime, CreatorId, CreationTime, + /// IsDeleted, DeleterId, DeletionTime, TenantId, EntityVersion, + /// ConcurrencyStamp, ExtraProperties + /// + public IList IgnoreAuditedProperties { get; } +} +``` + +## Usage + +1. Configure Module + +```csharp +[DependsOn(typeof(AbpDataProtectionModule))] +public class YourModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Configure data protection options + options.IsEnabled = true; + + // Add custom subject contributor + options.SubjectContributors.Add(new YourSubjectContributor()); + + // Add custom keyword contributor + options.KeywordContributors.Add("your-keyword", new YourKeywordContributor()); + + // Add custom operation contributor + options.OperateContributors.Add(DataAccessFilterOperate.Equal, new YourOperateContributor()); + + // Add ignored audit property + options.IgnoreAuditedProperties.Add("YourProperty"); + }); + } +} +``` + +2. Use Data Protection Attributes + +```csharp +// Class level data protection control +[DataProtected] +public class YourService +{ + // Method level data protection control + [DataProtected] + public virtual Task GetAsync(Guid id) + { + // ... + } + + // Disable data protection control + [DisableDataProtected] + public virtual Task GetWithoutProtectionAsync(Guid id) + { + // ... + } +} +``` + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/README.md b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/README.md new file mode 100644 index 000000000..c92692d80 --- /dev/null +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/README.md @@ -0,0 +1,103 @@ +# LINGYUN.Abp.DataProtection + +数据权限实现模块,提供数据权限的核心实现。 + +## 功能 + +* 数据权限拦截器 - 自动拦截标记了数据权限特性的方法 +* 数据权限验证服务 - 提供数据权限验证功能 +* 数据权限资源存储 - 提供数据权限资源的内存存储实现 + +## 配置项 + +```csharp +public class AbpDataProtectionOptions +{ + /// + /// 是否启用数据权限 + /// 默认: true + /// + public bool IsEnabled { get; set; } + + /// + /// 数据权限主体提供者列表 + /// + public IList SubjectContributors { get; } + + /// + /// 数据权限关键字提供者字典 + /// + public IDictionary KeywordContributors { get; } + + /// + /// 数据权限操作提供者字典 + /// + public IDictionary OperateContributors { get; } + + /// + /// 忽略审计属性列表 + /// 默认包含:Id, LastModifierId, LastModificationTime, CreatorId, CreationTime, + /// IsDeleted, DeleterId, DeletionTime, TenantId, EntityVersion, + /// ConcurrencyStamp, ExtraProperties + /// + public IList IgnoreAuditedProperties { get; } +} +``` + +## 使用方式 + +1. 配置模块 + +```csharp +[DependsOn(typeof(AbpDataProtectionModule))] +public class YourModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // 配置数据权限选项 + options.IsEnabled = true; + + // 添加自定义主体提供者 + options.SubjectContributors.Add(new YourSubjectContributor()); + + // 添加自定义关键字提供者 + options.KeywordContributors.Add("your-keyword", new YourKeywordContributor()); + + // 添加自定义操作提供者 + options.OperateContributors.Add(DataAccessFilterOperate.Equal, new YourOperateContributor()); + + // 添加忽略的审计属性 + options.IgnoreAuditedProperties.Add("YourProperty"); + }); + } +} +``` + +2. 使用数据权限特性 + +```csharp +// 类级别的数据权限控制 +[DataProtected] +public class YourService +{ + // 方法级别的数据权限控制 + [DataProtected] + public virtual Task GetAsync(Guid id) + { + // ... + } + + // 禁用数据权限控制 + [DisableDataProtected] + public virtual Task GetWithoutProtectionAsync(Guid id) + { + // ... + } +} +``` + +## 相关链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.EN.md b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.EN.md new file mode 100644 index 000000000..b221cb6d1 --- /dev/null +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.EN.md @@ -0,0 +1,52 @@ +# LINGYUN.Abp.Dynamic.Queryable.Application.Contracts + +Dynamic query application service contract module, defining interfaces and DTOs related to dynamic querying. + +## Features + +* Defines dynamic query application service interface `IDynamicQueryableAppService` +* Provides DTO definitions for dynamic querying +* Supports parameter options and comparison operator definitions + +## Configuration and Usage + +1. Install the `LINGYUN.Abp.Dynamic.Queryable.Application.Contracts` NuGet package + +2. Add `[DependsOn(typeof(AbpDynamicQueryableApplicationContractsModule))]` to your module class + +### Interface Description + +```csharp +public interface IDynamicQueryableAppService +{ + // Get available fields list + Task> GetAvailableFieldsAsync(); + + // Query data based on dynamic conditions + Task> SearchAsync(GetListByDynamicQueryableInput dynamicInput); +} +``` + +### DTO Description + +* `DynamicParamterDto` - Dynamic parameter DTO + * `Name` - Field name + * `Type` - Field type + * `Description` - Field description + * `JavaScriptType` - JavaScript type + * `AvailableComparator` - Available comparison operators + * `Options` - Parameter options (for enum types) + +* `ParamterOptionDto` - Parameter option DTO + * `Key` - Option key + * `Value` - Option value + +* `GetListByDynamicQueryableInput` - Dynamic query input DTO + * `SkipCount` - Number of records to skip + * `MaxResultCount` - Maximum number of records to return + * `Queryable` - Query conditions + +## Related Links + +* [LINGYUN.Linq.Dynamic.Queryable](../LINGYUN.Linq.Dynamic.Queryable/README.EN.md) +* [LINGYUN.Abp.Dynamic.Queryable.Application](../LINGYUN.Abp.Dynamic.Queryable.Application/README.EN.md) diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.md b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.md new file mode 100644 index 000000000..294f7b216 --- /dev/null +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.md @@ -0,0 +1,52 @@ +# LINGYUN.Abp.Dynamic.Queryable.Application.Contracts + +动态查询应用服务契约模块,定义了动态查询相关的接口和DTO。 + +## 功能特性 + +* 定义动态查询应用服务接口 `IDynamicQueryableAppService` +* 提供动态查询相关的DTO定义 +* 支持参数选项和比较运算符的定义 + +## 配置使用 + +1. 安装 `LINGYUN.Abp.Dynamic.Queryable.Application.Contracts` NuGet包 + +2. 添加 `[DependsOn(typeof(AbpDynamicQueryableApplicationContractsModule))]` 到你的模块类 + +### 接口说明 + +```csharp +public interface IDynamicQueryableAppService +{ + // 获取可用字段列表 + Task> GetAvailableFieldsAsync(); + + // 根据动态条件查询数据 + Task> SearchAsync(GetListByDynamicQueryableInput dynamicInput); +} +``` + +### DTO说明 + +* `DynamicParamterDto` - 动态参数DTO + * `Name` - 字段名称 + * `Type` - 字段类型 + * `Description` - 字段描述 + * `JavaScriptType` - JavaScript类型 + * `AvailableComparator` - 可用的比较运算符 + * `Options` - 参数选项(用于枚举类型) + +* `ParamterOptionDto` - 参数选项DTO + * `Key` - 选项键 + * `Value` - 选项值 + +* `GetListByDynamicQueryableInput` - 动态查询输入DTO + * `SkipCount` - 跳过记录数 + * `MaxResultCount` - 最大返回记录数 + * `Queryable` - 查询条件 + +## 相关链接 + +* [LINGYUN.Linq.Dynamic.Queryable](../LINGYUN.Linq.Dynamic.Queryable/README.md) +* [LINGYUN.Abp.Dynamic.Queryable.Application](../LINGYUN.Abp.Dynamic.Queryable.Application/README.md) diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/README.EN.md b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/README.EN.md new file mode 100644 index 000000000..fb5f14cc8 --- /dev/null +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/README.EN.md @@ -0,0 +1,76 @@ +# LINGYUN.Abp.Dynamic.Queryable.Application + +Dynamic query application service module, providing dynamic query functionality implementation based on the ABP framework. + +## Features + +* Provides dynamic query application service base class `DynamicQueryableAppService` +* Automatically generates available field list with localization support +* Supports field filtering and ignoring +* Supports enum type option list generation + +## Configuration and Usage + +1. Install the `LINGYUN.Abp.Dynamic.Queryable.Application` NuGet package + +2. Add `[DependsOn(typeof(AbpDynamicQueryableApplicationModule))]` to your module class + +3. Configure options (optional) + +```csharp +Configure(options => +{ + // Add fields to ignore + options.IgnoreFields.Add("FieldName"); +}); +``` + +### Implementing Dynamic Query Service + +```csharp +public class MyEntityAppService : DynamicQueryableAppService +{ + private readonly IRepository _repository; + + public MyEntityAppService(IRepository repository) + { + _repository = repository; + } + + protected override async Task GetCountAsync(Expression> condition) + { + return await _repository.CountAsync(condition); + } + + protected override async Task> GetListAsync( + Expression> condition, + GetListByDynamicQueryableInput dynamicInput) + { + return await _repository + .Where(condition) + .PageBy(dynamicInput.SkipCount, dynamicInput.MaxResultCount) + .ToListAsync(); + } + + protected override List MapToEntitiesDto(List entities) + { + return ObjectMapper.Map, List>(entities); + } + + // Custom fields to ignore (optional) + protected override IEnumerable GetUserDefineIgnoreFields() + { + return new[] { "CustomField" }; + } +} +``` + +### Configuration Options + +* `IgnoreFields` - List of fields to ignore in queries + * Defaults include: Id, TenantId, IsDeleted, DeleterId, DeletionTime and other audit fields + +## Related Links + +* [LINGYUN.Linq.Dynamic.Queryable](../LINGYUN.Linq.Dynamic.Queryable/README.EN.md) +* [LINGYUN.Abp.Dynamic.Queryable.Application.Contracts](../LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.EN.md) diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/README.md b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/README.md new file mode 100644 index 000000000..679c0d3b3 --- /dev/null +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/README.md @@ -0,0 +1,76 @@ +# LINGYUN.Abp.Dynamic.Queryable.Application + +动态查询应用服务模块,提供基于ABP框架的动态查询功能实现。 + +## 功能特性 + +* 提供动态查询应用服务基类 `DynamicQueryableAppService` +* 自动生成可用字段列表,支持字段本地化 +* 支持字段过滤和忽略 +* 支持枚举类型的选项列表生成 + +## 配置使用 + +1. 安装 `LINGYUN.Abp.Dynamic.Queryable.Application` NuGet包 + +2. 添加 `[DependsOn(typeof(AbpDynamicQueryableApplicationModule))]` 到你的模块类 + +3. 配置选项(可选) + +```csharp +Configure(options => +{ + // 添加需要忽略的字段 + options.IgnoreFields.Add("FieldName"); +}); +``` + +### 实现动态查询服务 + +```csharp +public class MyEntityAppService : DynamicQueryableAppService +{ + private readonly IRepository _repository; + + public MyEntityAppService(IRepository repository) + { + _repository = repository; + } + + protected override async Task GetCountAsync(Expression> condition) + { + return await _repository.CountAsync(condition); + } + + protected override async Task> GetListAsync( + Expression> condition, + GetListByDynamicQueryableInput dynamicInput) + { + return await _repository + .Where(condition) + .PageBy(dynamicInput.SkipCount, dynamicInput.MaxResultCount) + .ToListAsync(); + } + + protected override List MapToEntitiesDto(List entities) + { + return ObjectMapper.Map, List>(entities); + } + + // 自定义需要忽略的字段(可选) + protected override IEnumerable GetUserDefineIgnoreFields() + { + return new[] { "CustomField" }; + } +} +``` + +### 配置项说明 + +* `IgnoreFields` - 需要在查询中忽略的字段列表 + * 默认包含:Id、TenantId、IsDeleted、DeleterId、DeletionTime等审计字段 + +## 相关链接 + +* [LINGYUN.Linq.Dynamic.Queryable](../LINGYUN.Linq.Dynamic.Queryable/README.md) +* [LINGYUN.Abp.Dynamic.Queryable.Application.Contracts](../LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.md) diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/README.EN.md b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/README.EN.md new file mode 100644 index 000000000..605de7d61 --- /dev/null +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Dynamic.Queryable.HttpApi + +Dynamic query HTTP API module, providing HTTP API implementation for dynamic querying based on the ABP framework. + +## Features + +* Provides dynamic query controller base class `DynamicQueryableControllerBase` +* Automatically generates REST API endpoints +* Supports HTTP transport of dynamic query parameters + +## Configuration and Usage + +1. Install the `LINGYUN.Abp.Dynamic.Queryable.HttpApi` NuGet package + +2. Add `[DependsOn(typeof(AbpDynamicQueryableHttpApiModule))]` to your module class + +### Implementing Dynamic Query Controller + +```csharp +[Route("api/my-entity")] +public class MyEntityController : DynamicQueryableControllerBase +{ + public MyEntityController(IDynamicQueryableAppService dynamicQueryableAppService) + : base(dynamicQueryableAppService) + { + } +} +``` + +### API Endpoints + +* GET `/api/my-entity/available-fields` - Get available fields list +* POST `/api/my-entity/search` - Query data based on dynamic conditions + +### Query Example + +```json +POST /api/my-entity/search +{ + "maxResultCount": 10, + "skipCount": 0, + "queryable": { + "paramters": [ + { + "field": "Name", + "comparison": "Equal", + "value": "test" + } + ] + } +} +``` + +## Related Links + +* [LINGYUN.Linq.Dynamic.Queryable](../LINGYUN.Linq.Dynamic.Queryable/README.EN.md) +* [LINGYUN.Abp.Dynamic.Queryable.Application](../LINGYUN.Abp.Dynamic.Queryable.Application/README.EN.md) +* [LINGYUN.Abp.Dynamic.Queryable.Application.Contracts](../LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.EN.md) diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/README.md b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/README.md new file mode 100644 index 000000000..031934aab --- /dev/null +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Dynamic.Queryable.HttpApi + +动态查询HTTP API模块,提供基于ABP框架的动态查询HTTP API实现。 + +## 功能特性 + +* 提供动态查询控制器基类 `DynamicQueryableControllerBase` +* 自动生成REST API端点 +* 支持动态查询参数的HTTP传输 + +## 配置使用 + +1. 安装 `LINGYUN.Abp.Dynamic.Queryable.HttpApi` NuGet包 + +2. 添加 `[DependsOn(typeof(AbpDynamicQueryableHttpApiModule))]` 到你的模块类 + +### 实现动态查询控制器 + +```csharp +[Route("api/my-entity")] +public class MyEntityController : DynamicQueryableControllerBase +{ + public MyEntityController(IDynamicQueryableAppService dynamicQueryableAppService) + : base(dynamicQueryableAppService) + { + } +} +``` + +### API端点 + +* GET `/api/my-entity/available-fields` - 获取可用字段列表 +* POST `/api/my-entity/search` - 根据动态条件查询数据 + +### 查询示例 + +```json +POST /api/my-entity/search +{ + "maxResultCount": 10, + "skipCount": 0, + "queryable": { + "paramters": [ + { + "field": "Name", + "comparison": "Equal", + "value": "test" + } + ] + } +} +``` + +## 相关链接 + +* [LINGYUN.Linq.Dynamic.Queryable](../LINGYUN.Linq.Dynamic.Queryable/README.md) +* [LINGYUN.Abp.Dynamic.Queryable.Application](../LINGYUN.Abp.Dynamic.Queryable.Application/README.md) +* [LINGYUN.Abp.Dynamic.Queryable.Application.Contracts](../LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/README.md) diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/README.EN.md b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/README.EN.md new file mode 100644 index 000000000..d6099ee18 --- /dev/null +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Linq.Dynamic.Queryable + +A basic library for dynamic querying, extending Linq to dynamically build expression trees. + +## Features + +* Support for dynamic query condition building +* Support for various comparison operators: equal, not equal, greater than, less than, greater than or equal, less than or equal, contains, not contains, starts with, not starts with, ends with, not ends with, etc. +* Support for dynamic type conversion and null value handling +* Support for dynamic querying of enum types + +## Configuration and Usage + +The module can be referenced as needed, providing extensions only for Linq. + +### Basic Usage + +```csharp +// Create dynamic query parameter +var parameter = new DynamicParamter +{ + Field = "Name", + Comparison = DynamicComparison.Equal, + Value = "test" +}; + +// Create query condition +var queryable = new DynamicQueryable +{ + Paramters = new List { parameter } +}; + +// Apply to Expression +Expression> condition = e => true; +condition = condition.DynamicQuery(queryable); + +// Query using the condition +var result = await repository.Where(condition).ToListAsync(); +``` + +### Supported Comparison Operators + +* `Equal` - Equals +* `NotEqual` - Not equals +* `LessThan` - Less than +* `LessThanOrEqual` - Less than or equal to +* `GreaterThan` - Greater than +* `GreaterThanOrEqual` - Greater than or equal to +* `Contains` - Contains +* `NotContains` - Does not contain +* `StartsWith` - Starts with +* `NotStartsWith` - Does not start with +* `EndsWith` - Ends with +* `NotEndsWith` - Does not end with + +## Related Links + +* [LINGYUN.Abp.Dynamic.Queryable.Application](../LINGYUN.Abp.Dynamic.Queryable.Application/README.EN.md) diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/README.md b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/README.md index 5ef0300a2..0d277f230 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/README.md +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/README.md @@ -2,11 +2,57 @@ 动态查询基本库, 扩展Linq, 动态构建表达式树 +## 功能特性 + +* 支持动态构建查询条件 +* 支持多种比较运算符:等于、不等于、大于、小于、大于等于、小于等于、包含、不包含、开始于、不开始于、结束于、不结束于等 +* 支持动态类型转换和空值处理 +* 支持枚举类型的动态查询 + ## 配置使用 -模块按需引用, 只提供针对Linq的扩展 +模块按需引用, 只提供针对Linq的扩展。 + +### 基本用法 ```csharp +// 创建动态查询参数 +var parameter = new DynamicParamter +{ + Field = "Name", + Comparison = DynamicComparison.Equal, + Value = "test" +}; + +// 创建查询条件 +var queryable = new DynamicQueryable +{ + Paramters = new List { parameter } +}; +// 应用到Expression +Expression> condition = e => true; +condition = condition.DynamicQuery(queryable); + +// 使用条件进行查询 +var result = await repository.Where(condition).ToListAsync(); ``` +### 支持的比较运算符 + +* `Equal` - 等于 +* `NotEqual` - 不等于 +* `LessThan` - 小于 +* `LessThanOrEqual` - 小于等于 +* `GreaterThan` - 大于 +* `GreaterThanOrEqual` - 大于等于 +* `Contains` - 包含 +* `NotContains` - 不包含 +* `StartsWith` - 开始于 +* `NotStartsWith` - 不开始于 +* `EndsWith` - 结束于 +* `NotEndsWith` - 不结束于 + +## 相关链接 + +* [LINGYUN.Abp.Dynamic.Queryable.Application](../LINGYUN.Abp.Dynamic.Queryable.Application/README.md) diff --git a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.EN.md b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.EN.md new file mode 100644 index 000000000..23fd47947 --- /dev/null +++ b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.EN.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.Elasticsearch + +[简体中文](./README.md) | English + +Abp Elasticsearch integration module, providing a global singleton IElasticClient interface for access. + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpElasticsearchModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Options + +* AbpElasticsearchOptions.FieldCamelCase Whether fields use camelCase format, default is false +* AbpElasticsearchOptions.NodeUris ES endpoints, multiple endpoints separated by , or ; +* AbpElasticsearchOptions.TypeName Document type name, default is _doc +* AbpElasticsearchOptions.ConnectionLimit Maximum connection limit, see NEST documentation for details +* AbpElasticsearchOptions.UserName Connection username, see NEST documentation for details +* AbpElasticsearchOptions.Password User password, see NEST documentation for details +* AbpElasticsearchOptions.ConnectionTimeout Connection timeout, see NEST documentation for details + +## appsettings.json + +```json +{ + "Elasticsearch": { + "NodeUris": "http://localhost:9200" + } +} +``` + +## Features + +* Provides a global singleton IElasticClient interface for unified Elasticsearch access +* Supports multiple node configurations for cluster deployment +* Supports basic authentication +* Configurable field naming convention (camelCase) +* Customizable connection settings including timeout and connection limits +* Compatible with NEST client features diff --git a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.md b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.md index 240b6b431..fdaa94153 100644 --- a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.md +++ b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.md @@ -1,5 +1,7 @@ # LINGYUN.Abp.Elasticsearch +简体中文 | [English](./README.EN.md) + Abp Elasticsearch集成,提供全局唯一IElasticClient访问接口 ## 模块引用 @@ -30,6 +32,4 @@ public class YouProjectModule : AbpModule "Elasticsearch": { "NodeUris": "http://localhost:9200" } -} - -``` \ No newline at end of file +} \ No newline at end of file diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/README.EN.md b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/README.EN.md new file mode 100644 index 000000000..c725c1708 --- /dev/null +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/README.EN.md @@ -0,0 +1,42 @@ +# LINGYUN.Abp.EntityChange.Application.Contracts + +Application contracts module for entity change tracking and restoration. + +## Features + +* Provides entity change query interface +* Provides entity restoration interface +* Provides entity change related DTOs +* Provides multilingual localization resources + +## Basic Usage + +```csharp +[DependsOn(typeof(AbpEntityChangeApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // ... + } +} +``` + +## API + +* `IEntityChangeAppService`: Entity change query service interface + * `GetListAsync`: Get list of entity change history records + +* `IEntityRestoreAppService`: Entity restoration service interface + * `RestoreEntityAsync`: Restore a single entity to specified version + * `RestoreEntitesAsync`: Batch restore entities to specified versions + +## Localization + +The module provides localization resources in the following languages: +* en +* zh-Hans + +Localization resources are located in the `/LINGYUN/Abp/EntityChange/Localization/Resources` directory. + +[简体中文](./README.md) diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/README.md b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/README.md new file mode 100644 index 000000000..d6dbf87ec --- /dev/null +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/README.md @@ -0,0 +1,42 @@ +# LINGYUN.Abp.EntityChange.Application.Contracts + +实体变更追踪与恢复的应用层契约模块。 + +## 功能 + +* 提供实体变更查询接口 +* 提供实体恢复接口 +* 提供实体变更相关DTO对象 +* 提供多语言本地化资源 + +## 基本用法 + +```csharp +[DependsOn(typeof(AbpEntityChangeApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // ... + } +} +``` + +## API + +* `IEntityChangeAppService`: 实体变更查询服务接口 + * `GetListAsync`: 获取实体变更历史记录列表 + +* `IEntityRestoreAppService`: 实体恢复服务接口 + * `RestoreEntityAsync`: 恢复单个实体到指定版本 + * `RestoreEntitesAsync`: 批量恢复实体到指定版本 + +## 本地化 + +模块提供了以下语言的本地化资源: +* en +* zh-Hans + +本地化资源位于 `/LINGYUN/Abp/EntityChange/Localization/Resources` 目录下。 + +[English](./README.EN.md) diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/README.EN.md b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/README.EN.md new file mode 100644 index 000000000..ea1ab1a2b --- /dev/null +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/README.EN.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.EntityChange.Application + +Application layer implementation module for entity change tracking and restoration. + +## Features + +* Implements entity change query service +* Implements entity restoration service +* Provides auto mapping configuration for entity changes + +## Basic Usage + +```csharp +[DependsOn(typeof(AbpEntityChangeApplicationModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // ... + } +} +``` + +## Service Implementation + +* `EntityRestoreAppService`: Entity restoration service implementation + * `RestoreEntityAsync`: Restore a single entity to specified version through audit log + * `RestoreEntitesAsync`: Batch restore entities to specified versions through audit log + * Supports restoration permission policy configuration via `RestorePolicy` + +## Object Mapping + +The module uses AutoMapper to implement automatic mapping for the following objects: +* `EntityPropertyChange` -> `EntityPropertyChangeDto` +* `EntityChange` -> `EntityChangeDto` + +[简体中文](./README.md) diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/README.md b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/README.md new file mode 100644 index 000000000..054c5e98b --- /dev/null +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/README.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.EntityChange.Application + +实体变更追踪与恢复的应用层实现模块。 + +## 功能 + +* 实现实体变更查询服务 +* 实现实体恢复服务 +* 提供实体变更的自动映射配置 + +## 基本用法 + +```csharp +[DependsOn(typeof(AbpEntityChangeApplicationModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // ... + } +} +``` + +## 服务实现 + +* `EntityRestoreAppService`: 实体恢复服务实现 + * `RestoreEntityAsync`: 通过审计日志恢复单个实体到指定版本 + * `RestoreEntitesAsync`: 通过审计日志批量恢复实体到指定版本 + * 支持通过 `RestorePolicy` 配置恢复权限策略 + +## 对象映射 + +模块使用AutoMapper实现以下对象的自动映射: +* `EntityPropertyChange` -> `EntityPropertyChangeDto` +* `EntityChange` -> `EntityChangeDto` + +[English](./README.EN.md) diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/README.EN.md b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/README.EN.md new file mode 100644 index 000000000..9df353073 --- /dev/null +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/README.EN.md @@ -0,0 +1,39 @@ +# LINGYUN.Abp.EntityChange.HttpApi + +HTTP API module for entity change tracking and restoration. + +## Features + +* Provides HTTP API for entity change queries +* Provides HTTP API for entity restoration +* Supports multilingual localization + +## Basic Usage + +```csharp +[DependsOn(typeof(AbpEntityChangeHttpApiModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // ... + } +} +``` + +## API Endpoints + +* `EntityChangeController`: Entity change controller + * GET `/api/entity-changes`: Get list of entity change history records + +* `EntityRestoreController`: Entity restoration controller + * PUT `/api/entity-restore`: Restore a single entity to specified version + * PUT `/api/{EntityId}/entity-restore`: Restore entity with specified ID + * PUT `/api/{EntityId}/v/{EntityChangeId}/entity-restore`: Restore entity with specified ID to specified version + * PUT `/api/entites-restore`: Batch restore entities to specified versions + +## Localization + +The module uses `AbpEntityChangeResource` as localization resource, supporting multilingual display. + +[简体中文](./README.md) diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/README.md b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/README.md new file mode 100644 index 000000000..e3d276541 --- /dev/null +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/README.md @@ -0,0 +1,39 @@ +# LINGYUN.Abp.EntityChange.HttpApi + +实体变更追踪与恢复的HTTP API模块。 + +## 功能 + +* 提供实体变更查询的HTTP API +* 提供实体恢复的HTTP API +* 支持多语言本地化 + +## 基本用法 + +```csharp +[DependsOn(typeof(AbpEntityChangeHttpApiModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // ... + } +} +``` + +## API端点 + +* `EntityChangeController`: 实体变更控制器 + * GET `/api/entity-changes`: 获取实体变更历史记录列表 + +* `EntityRestoreController`: 实体恢复控制器 + * PUT `/api/entity-restore`: 恢复单个实体到指定版本 + * PUT `/api/{EntityId}/entity-restore`: 恢复指定ID的实体 + * PUT `/api/{EntityId}/v/{EntityChangeId}/entity-restore`: 恢复指定ID的实体到指定版本 + * PUT `/api/entites-restore`: 批量恢复实体到指定版本 + +## 本地化 + +模块使用 `AbpEntityChangeResource` 作为本地化资源,支持多语言显示。 + +[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) diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/README.EN.md b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/README.EN.md new file mode 100644 index 000000000..6b5ff2d54 --- /dev/null +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/README.EN.md @@ -0,0 +1,86 @@ +# LINGYUN.Abp.AspNetCore.Mvc.Localization + +ABP framework localization management module, providing Web API interfaces for localization resources. + +## Features + +* Provides localization text management API interfaces +* Supports multi-language resource querying and comparison +* Supports filtering by resource name and culture name +* Supports integration of external localization resources +* Supports localization resource difference comparison + +## Installation + +```bash +dotnet add package LINGYUN.Abp.AspNetCore.Mvc.Localization +``` + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAspNetCoreMvcLocalizationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Endpoints + +### Language Management + +* GET /api/localization/languages - Get all available languages +* GET /api/localization/languages/{cultureName} - Get specific language information + +### Resource Management + +* GET /api/localization/resources - Get all localization resources +* GET /api/localization/resources/{name} - Get specific localization resource + +### Text Management + +* GET /api/localization/texts - Get localization text list +* GET /api/localization/texts/by-key - Get localization text by key +* GET /api/localization/texts/differences - Get text differences between languages + +## Basic Usage + +1. Configure localization resources +```csharp +Configure(options => +{ + options.Resources + .Get() + .AddVirtualJson("/Your/Resource/Path"); +}); +``` + +2. Inject and use the service +```csharp +public class YourService +{ + private readonly ITextAppService _textAppService; + + public YourService(ITextAppService textAppService) + { + _textAppService = textAppService; + } + + public async Task GetLocalizedText(string key, string cultureName) + { + var text = await _textAppService.GetByCultureKeyAsync(new GetTextByKeyInput + { + Key = key, + CultureName = cultureName, + ResourceName = "YourResourceName" + }); + // Use the localized text + } +} +``` + +## More Information + +* [中文文档](./README.md) +* [ABP Localization Documentation](https://docs.abp.io/en/abp/latest/Localization) diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/README.md b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/README.md new file mode 100644 index 000000000..4b3c2fbba --- /dev/null +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/README.md @@ -0,0 +1,86 @@ +# LINGYUN.Abp.AspNetCore.Mvc.Localization + +ABP框架本地化管理模块,提供本地化资源的Web API接口。 + +## 功能特性 + +* 提供本地化文本管理API接口 +* 支持多语言资源的查询和比较 +* 支持按资源名称和文化名称过滤 +* 支持外部本地化资源的集成 +* 支持本地化资源的差异对比 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.AspNetCore.Mvc.Localization +``` + +## 模块依赖 + +```csharp +[DependsOn(typeof(AbpAspNetCoreMvcLocalizationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API接口 + +### 语言管理 + +* GET /api/localization/languages - 获取所有可用语言 +* GET /api/localization/languages/{cultureName} - 获取指定语言信息 + +### 资源管理 + +* GET /api/localization/resources - 获取所有本地化资源 +* GET /api/localization/resources/{name} - 获取指定本地化资源 + +### 文本管理 + +* GET /api/localization/texts - 获取本地化文本列表 +* GET /api/localization/texts/by-key - 根据键获取本地化文本 +* GET /api/localization/texts/differences - 获取不同语言间的文本差异 + +## 基本用法 + +1. 配置本地化资源 +```csharp +Configure(options => +{ + options.Resources + .Get() + .AddVirtualJson("/Your/Resource/Path"); +}); +``` + +2. 注入并使用服务 +```csharp +public class YourService +{ + private readonly ITextAppService _textAppService; + + public YourService(ITextAppService textAppService) + { + _textAppService = textAppService; + } + + public async Task GetLocalizedText(string key, string cultureName) + { + var text = await _textAppService.GetByCultureKeyAsync(new GetTextByKeyInput + { + Key = key, + CultureName = cultureName, + ResourceName = "YourResourceName" + }); + // Use the localized text + } +} +``` + +## 更多信息 + +* [English Documentation](./README.EN.md) +* [ABP本地化文档](https://docs.abp.io/zh-Hans/abp/latest/Localization) diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/README.EN.md b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/README.EN.md new file mode 100644 index 000000000..e0d61f886 --- /dev/null +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/README.EN.md @@ -0,0 +1,93 @@ +# LINGYUN.Abp.Localization.CultureMap + +## Module Description + +This module solves localization issues with multiple culture format variants. It allows you to map different culture format identifiers to a standard format. + +Reference Project: [Owl.Abp.CultureMap](https://github.com/maliming/Owl.Abp.CultureMap) + +## Features + +* Support mapping multiple culture format identifiers to standard format +* Support independent mapping for Culture and UICulture +* Integration with ABP request localization +* Support custom culture mapping rules + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Localization.CultureMap +``` + +## Base Modules + +* Volo.Abp.AspNetCore + +## Configuration + +The module provides the following configuration options: + +* CulturesMaps: List of culture mappings +* UiCulturesMaps: List of UI culture mappings + +Each mapping item contains: +* TargetCulture: Target culture identifier +* SourceCultures: List of source culture identifiers + +## Usage + +1. Add module dependency: + +```csharp +[DependsOn( + typeof(AbpLocalizationCultureMapModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + var zhHansCultureMapInfo = new CultureMapInfo + { + TargetCulture = "zh-Hans", + SourceCultures = new string[] { "zh", "zh_CN", "zh-CN" } + }; + + options.CulturesMaps.Add(zhHansCultureMapInfo); + options.UiCulturesMaps.Add(zhHansCultureMapInfo); + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + + app.UseMapRequestLocalization(); + } +} +``` + +## Common Use Cases + +1. Unify Simplified Chinese culture identifiers: +```csharp +options.CulturesMaps.Add(new CultureMapInfo +{ + TargetCulture = "zh-Hans", + SourceCultures = new string[] { "zh", "zh_CN", "zh-CN" } +}); +``` + +2. Unify Traditional Chinese culture identifiers: +```csharp +options.CulturesMaps.Add(new CultureMapInfo +{ + TargetCulture = "zh-Hant", + SourceCultures = new string[] { "zh_TW", "zh-TW", "zh_HK", "zh-HK" } +}); +``` + +## More Information + +* [中文文档](./README.md) +* [ABP Localization Documentation](https://docs.abp.io/en/abp/latest/Localization) diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/README.md b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/README.md index 945c6cf07..aa7b2b2f4 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/README.md +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/README.md @@ -2,52 +2,94 @@ ## 模块说明 -解决存在多种格式的区域性本地化问题 +本模块用于解决存在多种格式的区域性本地化问题。它允许你将不同格式的区域性标识映射到标准格式。 -See: https://github.com/maliming/Owl.Abp.CultureMap +参考项目: [Owl.Abp.CultureMap](https://github.com/maliming/Owl.Abp.CultureMap) -### 基础模块 +## 功能特性 -### 高阶模块 +* 支持将多种格式的区域性标识映射到标准格式 +* 支持区域性(Culture)和UI区域性(UICulture)的独立映射 +* 与ABP请求本地化集成 +* 支持自定义区域性映射规则 -### 权限定义 +## 安装 -### 功能定义 +```bash +dotnet add package LINGYUN.Abp.Localization.CultureMap +``` -### 配置定义 +## 基础模块 -### 如何使用 +* Volo.Abp.AspNetCore +## 配置说明 -```csharp +模块提供了以下配置选项: + +* CulturesMaps:区域性映射列表 +* UiCulturesMaps:UI区域性映射列表 + +每个映射项包含: +* TargetCulture:目标区域性标识 +* SourceCultures:源区域性标识列表 + +## 使用方法 - [DependsOn( - typeof(AbpLocalizationCultureMapModule))] - public class YouProjectModule : AbpModule +1. 添加模块依赖: + +```csharp +[DependsOn( + typeof(AbpLocalizationCultureMapModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => + var zhHansCultureMapInfo = new CultureMapInfo { - var zhHansCultureMapInfo = new CultureMapInfo - { - TargetCulture = "zh-Hans", - SourceCultures = new string[] { "zh", "zh_CN", "zh-CN" } - }; - - options.CulturesMaps.Add(zhHansCultureMapInfo); - options.UiCulturesMaps.Add(zhHansCultureMapInfo); - }); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - var app = context.GetApplicationBuilder(); + TargetCulture = "zh-Hans", + SourceCultures = new string[] { "zh", "zh_CN", "zh-CN" } + }; + + options.CulturesMaps.Add(zhHansCultureMapInfo); + options.UiCulturesMaps.Add(zhHansCultureMapInfo); + }); + } - app.UseMapRequestLocalization(); - } + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + + app.UseMapRequestLocalization(); } +} +``` + +## 常见用例 + +1. 统一简体中文区域性标识: +```csharp +options.CulturesMaps.Add(new CultureMapInfo +{ + TargetCulture = "zh-Hans", + SourceCultures = new string[] { "zh", "zh_CN", "zh-CN" } +}); +``` +2. 统一繁体中文区域性标识: +```csharp +options.CulturesMaps.Add(new CultureMapInfo +{ + TargetCulture = "zh-Hant", + SourceCultures = new string[] { "zh_TW", "zh-TW", "zh_HK", "zh-HK" } +}); ``` -### 更新日志 +## 更多信息 + +* [English Documentation](./README.EN.md) +* [ABP本地化文档](https://docs.abp.io/zh-Hans/abp/latest/Localization) + +## 更新日志 diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/README.EN.md b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/README.EN.md new file mode 100644 index 000000000..283966395 --- /dev/null +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/README.EN.md @@ -0,0 +1,129 @@ +# LINGYUN.Abp.Localization.Persistence + +## Module Description + +Localization component persistence module, providing functionality to persist localization resources to storage facilities. This module allows you to save static localization documents to persistent storage for easier management and maintenance. + +## Features + +* Support persisting static localization resources to storage facilities +* Provide read and write interfaces for localization resources +* Support custom persistence storage implementation +* Support asynchronous read and write operations +* Support multi-language culture support +* Support selective persistence of specified resources + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Localization.Persistence +``` + +## Base Modules + +* Volo.Abp.Localization + +## Configuration + +The module provides the following configuration options: + +* SaveStaticLocalizationsToPersistence: Whether to enable localization resource persistence (default: true) +* SaveToPersistenceResources: List of resources to be persisted + +## Usage + +1. Add module dependency: + +```csharp +[DependsOn( + typeof(AbpLocalizationPersistenceModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Enable persistence facility + options.SaveStaticLocalizationsToPersistence = true; + + // Specify your localization resource type, static documents under this type will be persisted to storage facilities + options.AddPersistenceResource(); + }); + + // Or use extension method to persist localization resource type + Configure(options => + { + // Same effect as above + options.UsePersistence(); + }); + } +} +``` + +## Extension Interfaces + +### ILocalizationPersistenceReader + +Used to read localization resources from persistent storage: + +```csharp +public interface ILocalizationPersistenceReader +{ + // Get localized string for specified resource + LocalizedString GetOrNull(string resourceName, string cultureName, string name); + + // Fill localization dictionary + void Fill(string resourceName, string cultureName, Dictionary dictionary); + + // Asynchronously fill localization dictionary + Task FillAsync(string resourceName, string cultureName, Dictionary dictionary); + + // Get supported cultures list + Task> GetSupportedCulturesAsync(); +} +``` + +### ILocalizationPersistenceWriter + +Used to write localization resources to persistent storage: + +```csharp +public interface ILocalizationPersistenceWriter +{ + // Write language information + Task WriteLanguageAsync(LanguageInfo language); + + // Write resource information + Task WriteResourceAsync(LocalizationResourceBase resource); + + // Get existing texts + Task> GetExistsTextsAsync( + string resourceName, + string cultureName, + IEnumerable keys); + + // Write localization texts + Task WriteTextsAsync(IEnumerable texts); +} +``` + +## Custom Persistence Implementation + +To implement custom persistence storage, you need to: + +1. Implement `ILocalizationPersistenceReader` interface +2. Implement `ILocalizationPersistenceWriter` interface +3. Register your implementation in the module: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddTransient(); + context.Services.AddTransient(); +} +``` + +## More Information + +* [中文文档](./README.md) +* [ABP Localization Documentation](https://docs.abp.io/en/abp/latest/Localization) diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/README.md b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/README.md index 10508a7a3..f6a30128b 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/README.md +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/README.md @@ -2,47 +2,128 @@ ## 模块说明 -本地化组件持久层模块, 引用模块可将需要的本地化文档持久化到存储设施 +本地化组件持久层模块,提供将本地化资源持久化到存储设施的功能。此模块允许你将静态本地化文档保存到持久化存储中,方便管理和维护。 -### 基础模块 +## 功能特性 -### 高阶模块 +* 支持将静态本地化资源持久化到存储设施 +* 提供本地化资源的读写接口 +* 支持自定义持久化存储实现 +* 支持异步读写操作 +* 支持多语言文化支持 +* 支持选择性持久化指定的资源 -### 权限定义 +## 安装 -### 功能定义 +```bash +dotnet add package LINGYUN.Abp.Localization.Persistence +``` -### 配置定义 +## 基础模块 -### 如何使用 +* Volo.Abp.Localization +## 配置说明 -```csharp +模块提供以下配置选项: + +* SaveStaticLocalizationsToPersistence:是否启用本地化资源持久化(默认:true) +* SaveToPersistenceResources:需要持久化的资源列表 + +## 使用方法 - [DependsOn( - typeof(AbpLocalizationPersistenceModule))] - public class YouProjectModule : AbpModule +1. 添加模块依赖: + +```csharp +[DependsOn( + typeof(AbpLocalizationPersistenceModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => + { + // 启用持久化设施 + options.SaveStaticLocalizationsToPersistence = true; + + // 指定你的本地化资源类型, 此类型下定义的静态文档将被持久化到存储设施 + options.AddPersistenceResource(); + }); + + // 或者使用扩展方法持久化本地化资源类型 + Configure(options => { - Configure(options => - { - // 启用持久化设施 - options.SaveStaticLocalizationsToPersistence = true; - - // 指定你的本地化资源类型, 此类型下定义的静态文档将被持久化到存储设施 - options.AddPersistenceResource(); - }); - - // 或者使用扩展方法持久化本地化资源类型 - Configure(options => - { - // 效果如上 - options.UsePersistence(); - }); - } + // 效果如上 + options.UsePersistence(); + }); } +} +``` + +## 扩展接口 + +### ILocalizationPersistenceReader + +用于从持久化存储中读取本地化资源: + +```csharp +public interface ILocalizationPersistenceReader +{ + // 获取指定资源的本地化字符串 + LocalizedString GetOrNull(string resourceName, string cultureName, string name); + + // 填充本地化字典 + void Fill(string resourceName, string cultureName, Dictionary dictionary); + // 异步填充本地化字典 + Task FillAsync(string resourceName, string cultureName, Dictionary dictionary); + + // 获取支持的文化列表 + Task> GetSupportedCulturesAsync(); +} +``` + +### ILocalizationPersistenceWriter + +用于将本地化资源写入持久化存储: + +```csharp +public interface ILocalizationPersistenceWriter +{ + // 写入语言信息 + Task WriteLanguageAsync(LanguageInfo language); + + // 写入资源信息 + Task WriteResourceAsync(LocalizationResourceBase resource); + + // 获取已存在的文本 + Task> GetExistsTextsAsync( + string resourceName, + string cultureName, + IEnumerable keys); + + // 写入本地化文本 + Task WriteTextsAsync(IEnumerable texts); +} +``` + +## 自定义持久化实现 + +要实现自定义的持久化存储,需要: + +1. 实现 `ILocalizationPersistenceReader` 接口 +2. 实现 `ILocalizationPersistenceWriter` 接口 +3. 在模块中注册你的实现: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddTransient(); + context.Services.AddTransient(); +} ``` -### 更新日志 +## 更多信息 + +* [English Documentation](./README.EN.md) +* [ABP本地化文档](https://docs.abp.io/zh-Hans/abp/latest/Localization) diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/README.EN.md b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/README.EN.md new file mode 100644 index 000000000..6ca8da7c0 --- /dev/null +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/README.EN.md @@ -0,0 +1,102 @@ +# LINGYUN.Abp.Localization.Xml + +## Module Description + +XML document integration module for localization components, providing XML file-based localization resource support. It includes built-in implementations for both PhysicalFileProvider and VirtualFileProvider. + +## Features + +* Support reading localization resources from XML files +* Support XML files in virtual file system +* Support XML files in physical file system +* Support XML file serialization and deserialization +* Support UTF-8 encoded XML files + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Localization.Xml +``` + +## Base Modules + +* Volo.Abp.Localization + +## Usage + +1. Add module dependency: + +```csharp +[DependsOn( + typeof(AbpLocalizationXmlModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + // Virtual file system directory in current project + // See: https://docs.abp.io/en/abp/latest/Virtual-File-System + .AddVirtualXml("/LINGYUN/Abp/Localization/Xml/Resources") + // Usually configured in the host project, write the absolute path where XML files are stored + // See: https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.fileproviders.physicalfileprovider + .AddPhysicalXml(Path.Combine(Directory.GetCurrentDirectory(), "Resources")); + }); + } +} +``` + +## XML File Format + +This module uses the [XmlLocalizationFile](./LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs) type for XML file serialization and deserialization. + +Example XML file format: + +```xml + + + + + Welcome + Hello, World! + This field is required + + +``` + +## Extension Methods + +The module provides two extension methods for adding XML localization resources: + +1. AddVirtualXml: Add XML files from virtual file system +```csharp +localizationResource.AddVirtualXml("/YourVirtualPath/Localization"); +``` + +2. AddPhysicalXml: Add XML files from physical file system +```csharp +localizationResource.AddPhysicalXml("C:/YourPath/Localization"); +``` + +## Best Practices + +1. Recommended usage for virtual files: + * Embed XML files into the assembly + * Suitable for default localization resources that don't need dynamic modification + +2. Recommended usage for physical files: + * Store in a specific directory in the host project + * Suitable for localization resources that need dynamic modification or are managed by external systems + +## More Information + +* [中文文档](./README.md) +* [ABP Localization Documentation](https://docs.abp.io/en/abp/latest/Localization) +* [ABP Virtual File System](https://docs.abp.io/en/abp/latest/Virtual-File-System) diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/README.md b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/README.md index 91f82e12d..40a0e819f 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/README.md +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/README.md @@ -2,63 +2,101 @@ ## 模块说明 -本地化组件的Xml文档集成,内置PhysicalFileProvider与VirtualFileProvider实现 +本地化组件的XML文档集成模块,提供基于XML文件的本地化资源支持。内置了物理文件提供程序(PhysicalFileProvider)和虚拟文件提供程序(VirtualFileProvider)的实现。 -### 基础模块 +## 功能特性 -### 高阶模块 +* 支持从XML文件读取本地化资源 +* 支持虚拟文件系统中的XML文件 +* 支持物理文件系统中的XML文件 +* 支持XML文件的序列化和反序列化 +* 支持UTF-8编码的XML文件 -### 权限定义 +## 安装 -### 功能定义 +```bash +dotnet add package LINGYUN.Abp.Localization.Xml +``` -### 配置定义 +## 基础模块 -### 如何使用 +* Volo.Abp.Localization +## 使用方法 -```csharp +1. 添加模块依赖: - [DependsOn( - typeof(AbpLocalizationXmlModule))] - public class YouProjectModule : AbpModule +```csharp +[DependsOn( + typeof(AbpLocalizationXmlModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); - - Configure(options => - { - options.Resources - .Add("en") - // 当前项目中的虚拟文件系统目录,详情见: https://docs.abp.io/en/abp/latest/Virtual-File-System - .AddVirtualXml("/LINGYUN/Abp/Localization/Xml/Resources") - // 一般配置在宿主项目中, 写入宿主项目中存储xml文件的绝对路径(受PhysicalFileProvider的限制) - // 详情见: https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.fileproviders.physicalfileprovider?view=dotnet-plat-ext-5.0 - .AddPhysicalXml(Path.Combine(Directory.GetCurrentDirectory(), "Resources")); - }); - } - } + options.FileSets.AddEmbedded(); + }); + Configure(options => + { + options.Resources + .Add("en") + // 当前项目中的虚拟文件系统目录 + // 详情见: https://docs.abp.io/zh-Hans/abp/latest/Virtual-File-System + .AddVirtualXml("/LINGYUN/Abp/Localization/Xml/Resources") + // 一般配置在宿主项目中, 写入宿主项目中存储xml文件的绝对路径 + // 详情见: https://docs.microsoft.com/zh-cn/dotnet/api/microsoft.extensions.fileproviders.physicalfileprovider + .AddPhysicalXml(Path.Combine(Directory.GetCurrentDirectory(), "Resources")); + }); + } +} ``` -Xml文件格式如下 -序列化: [XmlLocalizationFile](./LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs) 类型实现 +## XML文件格式 -```xml +本模块使用 [XmlLocalizationFile](./LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs) 类型来序列化和反序列化XML文件。 + +示例XML文件格式: +```xml - - - - - - + + + + 欢迎 + 你好,世界! + 这是必填字段 + +``` +## 扩展方法 + +模块提供了两个扩展方法来添加XML本地化资源: + +1. AddVirtualXml:添加虚拟文件系统中的XML文件 +```csharp +localizationResource.AddVirtualXml("/YourVirtualPath/Localization"); +``` + +2. AddPhysicalXml:添加物理文件系统中的XML文件 +```csharp +localizationResource.AddPhysicalXml("C:/YourPath/Localization"); ``` -### 更新日志 +## 最佳实践 + +1. 虚拟文件推荐用法: + * 将XML文件嵌入到程序集中 + * 适用于默认的、不需要动态修改的本地化资源 + +2. 物理文件推荐用法: + * 存放在宿主项目的特定目录中 + * 适用于需要动态修改或由外部系统管理的本地化资源 + +## 更多信息 + +* [English Documentation](./README.EN.md) +* [ABP本地化文档](https://docs.abp.io/zh-Hans/abp/latest/Localization) +* [ABP虚拟文件系统](https://docs.abp.io/zh-Hans/abp/latest/Virtual-File-System) diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.EN.md b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.EN.md new file mode 100644 index 000000000..4326a7bb2 --- /dev/null +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.EN.md @@ -0,0 +1,113 @@ +# LINGYUN.Abp.Logging.Serilog.Elasticsearch + +[简体中文](./README.md) | English + +Elasticsearch implementation of the ILoggingManager interface, retrieving log information from Elasticsearch. + +## Features + +* Elasticsearch-based log storage and retrieval +* Support for various log levels (Debug, Information, Warning, Error, Critical) +* Automatic mapping between Serilog and Microsoft.Extensions.Logging log levels +* Rich query conditions (time range, log level, machine name, environment name, etc.) +* Exception information storage and retrieval +* Multi-tenancy support + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpLoggingSerilogElasticsearchModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Options + +* AbpLoggingSerilogElasticsearchOptions.IndexFormat - Must match the IndexFormat in Serilog configuration, otherwise the correct index cannot be located + +## appsettings.json + +```json +{ + "Logging": { + "Serilog": { + "Elasticsearch": { + "IndexFormat": "logstash-{0:yyyy.MM.dd}" + } + } + } +} +``` + +## Basic Usage + +1. Inject ILoggingManager interface: +```csharp +public class YourService +{ + private readonly ILoggingManager _loggingManager; + + public YourService(ILoggingManager loggingManager) + { + _loggingManager = loggingManager; + } +} +``` + +2. Query logs: +```csharp +// Get log list +var logs = await _loggingManager.GetListAsync( + startTime: DateTime.Now.AddDays(-1), + maxResultCount: 10, + skipCount: 0, + level: LogLevel.Error, + environment: "Production", + application: "YourApp" +); + +// Get log count +var count = await _loggingManager.GetCountAsync( + startTime: DateTime.Now.AddDays(-1), + level: LogLevel.Error +); + +// Get single log +var log = await _loggingManager.GetAsync(id); +``` + +## Supported Query Conditions + +* Time range (startTime, endTime) +* Log level (level) +* Machine name (machineName) +* Environment name (environment) +* Application name (application) +* Context (context) +* Request ID (requestId) +* Request path (requestPath) +* Correlation ID (correlationId) +* Process ID (processId) +* Thread ID (threadId) +* Has exception (hasException) + +## Important Notes + +1. The IndexFormat configuration must be consistent between your Serilog settings and this module's configuration. The default format is "logstash-{0:yyyy.MM.dd}". +2. Multi-tenancy support with automatic filtering based on current tenant ID. +3. Query results support pagination and sorting. +4. Support for fuzzy matching of request paths. +5. Support for existence query of exception information. + +## Object Mapping + +* SerilogInfo to LogInfo + - Automatic mapping of timestamp and log level + - Proper conversion between Serilog and Microsoft.Extensions.Logging log levels +* SerilogException to LogException + - Maps exception details including message, type, and stack trace +* SerilogField to LogField + - Maps all log fields including machine name, environment, application name, etc. + - Supports unique ID generation for log entries diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.md b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.md index 0310e602b..c2b72bd20 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.md +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.md @@ -1,7 +1,18 @@ # LINGYUN.Abp.Logging.Serilog.Elasticsearch +简体中文 | [English](./README.EN.md) + ILoggingManager 接口的ES实现, 从ES中检索日志信息 +## 功能特性 + +* 基于Elasticsearch的日志存储和检索 +* 支持多种日志级别(Debug、Information、Warning、Error、Critical) +* 支持Serilog和Microsoft.Extensions.Logging日志级别的自动映射 +* 支持丰富的查询条件(时间范围、日志级别、机器名称、环境名称等) +* 支持异常信息的存储和检索 +* 支持多租户 + ## 模块引用 ```csharp @@ -28,5 +39,64 @@ public class YouProjectModule : AbpModule } } } +``` + +## 基本用法 + +1. 注入 ILoggingManager 接口: +```csharp +public class YourService +{ + private readonly ILoggingManager _loggingManager; + + public YourService(ILoggingManager loggingManager) + { + _loggingManager = loggingManager; + } +} +``` + +2. 查询日志: +```csharp +// 获取日志列表 +var logs = await _loggingManager.GetListAsync( + startTime: DateTime.Now.AddDays(-1), + maxResultCount: 10, + skipCount: 0, + level: LogLevel.Error, + environment: "Production", + application: "YourApp" +); + +// 获取日志总数 +var count = await _loggingManager.GetCountAsync( + startTime: DateTime.Now.AddDays(-1), + level: LogLevel.Error +); + +// 获取单条日志 +var log = await _loggingManager.GetAsync(id); +``` + +## 支持的查询条件 + +* 时间范围(startTime、endTime) +* 日志级别(level) +* 机器名称(machineName) +* 环境名称(environment) +* 应用名称(application) +* 上下文(context) +* 请求ID(requestId) +* 请求路径(requestPath) +* 关联ID(correlationId) +* 进程ID(processId) +* 线程ID(threadId) +* 是否包含异常(hasException) + +## 注意事项 -``` \ No newline at end of file +1. IndexFormat配置必须与Serilog配置保持一致,默认格式为"logstash-{0:yyyy.MM.dd}" +2. 支持多租户,会自动根据当前租户ID过滤日志 +3. 查询结果支持分页和排序 +4. 支持请求路径的模糊匹配 +5. 支持异常信息的存在性查询 \ No newline at end of file diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/README.EN.md b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/README.EN.md new file mode 100644 index 000000000..824800b7e --- /dev/null +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/README.EN.md @@ -0,0 +1,96 @@ +# LINGYUN.Abp.Logging + +Basic logging module + +Defines the ILoggingManager interface for implementing log information queries. + +[简体中文](./README.md) + +## Features + +* Provides unified logging query interface ILoggingManager +* Supports various log field queries, including timestamp, log level, message, etc. +* Supports exception information recording and querying +* Supports rich log field information such as machine name, environment name, application name, etc. +* Supports pagination query and count statistics + +## Module Reference + +```csharp +[DependsOn(typeof(AbpLoggingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +Configure in `appsettings.json`: + +```json +{ + "Logging": { + "MachineName": "your-machine-name", + "EnvironmentName": "environment-name" + } +} +``` + +## Basic Usage + +1. Inject ILoggingManager interface: +```csharp +public class YourService +{ + private readonly ILoggingManager _loggingManager; + + public YourService(ILoggingManager loggingManager) + { + _loggingManager = loggingManager; + } +} +``` + +2. Query logs: +```csharp +// Get log list +var logs = await _loggingManager.GetListAsync( + startTime: DateTime.Now.AddDays(-1), + maxResultCount: 10, + skipCount: 0, + level: LogLevel.Error +); + +// Get log count +var count = await _loggingManager.GetCountAsync( + startTime: DateTime.Now.AddDays(-1), + level: LogLevel.Error +); + +// Get single log +var log = await _loggingManager.GetAsync(id); +``` + +## Log Field Description + +* TimeStamp - Log timestamp +* Level - Log level +* Message - Log message +* Fields - Log field information + * Id - Log unique identifier + * MachineName - Machine name + * Environment - Environment name + * Application - Application name + * Context - Context + * ActionId - Action ID + * ActionName - Action name + * RequestId - Request ID + * RequestPath - Request path + * ConnectionId - Connection ID + * CorrelationId - Correlation ID + * ClientId - Client ID + * UserId - User ID + * ProcessId - Process ID + * ThreadId - Thread ID +* Exceptions - Exception information list diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/README.md b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/README.md index 5f8b18560..8314f5605 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/README.md +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/README.md @@ -4,6 +4,16 @@ 定义 ILoggingManager 接口, 实现日志信息查询 +[English](./README.EN.md) + +## 功能特性 + +* 提供统一的日志查询接口 ILoggingManager +* 支持多种日志字段查询,包括时间戳、日志级别、消息等 +* 支持异常信息记录和查询 +* 支持丰富的日志字段信息,如机器名称、环境名称、应用名称等 +* 支持分页查询和计数统计 + ## 模块引用 ```csharp @@ -13,3 +23,74 @@ public class YouProjectModule : AbpModule // other } ``` + +## 配置项 + +在 `appsettings.json` 中配置: + +```json +{ + "Logging": { + "MachineName": "你的机器名称", + "EnvironmentName": "环境名称" + } +} +``` + +## 基本用法 + +1. 注入 ILoggingManager 接口: +```csharp +public class YourService +{ + private readonly ILoggingManager _loggingManager; + + public YourService(ILoggingManager loggingManager) + { + _loggingManager = loggingManager; + } +} +``` + +2. 查询日志: +```csharp +// 获取日志列表 +var logs = await _loggingManager.GetListAsync( + startTime: DateTime.Now.AddDays(-1), + maxResultCount: 10, + skipCount: 0, + level: LogLevel.Error +); + +// 获取日志总数 +var count = await _loggingManager.GetCountAsync( + startTime: DateTime.Now.AddDays(-1), + level: LogLevel.Error +); + +// 获取单条日志 +var log = await _loggingManager.GetAsync(id); +``` + +## 日志字段说明 + +* TimeStamp - 日志时间戳 +* Level - 日志级别 +* Message - 日志消息 +* Fields - 日志字段信息 + * Id - 日志唯一标识 + * MachineName - 机器名称 + * Environment - 环境名称 + * Application - 应用名称 + * Context - 上下文 + * ActionId - 操作ID + * ActionName - 操作名称 + * RequestId - 请求ID + * RequestPath - 请求路径 + * ConnectionId - 连接ID + * CorrelationId - 关联ID + * ClientId - 客户端ID + * UserId - 用户ID + * ProcessId - 进程ID + * ThreadId - 线程ID +* Exceptions - 异常信息列表 diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/README.EN.md b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/README.EN.md new file mode 100644 index 000000000..56f11bd2b --- /dev/null +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/README.EN.md @@ -0,0 +1,91 @@ +# LINGYUN.Abp.Serilog.Enrichers.Application + +[简体中文](./README.md) | English + +A Serilog enricher that adds application identifier to log properties. + +## Features + +* Adds application name to log events +* Configurable application name field +* Support for both code-based and configuration-based setup +* Caches log event property for better performance +* Seamless integration with Serilog + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpSerilogEnrichersApplicationModule))] +public class YouProjectModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + AbpSerilogEnrichersConsts.ApplicationName = "demo-app"; + } +} +``` + +## Configuration Options + +The following are field constants that need to be explicitly changed: + +* AbpSerilogEnrichersConsts.ApplicationNamePropertyName - Used to customize the name of the ApplicationName field +* AbpSerilogEnrichersConsts.ApplicationName - The name of the current application to be identified in logs + +## Usage + +### Code-based Configuration + +```csharp +Log.Logger = new LoggerConfiguration() + .Enrich.WithApplicationName() + // ...other configuration... + .CreateLogger(); +``` + +### JSON Configuration + +```json +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information" + }, + "Enrich": [ "WithApplicationName" ] + } +} +``` + +## Implementation Details + +The enricher adds a property named "ApplicationName" (configurable) to each log event with the value specified in `AbpSerilogEnrichersConsts.ApplicationName`. The property is cached for better performance. + +## Best Practices + +1. Set the application name early in your application's startup: +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + AbpSerilogEnrichersConsts.ApplicationName = "your-app-name"; +} +``` + +2. Use a consistent naming convention for your applications to make log filtering easier. + +3. Consider setting the application name through configuration: +```json +{ + "App": { + "Name": "your-app-name" + } +} +``` +```csharp +AbpSerilogEnrichersConsts.ApplicationName = configuration["App:Name"]; +``` + +## Notes + +1. The application name is static once set and will be the same for all log entries from the application. +2. The enricher uses property caching to improve performance. +3. The property will only be added if it doesn't already exist in the log event. diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/README.md b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/README.md index 87c5b4e61..928eb74db 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/README.md +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/README.md @@ -1,7 +1,17 @@ # LINGYUN.Abp.Serilog.Enrichers.Application +简体中文 | [English](./README.EN.md) + 日志属性添加应用程序标识 +## 功能特性 + +* 为日志事件添加应用程序名称 +* 支持自定义应用程序名称字段 +* 支持代码配置和JSON配置两种方式 +* 缓存日志事件属性以提高性能 +* 与Serilog无缝集成 + ## 模块引用 ```csharp @@ -10,32 +20,32 @@ public class YouProjectModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { - AbpSerilogEnrichersConsts.ApplicationName = "demo-app"; + AbpSerilogEnrichersConsts.ApplicationName = "demo-app"; } } ``` ## 配置项 -以下为字段常量,需要明确变更 +以下为字段常量,需要明确变更: -* AbpSerilogEnrichersConsts.ApplicationNamePropertyName 用于自定义ApplicationName字段的名称 -* AbpSerilogEnrichersConsts.ApplicationName 在日志中标识当前应用的名称 +* AbpSerilogEnrichersConsts.ApplicationNamePropertyName - 用于自定义ApplicationName字段的名称 +* AbpSerilogEnrichersConsts.ApplicationName - 在日志中标识当前应用的名称 -## How to Use +## 使用方法 -```csharp +### 代码配置方式 +```csharp Log.Logger = new LoggerConfiguration() .Enrich.WithApplicationName() - // ...other configuration... + // ...其他配置... .CreateLogger(); - ``` -**Or** -```json +### JSON配置方式 +```json { "Serilog": { "MinimumLevel": { @@ -44,5 +54,38 @@ Log.Logger = new LoggerConfiguration() "Enrich": [ "WithApplicationName" ] } } +``` + +## 实现细节 + +该enricher为每个日志事件添加一个名为"ApplicationName"(可配置)的属性,其值为`AbpSerilogEnrichersConsts.ApplicationName`中指定的值。为了提高性能,属性会被缓存。 + +## 最佳实践 + +1. 在应用程序启动时尽早设置应用程序名称: +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + AbpSerilogEnrichersConsts.ApplicationName = "your-app-name"; +} +``` + +2. 为应用程序使用一致的命名约定,以便于日志过滤。 + +3. 考虑通过配置文件设置应用程序名称: +```json +{ + "App": { + "Name": "your-app-name" + } +} +``` +```csharp +AbpSerilogEnrichersConsts.ApplicationName = configuration["App:Name"]; +``` + +## 注意事项 -``` \ No newline at end of file +1. 应用程序名称一旦设置就是静态的,对应用程序的所有日志条目都相同 +2. enricher使用属性缓存来提高性能 +3. 只有在日志事件中不存在该属性时才会添加 \ No newline at end of file diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/README.EN.md b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/README.EN.md new file mode 100644 index 000000000..88695a9c8 --- /dev/null +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/README.EN.md @@ -0,0 +1,113 @@ +# LINGYUN.Abp.Serilog.Enrichers.UniqueId + +[简体中文](./README.md) | English + +A Serilog enricher that adds unique identifiers to log properties using the Snowflake algorithm. + +## Features + +* Adds unique identifier to each log event +* Uses Snowflake algorithm for distributed unique ID generation +* Supports custom Snowflake algorithm configuration +* Supports both code-based and configuration-based setup +* Seamless integration with Serilog + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpSerilogEnrichersUniqueIdModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Options + +### Constants + +* AbpSerilogUniqueIdConsts.UniqueIdPropertyName - Name of the unique identifier field, defaults to "UniqueId" + +### Snowflake Configuration + +Configure Snowflake algorithm parameters through `AbpSerilogEnrichersUniqueIdOptions`: + +```json +{ + "UniqueId": { + "Snowflake": { + "WorkerId": 1, // Worker machine ID + "DatacenterId": 1, // Datacenter ID + "Sequence": 0, // Sequence number + "BaseTime": "2020-01-01 00:00:00" // Base time + } + } +} +``` + +## Usage + +### Code-based Configuration + +```csharp +Log.Logger = new LoggerConfiguration() + .Enrich.WithUniqueId() + // ...other configuration... + .CreateLogger(); +``` + +### JSON Configuration + +```json +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information" + }, + "Enrich": [ "WithUniqueId" ] + } +} +``` + +## Implementation Details + +This enricher uses the Snowflake algorithm to generate a unique ID for each log event. The Snowflake algorithm features: + +* Generates 64-bit long integer IDs +* ID consists of timestamp, datacenter ID, worker machine ID, and sequence number +* Ensures uniqueness in distributed environments +* Time-based ordering + +## Best Practices + +1. Configure worker ID and datacenter ID appropriately to avoid conflicts in distributed environments: +```json +{ + "UniqueId": { + "Snowflake": { + "WorkerId": 1, + "DatacenterId": 1 + } + } +} +``` + +2. Set an appropriate base time to maximize the available time range for IDs: +```json +{ + "UniqueId": { + "Snowflake": { + "BaseTime": "2020-01-01 00:00:00" + } + } +} +``` + +3. Use the UniqueId field for precise log event location in queries. + +## Notes + +1. IDs generated by the Snowflake algorithm are roughly increasing but not strictly monotonic +2. Worker ID and datacenter ID must be unique within the cluster +3. Base time cannot be modified once set, as it may cause ID duplicates +4. Each log event generates a new unique ID, which may incur some performance overhead diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/README.md b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/README.md new file mode 100644 index 000000000..0bac562bc --- /dev/null +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/README.md @@ -0,0 +1,113 @@ +# LINGYUN.Abp.Serilog.Enrichers.UniqueId + +简体中文 | [English](./README.EN.md) + +日志属性添加唯一标识,使用雪花算法生成唯一ID。 + +## 功能特性 + +* 为每个日志事件添加唯一标识 +* 基于雪花算法(Snowflake)生成分布式唯一ID +* 支持自定义雪花算法配置 +* 支持代码配置和JSON配置两种方式 +* 与Serilog无缝集成 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpSerilogEnrichersUniqueIdModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +### 常量配置 + +* AbpSerilogUniqueIdConsts.UniqueIdPropertyName - 唯一标识字段的名称,默认为"UniqueId" + +### 雪花算法配置 + +通过 `AbpSerilogEnrichersUniqueIdOptions` 配置雪花算法参数: + +```json +{ + "UniqueId": { + "Snowflake": { + "WorkerId": 1, // 工作机器ID + "DatacenterId": 1, // 数据中心ID + "Sequence": 0, // 序列号 + "BaseTime": "2020-01-01 00:00:00" // 基准时间 + } + } +} +``` + +## 使用方法 + +### 代码配置方式 + +```csharp +Log.Logger = new LoggerConfiguration() + .Enrich.WithUniqueId() + // ...其他配置... + .CreateLogger(); +``` + +### JSON配置方式 + +```json +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information" + }, + "Enrich": [ "WithUniqueId" ] + } +} +``` + +## 实现细节 + +该enricher使用雪花算法为每个日志事件生成一个唯一的ID。雪花算法的特点是: + +* 生成的ID是64位的长整型 +* ID由时间戳、数据中心ID、工作机器ID和序列号组成 +* 保证在分布式环境下的唯一性 +* 基于时间戳的有序性 + +## 最佳实践 + +1. 合理配置工作机器ID和数据中心ID,避免在分布式环境中产生冲突: +```json +{ + "UniqueId": { + "Snowflake": { + "WorkerId": 1, + "DatacenterId": 1 + } + } +} +``` + +2. 设置合适的基准时间以最大化ID的可用时间范围: +```json +{ + "UniqueId": { + "Snowflake": { + "BaseTime": "2020-01-01 00:00:00" + } + } +} +``` + +3. 在日志查询时可以使用UniqueId字段进行精确定位。 + +## 注意事项 + +1. 雪花算法生成的ID是趋势递增的,但不保证严格递增 +2. 工作机器ID和数据中心ID在集群中必须唯一 +3. 基准时间一旦设置就不能修改,否则可能导致ID重复 +4. 每个日志事件都会生成新的唯一ID,这可能会增加一些性能开销 diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/README.EN.md b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/README.EN.md new file mode 100644 index 000000000..b7629367d --- /dev/null +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/README.EN.md @@ -0,0 +1,98 @@ +# LINGYUN.Abp.AspNetCore.Mvc.Wrapper + +MVC wrapper implementation module for unified wrapping of ASP.NET Core MVC response results. + +[简体中文](./README.md) + +## Features + +* Automatic wrapping of MVC response results +* Support for custom wrapping rules +* Support for exception result wrapping +* Support for localized error messages +* Support for API documentation wrapping description +* Support for ignoring specific controllers, namespaces, and return types + +## Installation + +```bash +dotnet add package LINGYUN.Abp.AspNetCore.Mvc.Wrapper +``` + +## Configuration + +```csharp +[DependsOn(typeof(AbpAspNetCoreMvcWrapperModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Enable wrapper + options.IsEnabled = true; + + // Ignore specific return types + options.IgnoreReturnTypes.Add(); + + // Ignore specific controllers + options.IgnoreControllers.Add(); + + // Ignore specific URL prefixes + options.IgnorePrefixUrls.Add("/connect"); + + // Custom empty result message + options.MessageWithEmptyResult = (serviceProvider) => + { + var localizer = serviceProvider.GetRequiredService>(); + return localizer["Wrapper:NotFound"]; + }; + }); + } +} +``` + +## Configuration Options + +* `IsEnabled`: Whether to enable the wrapper +* `IsWrapUnauthorizedEnabled`: Whether to wrap unauthorized responses +* `HttpStatusCode`: HTTP status code for wrapped responses +* `IgnoreReturnTypes`: List of return types to ignore wrapping +* `IgnoreControllers`: List of controllers to ignore wrapping +* `IgnoreNamespaces`: List of namespaces to ignore wrapping +* `IgnorePrefixUrls`: List of URL prefixes to ignore wrapping +* `IgnoreExceptions`: List of exception types to ignore wrapping +* `ErrorWithEmptyResult`: Whether to return error message for empty results +* `CodeWithEmptyResult`: Error code for empty results +* `MessageWithEmptyResult`: Error message for empty results +* `CodeWithSuccess`: Code for successful responses + +## Advanced Usage + +### 1. Using Attributes to Ignore Wrapping + +```csharp +[IgnoreWrapResult] +public class TestController : AbpController +{ + // All actions in this controller will not be wrapped +} + +public class TestController : AbpController +{ + [IgnoreWrapResult] + public IActionResult Test() + { + // This action will not be wrapped + } +} +``` + +### 2. Controlling Wrapping via Request Headers + +* Add `_AbpDontWrapResult` header to disable wrapping +* Add `_AbpWrapResult` header to force enable wrapping + +## Source Code + +[LINGYUN.Abp.AspNetCore.Mvc.Wrapper](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper) diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/README.md b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/README.md index cb82af1be..0e3c472a4 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/README.md +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/README.md @@ -1,6 +1,23 @@ # LINGYUN.Abp.AspNetCore.Mvc.Wrapper -包装器 MVC 实现模块 +包装器 MVC 实现模块,用于统一包装ASP.NET Core MVC的响应结果。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动包装MVC响应结果 +* 支持自定义包装规则 +* 支持异常结果包装 +* 支持本地化错误消息 +* 支持API文档包装描述 +* 支持忽略特定控制器、命名空间、返回类型的包装 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.AspNetCore.Mvc.Wrapper +``` ## 配置使用 @@ -8,17 +25,74 @@ [DependsOn(typeof(AbpAspNetCoreMvcWrapperModule))] public class YouProjectModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - // 启用包装器 - options.IsEnabled = true; + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // 启用包装器 + options.IsEnabled = true; + + // 忽略特定返回类型 + options.IgnoreReturnTypes.Add(); + + // 忽略特定控制器 + options.IgnoreControllers.Add(); + + // 忽略特定URL前缀 + options.IgnorePrefixUrls.Add("/connect"); + + // 自定义空结果消息 + options.MessageWithEmptyResult = (serviceProvider) => + { + var localizer = serviceProvider.GetRequiredService>(); + return localizer["Wrapper:NotFound"]; + }; }); - } + } } ``` + ## 配置项说明 -## 其他 +* `IsEnabled`: 是否启用包装器 +* `IsWrapUnauthorizedEnabled`: 是否包装未授权响应 +* `HttpStatusCode`: 包装响应的HTTP状态码 +* `IgnoreReturnTypes`: 忽略包装的返回类型列表 +* `IgnoreControllers`: 忽略包装的控制器列表 +* `IgnoreNamespaces`: 忽略包装的命名空间列表 +* `IgnorePrefixUrls`: 忽略包装的URL前缀列表 +* `IgnoreExceptions`: 忽略包装的异常类型列表 +* `ErrorWithEmptyResult`: 空结果是否返回错误信息 +* `CodeWithEmptyResult`: 空结果的错误代码 +* `MessageWithEmptyResult`: 空结果的错误消息 +* `CodeWithSuccess`: 成功时的代码 + +## 高级用法 + +### 1. 使用特性标记忽略包装 + +```csharp +[IgnoreWrapResult] +public class TestController : AbpController +{ + // 该控制器下所有Action都不会被包装 +} + +public class TestController : AbpController +{ + [IgnoreWrapResult] + public IActionResult Test() + { + // 该Action不会被包装 + } +} +``` + +### 2. 通过请求头控制包装 + +* 添加 `_AbpDontWrapResult` 请求头可以禁用包装 +* 添加 `_AbpWrapResult` 请求头可以强制启用包装 + +## 源码位置 +[LINGYUN.Abp.AspNetCore.Mvc.Wrapper](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper) diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/README.EN.md b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/README.EN.md new file mode 100644 index 000000000..bc8456f53 --- /dev/null +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/README.EN.md @@ -0,0 +1,109 @@ +# LINGYUN.Abp.UI.Navigation + +[简体中文](./README.md) | English + +Menu navigation module that provides extensible custom menu items. + +## Features + +* Support for custom menu item definitions and extensions +* Multi-tenancy support +* Support for menu item hierarchy +* Support for menu item ordering +* Support for menu item visibility and disabled state +* Support for menu item icons and redirects +* Support for menu seed data initialization + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpUINavigationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +### 1. Define Menu Provider + +Implement the `INavigationDefinitionProvider` interface to define menu items: + +```csharp +public class FakeNavigationDefinitionProvider : NavigationDefinitionProvider +{ + public override void Define(INavigationDefinitionContext context) + { + context.Add(GetNavigationDefinition()); + } + + private static NavigationDefinition GetNavigationDefinition() + { + var dashboard = new ApplicationMenu( + name: "Vben Dashboard", + displayName: "Dashboard", + url: "/dashboard", + component: "", + description: "Dashboard", + icon: "ion:grid-outline", + redirect: "/dashboard/analysis"); + + dashboard.AddItem( + new ApplicationMenu( + name: "Analysis", + displayName: "Analysis Page", + url: "/dashboard/analysis", + component: "/dashboard/analysis/index", + description: "Analysis Page")); + + return new NavigationDefinition(dashboard); + } +} +``` + +### 2. Initialize Menu Data + +Implement the `INavigationSeedContributor` interface to initialize menu seed data: + +```csharp +public class YourNavigationDataSeeder : INavigationSeedContributor +{ + public async Task SeedAsync(NavigationSeedContext context) + { + // Initialize menu data here + } +} +``` + +## Menu Item Properties + +* Name - Menu item name (unique identifier) +* DisplayName - Display name +* Description - Description +* Url - Path +* Component - Component path +* Redirect - Redirect path +* Icon - Icon +* Order - Order (default 1000) +* IsDisabled - Whether disabled +* IsVisible - Whether visible +* Items - Child menu items collection +* ExtraProperties - Extension properties +* MultiTenancySides - Multi-tenancy options + +## Best Practices + +1. Use meaningful names for menu items for better management and maintenance +2. Use menu item ordering appropriately to keep the interface clean +3. Use icons to enhance user experience +4. Use redirect functionality appropriately to optimize navigation experience +5. Control menu item visibility and disabled state based on actual requirements + +## Notes + +1. Menu item Name must be unique +2. Child menu items inherit multi-tenant settings from parent menu items +3. Menu items with smaller order values appear first +4. Disabled menu items are still visible but cannot be clicked +5. Component paths should be consistent with front-end routing configuration diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/README.md b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/README.md index 818a3000b..e386a49db 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/README.md +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/README.md @@ -1,14 +1,20 @@ # LINGYUN.Abp.UI.Navigation -菜单导航模块,提供可扩展自定义的菜单项 +简体中文 | [English](./README.EN.md) -## 配置使用 +菜单导航模块,提供可扩展自定义的菜单项 -应用初始化时扫描所有实现 **INavigationDefinitionProvider** 接口的用户定义菜单项 +## 功能特性 -通过 **INavigationDataSeeder** 接口初始化菜单种子数据 +* 支持自定义菜单项定义和扩展 +* 支持多租户 +* 支持菜单项的层级结构 +* 支持菜单项的排序 +* 支持菜单项的可见性和禁用状态 +* 支持菜单项的图标和重定向 +* 支持菜单种子数据的初始化 -**INavigationDataSeeder** 的实现交给具体的实现 +## 模块引用 ```csharp [DependsOn(typeof(AbpUINavigationModule))] @@ -18,11 +24,16 @@ public class YouProjectModule : AbpModule } ``` -```csharp +## 基本用法 + +### 1. 定义菜单提供者 + +通过实现 `INavigationDefinitionProvider` 接口来定义菜单项: +```csharp public class FakeNavigationDefinitionProvider : NavigationDefinitionProvider { - public override void Define(INavigationDefinitionContext context) + public override void Define(INavigationDefinitionContext context) { context.Add(GetNavigationDefinition()); } @@ -49,7 +60,50 @@ public class FakeNavigationDefinitionProvider : NavigationDefinitionProvider return new NavigationDefinition(dashboard); } } +``` + +### 2. 初始化菜单数据 +通过实现 `INavigationSeedContributor` 接口来初始化菜单种子数据: + +```csharp +public class YourNavigationDataSeeder : INavigationSeedContributor +{ + public async Task SeedAsync(NavigationSeedContext context) + { + // 在这里初始化菜单数据 + } +} ``` -## 其他 +## 菜单项属性说明 + +* Name - 菜单项名称(唯一标识) +* DisplayName - 显示名称 +* Description - 说明 +* Url - 路径 +* Component - 组件路径 +* Redirect - 重定向路径 +* Icon - 图标 +* Order - 排序(默认1000) +* IsDisabled - 是否禁用 +* IsVisible - 是否可见 +* Items - 子菜单项集合 +* ExtraProperties - 扩展属性 +* MultiTenancySides - 多租户选项 + +## 最佳实践 + +1. 菜单项命名建议使用有意义的名称,便于管理和维护 +2. 合理使用菜单项的排序,保持界面的整洁 +3. 使用图标增强用户体验 +4. 适当使用重定向功能优化导航体验 +5. 根据实际需求控制菜单项的可见性和禁用状态 + +## 注意事项 + +1. 菜单项的Name必须唯一 +2. 子菜单项会继承父菜单项的多租户设置 +3. 菜单项的排序值越小越靠前 +4. 禁用的菜单项仍然可见,但无法点击 +5. 组件路径应与前端路由配置保持一致 diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/README.EN.md b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/README.EN.md new file mode 100644 index 000000000..631d9922b --- /dev/null +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/README.EN.md @@ -0,0 +1,95 @@ +# LINGYUN.Abp.BlobStoring.Nexus + +[简体中文](./README.md) | English + +A BLOB storage provider based on Sonatype Nexus. + +## Features + +* Support for storing files in Nexus repository +* Support for basic file operations including upload, download, and delete +* Support for file path normalization +* Support for file duplication check and override options +* Multi-tenancy support + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpBlobStoringNexusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +### 1. Configure Nexus Storage + +Configure Nexus storage options in `appsettings.json`: + +```json +{ + "BlobStoring": { + "Nexus": { + "Repository": "your-repository-name" + } + } +} +``` + +### 2. Configure Container + +```csharp +Configure(options => +{ + options.Containers.ConfigureDefault(container => + { + container.UseNexus(nexus => + { + nexus.Repository = "your-repository-name"; + }); + }); +}); +``` + +### 3. Use BLOB Storage + +```csharp +public class MyService +{ + private readonly IBlobContainer _blobContainer; + + public MyService(IBlobContainer blobContainer) + { + _blobContainer = blobContainer; + } + + public async Task SaveBlobAsync(byte[] bytes) + { + await _blobContainer.SaveAsync("my-blob-name", bytes); + } + + public async Task GetBlobAsync() + { + return await _blobContainer.GetAllBytesAsync("my-blob-name"); + } +} +``` + +## Configuration Options + +* Repository - Nexus repository name + +## Best Practices + +1. Plan file paths and naming properly for better management and maintenance +2. Configure file override options based on actual requirements +3. Use multi-tenancy features appropriately to ensure data isolation + +## Notes + +1. Ensure Nexus repository is properly configured and accessible +2. File paths are automatically normalized, replacing backslashes with forward slashes +3. By default, overwriting existing files is not allowed, the OverrideExisting option needs to be explicitly set +4. File operations may be affected by network conditions, consider adding appropriate error handling mechanisms diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/README.md b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/README.md new file mode 100644 index 000000000..479906fad --- /dev/null +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/README.md @@ -0,0 +1,95 @@ +# LINGYUN.Abp.BlobStoring.Nexus + +[English](./README.EN.md) | 简体中文 + +基于 Sonatype Nexus 的 Blob 存储提供程序。 + +## 功能 + +* 支持将文件存储到 Nexus 仓库 +* 支持文件的上传、下载、删除等基本操作 +* 支持文件路径规范化 +* 支持文件重复检查和覆盖选项 +* 支持多租户 + +## 模块依赖 + +```csharp +[DependsOn(typeof(AbpBlobStoringNexusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +### 1. 配置 Nexus 存储 + +在 `appsettings.json` 中配置 Nexus 存储选项: + +```json +{ + "BlobStoring": { + "Nexus": { + "Repository": "your-repository-name" + } + } +} +``` + +### 2. 配置容器 + +```csharp +Configure(options => +{ + options.Containers.ConfigureDefault(container => + { + container.UseNexus(nexus => + { + nexus.Repository = "your-repository-name"; + }); + }); +}); +``` + +### 3. 使用 BLOB 存储 + +```csharp +public class MyService +{ + private readonly IBlobContainer _blobContainer; + + public MyService(IBlobContainer blobContainer) + { + _blobContainer = blobContainer; + } + + public async Task SaveBlobAsync(byte[] bytes) + { + await _blobContainer.SaveAsync("my-blob-name", bytes); + } + + public async Task GetBlobAsync() + { + return await _blobContainer.GetAllBytesAsync("my-blob-name"); + } +} +``` + +## 配置选项 + +* Repository - Nexus 仓库名称 + +## 最佳实践 + +1. 合理规划文件路径和命名,便于管理和维护 +2. 根据实际需求配置文件覆盖选项 +3. 合理使用多租户功能,确保数据隔离 + +## 注意事项 + +1. 确保 Nexus 仓库已正确配置并可访问 +2. 文件路径会被自动规范化,将反斜杠替换为正斜杠 +3. 默认情况下不允许覆盖已存在的文件,需要显式设置 OverrideExisting 选项 +4. 文件操作可能会受到网络状况的影响,建议添加适当的错误处理机制 diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/README.EN.md b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/README.EN.md new file mode 100644 index 000000000..c24374857 --- /dev/null +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/README.EN.md @@ -0,0 +1,120 @@ +# LINGYUN.Abp.Sonatype.Nexus + +[简体中文](./README.md) | English + +ABP framework integration module for Sonatype Nexus REST API. + +## Features + +* Support for Nexus repository management +* Support for component management +* Support for asset management +* Support for search functionality +* Support for basic authentication + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpSonatypeNexusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +### 1. Configure Nexus Connection + +Configure Nexus connection options in `appsettings.json`: + +```json +{ + "SonatypeNexus": { + "BaseUrl": "http://127.0.0.1:8081", + "UserName": "sonatype", + "Password": "sonatype" + } +} +``` + +### 2. Use Repository Management + +```csharp +public class MyService +{ + private readonly INexusRepositoryManager _repositoryManager; + + public MyService(INexusRepositoryManager repositoryManager) + { + _repositoryManager = repositoryManager; + } + + public async Task> GetRepositoriesAsync() + { + var result = await _repositoryManager.ListAsync(); + return result.Items; + } +} +``` + +### 3. Use Component Management + +```csharp +public class MyService +{ + private readonly INexusComponentManager _componentManager; + + public MyService(INexusComponentManager componentManager) + { + _componentManager = componentManager; + } + + public async Task UploadComponentAsync(string repository, string directory, byte[] fileBytes) + { + var asset = new Asset("filename.txt", fileBytes); + var args = new NexusRawBlobUploadArgs(repository, directory, asset); + await _componentManager.UploadAsync(args); + } +} +``` + +### 4. Use Asset Management + +```csharp +public class MyService +{ + private readonly INexusAssetManager _assetManager; + + public MyService(INexusAssetManager assetManager) + { + _assetManager = assetManager; + } + + public async Task> GetAssetsAsync(string repository) + { + var result = await _assetManager.ListAsync(repository); + return result.Items; + } +} +``` + +## Configuration Options + +* BaseUrl - Nexus server address +* UserName - Username +* Password - Password + +## Best Practices + +1. Keep authentication information secure +2. Plan repository structure and component classification properly +3. Regularly clean up unnecessary components and assets +4. Use appropriate error handling mechanisms + +## Notes + +1. Ensure Nexus server is properly configured and accessible +2. Consider network conditions and timeout settings when uploading large files +3. Delete operations are irreversible, proceed with caution +4. Some operations require administrator privileges diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/README.md b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/README.md new file mode 100644 index 000000000..c26deb4aa --- /dev/null +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/README.md @@ -0,0 +1,120 @@ +# LINGYUN.Abp.Sonatype.Nexus + +[English](./README.EN.md) | 简体中文 + +Sonatype Nexus REST API 的 ABP 框架集成模块。 + +## 功能 + +* 支持 Nexus 仓库管理 +* 支持组件(Component)管理 +* 支持资源(Asset)管理 +* 支持搜索功能 +* 支持基本认证 + +## 模块依赖 + +```csharp +[DependsOn(typeof(AbpSonatypeNexusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +### 1. 配置 Nexus 连接 + +在 `appsettings.json` 中配置 Nexus 连接选项: + +```json +{ + "SonatypeNexus": { + "BaseUrl": "http://127.0.0.1:8081", + "UserName": "sonatype", + "Password": "sonatype" + } +} +``` + +### 2. 使用仓库管理 + +```csharp +public class MyService +{ + private readonly INexusRepositoryManager _repositoryManager; + + public MyService(INexusRepositoryManager repositoryManager) + { + _repositoryManager = repositoryManager; + } + + public async Task> GetRepositoriesAsync() + { + var result = await _repositoryManager.ListAsync(); + return result.Items; + } +} +``` + +### 3. 使用组件管理 + +```csharp +public class MyService +{ + private readonly INexusComponentManager _componentManager; + + public MyService(INexusComponentManager componentManager) + { + _componentManager = componentManager; + } + + public async Task UploadComponentAsync(string repository, string directory, byte[] fileBytes) + { + var asset = new Asset("filename.txt", fileBytes); + var args = new NexusRawBlobUploadArgs(repository, directory, asset); + await _componentManager.UploadAsync(args); + } +} +``` + +### 4. 使用资源管理 + +```csharp +public class MyService +{ + private readonly INexusAssetManager _assetManager; + + public MyService(INexusAssetManager assetManager) + { + _assetManager = assetManager; + } + + public async Task> GetAssetsAsync(string repository) + { + var result = await _assetManager.ListAsync(repository); + return result.Items; + } +} +``` + +## 配置选项 + +* BaseUrl - Nexus 服务器地址 +* UserName - 用户名 +* Password - 密码 + +## 最佳实践 + +1. 妥善保管认证信息,避免泄露 +2. 合理规划仓库结构和组件分类 +3. 定期清理不需要的组件和资源 +4. 使用适当的错误处理机制 + +## 注意事项 + +1. 确保 Nexus 服务器已正确配置并可访问 +2. 上传大文件时需要注意网络状况和超时设置 +3. 删除操作不可恢复,请谨慎操作 +4. 部分操作需要管理员权限 diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/README.EN.md b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/README.EN.md new file mode 100644 index 000000000..e86616a03 --- /dev/null +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/README.EN.md @@ -0,0 +1,104 @@ +# LINGYUN.Abp.OpenApi.Authorization + +OpenApi authentication authorization middleware module, providing AppKey/AppSecret based API signature authentication middleware functionality for ABP applications. + +## Features + +* Provides OpenApi authentication middleware +* Supports request signature verification +* Supports replay attack prevention (Nonce random number verification) +* Supports request timestamp verification +* Supports client whitelist verification +* Supports IP address whitelist verification +* Supports custom authentication logic +* Supports exception handling and error message wrapping + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenApi.Authorization +``` + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpOpenApiAuthorizationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Enable OpenApi Authentication Middleware + ```csharp + public void Configure(IApplicationBuilder app) + { + // Add OpenApi authentication middleware + app.UseOpenApiAuthorization(); + } + ``` + +2. Custom Authentication Service (Optional) + ```csharp + public class CustomOpenApiAuthorizationService : OpenApiAuthorizationService + { + public CustomOpenApiAuthorizationService( + INonceStore nonceStore, + IAppKeyStore appKeyStore, + IClientChecker clientChecker, + IIpAddressChecker ipAddressChecker, + IWebClientInfoProvider clientInfoProvider, + IOptionsMonitor options, + IOptions exceptionHandlingOptions) + : base(nonceStore, appKeyStore, clientChecker, ipAddressChecker, + clientInfoProvider, options, exceptionHandlingOptions) + { + } + + // Override authentication logic + public override async Task AuthorizeAsync(HttpContext httpContext) + { + // Implement custom authentication logic + return await base.AuthorizeAsync(httpContext); + } + } + ``` + +## Authentication Process + +1. Validate Client IP Address + * Verify if the client IP address is within the allowed range through the `IIpAddressChecker` interface + +2. Validate Application Credentials + * Verify AppKey, signature, nonce, and timestamp in request headers + * Get application information through the `IAppKeyStore` interface + * Verify client access permission through the `IClientChecker` interface + * Validate signature validity and timeliness + +## Signature Rules + +1. Sort request parameters by parameter name in ASCII order +2. Convert sorted parameters to query string using URL encoding (UTF-8) +3. Concatenate request path and query string, then perform MD5 encryption to get the signature + +Example: +``` +Request path: /api/test +Parameters: + appKey=test + appSecret=123456 + nonce=abc + t=1577808000000 + +Signature calculation: +1. Sort and concatenate parameters: appKey=test&appSecret=123456&nonce=abc&t=1577808000000 +2. Concatenate with request path: /api/test?appKey=test&appSecret=123456&nonce=abc&t=1577808000000 +3. URL encode and MD5 encrypt to get the final signature +``` + +## More Information + +* [LINGYUN.Abp.OpenApi](../LINGYUN.Abp.OpenApi/README.md) +* [ABP Framework](https://abp.io/) diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/README.md b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/README.md new file mode 100644 index 000000000..893d3c8e5 --- /dev/null +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/README.md @@ -0,0 +1,104 @@ +# LINGYUN.Abp.OpenApi.Authorization + +OpenApi 认证授权中间件模块,为 ABP 应用程序提供基于 AppKey/AppSecret 的 API 签名认证中间件功能。 + +## 功能特性 + +* 提供 OpenApi 认证中间件 +* 支持请求签名验证 +* 支持防重放攻击(Nonce随机数验证) +* 支持请求时间戳验证 +* 支持客户端白名单验证 +* 支持IP地址白名单验证 +* 支持自定义认证逻辑 +* 支持异常处理和错误信息包装 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenApi.Authorization +``` + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpOpenApiAuthorizationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 启用 OpenApi 认证中间件 + ```csharp + public void Configure(IApplicationBuilder app) + { + // 添加 OpenApi 认证中间件 + app.UseOpenApiAuthorization(); + } + ``` + +2. 自定义认证服务(可选) + ```csharp + public class CustomOpenApiAuthorizationService : OpenApiAuthorizationService + { + public CustomOpenApiAuthorizationService( + INonceStore nonceStore, + IAppKeyStore appKeyStore, + IClientChecker clientChecker, + IIpAddressChecker ipAddressChecker, + IWebClientInfoProvider clientInfoProvider, + IOptionsMonitor options, + IOptions exceptionHandlingOptions) + : base(nonceStore, appKeyStore, clientChecker, ipAddressChecker, + clientInfoProvider, options, exceptionHandlingOptions) + { + } + + // 重写认证逻辑 + public override async Task AuthorizeAsync(HttpContext httpContext) + { + // 实现自定义认证逻辑 + return await base.AuthorizeAsync(httpContext); + } + } + ``` + +## 认证流程 + +1. 验证客户端IP地址 + * 通过 `IIpAddressChecker` 接口验证客户端IP地址是否在允许范围内 + +2. 验证应用凭证 + * 验证请求头中的 AppKey、签名、随机数和时间戳 + * 通过 `IAppKeyStore` 接口获取应用信息 + * 通过 `IClientChecker` 接口验证客户端是否允许访问 + * 验证签名的有效性和时效性 + +## 签名规则 + +1. 请求参数按照参数名ASCII码从小到大排序 +2. 使用URL编码(UTF-8)将排序后的参数转换为查询字符串 +3. 将请求路径和查询字符串拼接后进行MD5加密得到签名 + +示例: +``` +请求路径:/api/test +参数: + appKey=test + appSecret=123456 + nonce=abc + t=1577808000000 + +签名计算: +1. 参数排序并拼接:appKey=test&appSecret=123456&nonce=abc&t=1577808000000 +2. 拼接请求路径:/api/test?appKey=test&appSecret=123456&nonce=abc&t=1577808000000 +3. URL编码并MD5加密得到最终签名 +``` + +## 更多信息 + +* [LINGYUN.Abp.OpenApi](../LINGYUN.Abp.OpenApi/README.md) +* [ABP框架](https://abp.io/) diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/README.EN.md b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/README.EN.md new file mode 100644 index 000000000..f58b03b06 --- /dev/null +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/README.EN.md @@ -0,0 +1,93 @@ +# LINGYUN.Abp.OpenApi.IdentityServer + +OpenApi IdentityServer integration module, providing IdentityServer-based AppKey/AppSecret storage implementation. + +## Features + +* IdentityServer-based AppKey/AppSecret storage +* Automatic mapping of AppKey to IdentityServer client identifier +* Automatic mapping of AppSecret to client secret +* Support for signature validity period configuration +* Support for client name configuration +* Automatic creation and update of client information + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenApi.IdentityServer +``` + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpOpenApiIdentityServerModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## How It Works + +1. AppKey Mapping + * AppKey is mapped to IdentityServer's ClientId + * Client query and management through the `IClientRepository` interface + +2. AppSecret Mapping + * AppSecret is mapped to client secret + * Secret is stored with AppSecret as identifier + +3. Signature Validity Period + * SignLifetime is stored as a custom property of the client + * Property name is "SignLifetime", value is validity period in seconds + +## Basic Usage + +1. Store Application Credentials + ```csharp + public class YourService + { + private readonly IAppKeyStore _appKeyStore; + + public YourService(IAppKeyStore appKeyStore) + { + _appKeyStore = appKeyStore; + } + + public async Task CreateAppAsync() + { + var descriptor = new AppDescriptor( + appName: "Test Application", + appKey: "your-app-key", + appSecret: "your-app-secret", + signLifeTime: 300 // 5 minutes validity + ); + + await _appKeyStore.StoreAsync(descriptor); + } + } + ``` + +2. Query Application Credentials + ```csharp + public class YourService + { + private readonly IAppKeyStore _appKeyStore; + + public YourService(IAppKeyStore appKeyStore) + { + _appKeyStore = appKeyStore; + } + + public async Task GetAppAsync(string appKey) + { + return await _appKeyStore.FindAsync(appKey); + } + } + ``` + +## More Information + +* [LINGYUN.Abp.OpenApi](../LINGYUN.Abp.OpenApi/README.md) +* [LINGYUN.Abp.OpenApi.Authorization](../LINGYUN.Abp.OpenApi.Authorization/README.md) +* [IdentityServer](https://identityserver4.readthedocs.io/) diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/README.md b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/README.md new file mode 100644 index 000000000..2b9191912 --- /dev/null +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/README.md @@ -0,0 +1,93 @@ +# LINGYUN.Abp.OpenApi.IdentityServer + +OpenApi IdentityServer 集成模块,提供基于 IdentityServer 的 AppKey/AppSecret 存储实现。 + +## 功能特性 + +* 基于 IdentityServer 的 AppKey/AppSecret 存储 +* 自动将 AppKey 映射为 IdentityServer 客户端标识 +* 自动将 AppSecret 映射为客户端密钥 +* 支持签名有效期配置 +* 支持客户端名称配置 +* 自动创建和更新客户端信息 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenApi.IdentityServer +``` + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpOpenApiIdentityServerModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 工作原理 + +1. AppKey 映射 + * AppKey 将被映射为 IdentityServer 的 ClientId + * 通过 `IClientRepository` 接口进行客户端查询和管理 + +2. AppSecret 映射 + * AppSecret 将被映射为客户端密钥(Client Secret) + * 密钥将以 AppSecret 作为标识存储 + +3. 签名有效期 + * SignLifetime 将被存储为客户端的自定义属性 + * 属性名为 "SignLifetime",值为有效期秒数 + +## 基本用法 + +1. 存储应用凭证 + ```csharp + public class YourService + { + private readonly IAppKeyStore _appKeyStore; + + public YourService(IAppKeyStore appKeyStore) + { + _appKeyStore = appKeyStore; + } + + public async Task CreateAppAsync() + { + var descriptor = new AppDescriptor( + appName: "测试应用", + appKey: "your-app-key", + appSecret: "your-app-secret", + signLifeTime: 300 // 5分钟有效期 + ); + + await _appKeyStore.StoreAsync(descriptor); + } + } + ``` + +2. 查询应用凭证 + ```csharp + public class YourService + { + private readonly IAppKeyStore _appKeyStore; + + public YourService(IAppKeyStore appKeyStore) + { + _appKeyStore = appKeyStore; + } + + public async Task GetAppAsync(string appKey) + { + return await _appKeyStore.FindAsync(appKey); + } + } + ``` + +## 更多信息 + +* [LINGYUN.Abp.OpenApi](../LINGYUN.Abp.OpenApi/README.md) +* [LINGYUN.Abp.OpenApi.Authorization](../LINGYUN.Abp.OpenApi.Authorization/README.md) +* [IdentityServer](https://identityserver4.readthedocs.io/) diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/README.EN.md b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/README.EN.md new file mode 100644 index 000000000..532707bac --- /dev/null +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/README.EN.md @@ -0,0 +1,105 @@ +# LINGYUN.Abp.OpenApi + +OpenApi authentication module, providing AppKey/AppSecret based API signature authentication functionality for ABP applications. + +## Features + +* Supports AppKey/AppSecret authentication +* Supports request signature verification +* Supports replay attack prevention (Nonce random number verification) +* Supports request timestamp verification +* Supports client whitelist +* Supports IP address whitelist +* Supports multilingual error messages + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenApi +``` + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpOpenApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "OpenApi": { + "IsEnabled": true, // Enable API signature check, default: true + "RequestNonceExpireIn": "00:10:00", // Request nonce expiration time, default: 10 minutes + "AppDescriptors": [ // AppKey configuration list + { + "AppName": "Test Application", // Application name + "AppKey": "your-app-key", // Application key + "AppSecret": "your-app-secret", // Application secret + "AppToken": "optional-token", // Optional application token + "SignLifetime": 300 // Signature validity period (seconds) + } + ] + } +} +``` + +## Basic Usage + +1. Configure AppKey/AppSecret + * Add AppKey and AppSecret in the configuration file + * Or implement custom `IAppKeyStore` interface to manage AppKey + +2. Enable OpenApi Authentication + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("OpenApi")); + } + ``` + +3. Custom Client Verification (Optional) + ```csharp + public class CustomClientChecker : IClientChecker + { + public Task IsGrantAsync(string clientId, CancellationToken cancellationToken = default) + { + // Implement custom client verification logic + return Task.FromResult(true); + } + } + ``` + +4. Custom IP Address Verification (Optional) + ```csharp + public class CustomIpAddressChecker : IIpAddressChecker + { + public Task IsGrantAsync(string ipAddress, CancellationToken cancellationToken = default) + { + // Implement custom IP address verification logic + return Task.FromResult(true); + } + } + ``` + +## Error Codes + +* AbpOpenApi:9100 - Invalid AppKey +* AbpOpenApi:9101 - AppKey not found +* AbpOpenApi:9110 - Invalid sign +* AbpOpenApi:9111 - Sign not found +* AbpOpenApi:9210 - Request timed out or session expired +* AbpOpenApi:9211 - Timestamp not found +* AbpOpenApi:9220 - Repeatedly initiated requests +* AbpOpenApi:9221 - Nonce not found +* AbpOpenApi:9300 - Client is not within the allowed range +* AbpOpenApi:9400 - Client IP is not within the allowed range + +## More Information + +* [ABP Framework](https://abp.io/) diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/README.md b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/README.md new file mode 100644 index 000000000..0d0086b2d --- /dev/null +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/README.md @@ -0,0 +1,105 @@ +# LINGYUN.Abp.OpenApi + +OpenApi 认证模块,为 ABP 应用程序提供基于 AppKey/AppSecret 的 API 签名认证功能。 + +## 功能特性 + +* 支持 AppKey/AppSecret 认证 +* 支持请求签名验证 +* 支持防重放攻击(Nonce随机数验证) +* 支持请求时间戳验证 +* 支持客户端白名单 +* 支持IP地址白名单 +* 支持多语言错误消息 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenApi +``` + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpOpenApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "OpenApi": { + "IsEnabled": true, // 是否启用API签名检查,默认: true + "RequestNonceExpireIn": "00:10:00", // 请求随机数过期时间,默认: 10分钟 + "AppDescriptors": [ // AppKey配置列表 + { + "AppName": "测试应用", // 应用名称 + "AppKey": "你的AppKey", // 应用标识 + "AppSecret": "你的AppSecret", // 应用密钥 + "AppToken": "可选的Token", // 可选的应用令牌 + "SignLifetime": 300 // 签名有效期(秒) + } + ] + } +} +``` + +## 基本用法 + +1. 配置 AppKey/AppSecret + * 在配置文件中添加 AppKey 和 AppSecret + * 或者实现自定义的 `IAppKeyStore` 接口来管理 AppKey + +2. 启用 OpenApi 认证 + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("OpenApi")); + } + ``` + +3. 自定义客户端验证(可选) + ```csharp + public class CustomClientChecker : IClientChecker + { + public Task IsGrantAsync(string clientId, CancellationToken cancellationToken = default) + { + // 实现自定义的客户端验证逻辑 + return Task.FromResult(true); + } + } + ``` + +4. 自定义IP地址验证(可选) + ```csharp + public class CustomIpAddressChecker : IIpAddressChecker + { + public Task IsGrantAsync(string ipAddress, CancellationToken cancellationToken = default) + { + // 实现自定义的IP地址验证逻辑 + return Task.FromResult(true); + } + } + ``` + +## 错误代码 + +* AbpOpenApi:9100 - 无效的应用标识 +* AbpOpenApi:9101 - 未携带应用标识 +* AbpOpenApi:9110 - 无效的签名 +* AbpOpenApi:9111 - 未携带签名 +* AbpOpenApi:9210 - 请求超时或会话已过期 +* AbpOpenApi:9211 - 未携带时间戳标识 +* AbpOpenApi:9220 - 重复发起的请求 +* AbpOpenApi:9221 - 未携带随机数 +* AbpOpenApi:9300 - 客户端不在允许的范围内 +* AbpOpenApi:9400 - 客户端IP不在允许的范围内 + +## 更多信息 + +* [ABP框架](https://abp.io/) diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/README.EN.md b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/README.EN.md new file mode 100644 index 000000000..167570e70 --- /dev/null +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/README.EN.md @@ -0,0 +1,80 @@ +# LINGYUN.Abp.PushPlus.SettingManagement + +PushPlus settings management module, providing management interface and API endpoints for PushPlus configuration. + +## Features + +* Provides PushPlus configuration management API +* Supports global configuration management +* Supports tenant configuration management +* Supports multilingual +* Integrates with ABP settings management module + +## Installation + +```bash +dotnet add package LINGYUN.Abp.PushPlus.SettingManagement +``` + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpPushPlusSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Endpoints + +### Get Global Configuration + +```http +GET /api/setting-management/push-plus/by-global +``` + +Response example: +```json +{ + "name": "PushPlus", + "displayName": "PushPlus Configuration", + "settings": [ + { + "name": "PushPlus.Security.Token", + "value": "your-token", + "displayName": "Token", + "description": "Token obtained from PushPlus platform" + }, + { + "name": "PushPlus.Security.SecretKey", + "value": "your-secret", + "displayName": "Secret Key", + "description": "Secret key obtained from PushPlus platform" + } + ] +} +``` + +### Get Tenant Configuration + +```http +GET /api/setting-management/push-plus/by-current-tenant +``` + +Response format is the same as global configuration. + +## Permissions + +* Abp.PushPlus.ManageSetting - Permission to manage PushPlus configuration + +## Localization + +The module supports the following languages: +* Simplified Chinese +* English + +## More Information + +* [LINGYUN.Abp.PushPlus](../LINGYUN.Abp.PushPlus/README.md) +* [ABP Settings Management](https://docs.abp.io/en/abp/latest/Settings) diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/README.md b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/README.md new file mode 100644 index 000000000..995415d14 --- /dev/null +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/README.md @@ -0,0 +1,80 @@ +# LINGYUN.Abp.PushPlus.SettingManagement + +PushPlus 设置管理模块,提供 PushPlus 配置的管理界面和API接口。 + +## 功能特性 + +* 提供 PushPlus 配置管理接口 +* 支持全局配置管理 +* 支持租户配置管理 +* 支持多语言 +* 集成 ABP 设置管理模块 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.PushPlus.SettingManagement +``` + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpPushPlusSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API接口 + +### 获取全局配置 + +```http +GET /api/setting-management/push-plus/by-global +``` + +响应示例: +```json +{ + "name": "PushPlus", + "displayName": "PushPlus配置", + "settings": [ + { + "name": "PushPlus.Security.Token", + "value": "your-token", + "displayName": "Token", + "description": "PushPlus平台获取的Token" + }, + { + "name": "PushPlus.Security.SecretKey", + "value": "your-secret", + "displayName": "密钥", + "description": "PushPlus平台获取的密钥" + } + ] +} +``` + +### 获取租户配置 + +```http +GET /api/setting-management/push-plus/by-current-tenant +``` + +响应格式同全局配置。 + +## 权限 + +* Abp.PushPlus.ManageSetting - 管理PushPlus配置的权限 + +## 本地化 + +模块支持以下语言: +* 中文简体 +* 英文 + +## 更多信息 + +* [LINGYUN.Abp.PushPlus](../LINGYUN.Abp.PushPlus/README.md) +* [ABP设置管理](https://docs.abp.io/en/abp/latest/Settings) diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/README.EN.md b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/README.EN.md new file mode 100644 index 000000000..fb91dea8a --- /dev/null +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/README.EN.md @@ -0,0 +1,122 @@ +# LINGYUN.Abp.PushPlus + +Integration with PushPlus + +Implements PushPlus related API documentation, providing PushPlus open capabilities. + +For details, see PushPlus documentation: https://www.pushplus.plus/doc/guide/openApi.html + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpPushPlusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Features + +* PushPlus PushPlus feature group +* PushPlus.Message.Enable Enable PushPlus message channel globally +* PushPlus.Channel.WeChat WeChat public account message channel +* PushPlus.Channel.WeChat.Enable Enable WeChat public account message channel +* PushPlus.Channel.WeChat.SendLimit WeChat public account message channel send limit +* PushPlus.Channel.WeChat.SendLimitInterval WeChat public account message channel limit period (days) +* PushPlus.Channel.WeWork WeWork message channel +* PushPlus.Channel.WeWork.Enable Enable WeWork message channel +* PushPlus.Channel.WeWork.SendLimit WeWork message channel send limit +* PushPlus.Channel.WeWork.SendLimitInterval WeWork message channel limit period (days) +* PushPlus.Channel.Webhook Webhook message channel +* PushPlus.Channel.Webhook.Enable Enable Webhook message channel +* PushPlus.Channel.Webhook.SendLimit Webhook message channel send limit +* PushPlus.Channel.Webhook.SendLimitInterval Webhook message channel limit period (days) +* PushPlus.Channel.Email Email message channel +* PushPlus.Channel.Email.Enable Enable Email message channel +* PushPlus.Channel.Email.SendLimit Email message channel send limit +* PushPlus.Channel.Email.SendLimitInterval Email message channel limit period (days) +* PushPlus.Channel.Sms SMS message channel +* PushPlus.Channel.Sms.Enable Enable SMS message channel +* PushPlus.Channel.Sms.SendLimit SMS message channel send limit +* PushPlus.Channel.Sms.SendLimitInterval SMS message channel limit period (days) + +## Configuration + +```json +{ + "PushPlus": { + "Security": { + "Token": "your-pushplus-token", // Token obtained from PushPlus platform + "SecretKey": "your-pushplus-secret" // Secret key obtained from PushPlus platform + } + } +} +``` + +## Basic Usage + +1. Configure PushPlus Credentials + * Get Token and Secret key from PushPlus platform + * Set Token and Secret key in configuration file + +2. Send Messages + ```csharp + public class YourService + { + private readonly IPushPlusMessageSender _messageSender; + + public YourService(IPushPlusMessageSender messageSender) + { + _messageSender = messageSender; + } + + public async Task SendMessageAsync() + { + // Send WeChat message + await _messageSender.SendWeChatAsync( + title: "Message Title", + content: "Message Content", + topic: "Optional Topic", + template: PushPlusMessageTemplate.Html + ); + + // Send WeWork message + await _messageSender.SendWeWorkAsync( + title: "Message Title", + content: "Message Content" + ); + + // Send Email + await _messageSender.SendEmailAsync( + title: "Email Title", + content: "Email Content" + ); + + // Send SMS + await _messageSender.SendSmsAsync( + title: "SMS Title", + content: "SMS Content" + ); + + // Send Webhook message + await _messageSender.SendWebhookAsync( + title: "Message Title", + content: "Message Content", + webhook: "webhook-url" + ); + } + } + ``` + +## Message Templates + +* Html - HTML format (default) +* Text - Plain text format +* Json - JSON format +* Markdown - Markdown format + +## More Information + +* [PushPlus Documentation](https://www.pushplus.plus/doc/guide/openApi.html) +* [ABP Framework](https://abp.io/) diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/README.md b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/README.md index fa982ac69..4535ee922 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/README.md +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/README.md @@ -40,3 +40,83 @@ public class YouProjectModule : AbpModule * PushPlus.Channel.Sms.Enable 启用短信消息通道 * PushPlus.Channel.Sms.SendLimit 短信消息通道限制次数 * PushPlus.Channel.Sms.SendLimitInterval 短信消息通道限制周期(天) + +## 配置项 + +```json +{ + "PushPlus": { + "Security": { + "Token": "你的PushPlus Token", // PushPlus平台获取的Token + "SecretKey": "你的PushPlus密钥" // PushPlus平台获取的密钥 + } + } +} +``` + +## 基本用法 + +1. 配置 PushPlus 凭证 + * 在PushPlus平台获取Token和密钥 + * 在配置文件中设置Token和密钥 + +2. 发送消息 + ```csharp + public class YourService + { + private readonly IPushPlusMessageSender _messageSender; + + public YourService(IPushPlusMessageSender messageSender) + { + _messageSender = messageSender; + } + + public async Task SendMessageAsync() + { + // 发送微信消息 + await _messageSender.SendWeChatAsync( + title: "消息标题", + content: "消息内容", + topic: "可选的主题", + template: PushPlusMessageTemplate.Html + ); + + // 发送企业微信消息 + await _messageSender.SendWeWorkAsync( + title: "消息标题", + content: "消息内容" + ); + + // 发送邮件 + await _messageSender.SendEmailAsync( + title: "邮件标题", + content: "邮件内容" + ); + + // 发送短信 + await _messageSender.SendSmsAsync( + title: "短信标题", + content: "短信内容" + ); + + // 发送Webhook消息 + await _messageSender.SendWebhookAsync( + title: "消息标题", + content: "消息内容", + webhook: "webhook地址" + ); + } + } + ``` + +## 消息模板 + +* Html - HTML格式(默认) +* Text - 纯文本格式 +* Json - JSON格式 +* Markdown - Markdown格式 + +## 更多信息 + +* [PushPlus官方文档](https://www.pushplus.plus/doc/guide/openApi.html) +* [ABP框架](https://abp.io/) diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/README.EN.md b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/README.EN.md new file mode 100644 index 000000000..3ad4ed0de --- /dev/null +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/README.EN.md @@ -0,0 +1,70 @@ +# LINGYUN.Abp.Rules.NRules + +## Module Description + +Rule engine implementation module based on [NRules](https://github.com/NRules/NRules). + +### Base Modules + +* LINGYUN.Abp.Rules + +### Features + +* Provides rule engine implementation based on NRules +* Supports automatic rule registration through dependency injection +* Supports dynamic rule loading and execution + +### Configuration + +* AbpNRulesOptions + * DefinitionRules - List of defined rules, used to store all rule types registered through dependency injection + +### How to Use + +1. Add `AbpNRulesModule` dependency + +```csharp +[DependsOn(typeof(AbpNRulesModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Create a rule class + +```csharp +public class YourRule : RuleBase +{ + public override void Define() + { + // Define rule conditions and actions + When() + .Match(x => x.SomeCondition); + Then() + .Do(ctx => /* Execute rule action */); + } +} +``` + +3. Register and execute rules + +```csharp +public class YourService +{ + private readonly IRuleProvider _ruleProvider; + + public YourService(IRuleProvider ruleProvider) + { + _ruleProvider = ruleProvider; + } + + public async Task ProcessAsync() + { + var input = new YourInput(); + // Execute rule validation + await _ruleProvider.ExecuteAsync(input); + } +} +``` + +[Back to TOC](../../../README.md) diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/README.md b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/README.md new file mode 100644 index 000000000..4999f8d01 --- /dev/null +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/README.md @@ -0,0 +1,70 @@ +# LINGYUN.Abp.Rules.NRules + +## 模块说明 + +基于 [NRules](https://github.com/NRules/NRules) 的规则引擎实现模块。 + +### 基础模块 + +* LINGYUN.Abp.Rules + +### 功能定义 + +* 提供基于 NRules 的规则引擎实现 +* 支持通过依赖注入自动注册规则 +* 支持规则的动态加载和执行 + +### 配置定义 + +* AbpNRulesOptions + * DefinitionRules - 定义规则列表,用于存储所有通过依赖注入注册的规则类型 + +### 如何使用 + +1. 添加 `AbpNRulesModule` 依赖 + +```csharp +[DependsOn(typeof(AbpNRulesModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 创建规则类 + +```csharp +public class YourRule : RuleBase +{ + public override void Define() + { + // 定义规则条件和动作 + When() + .Match(x => x.SomeCondition); + Then() + .Do(ctx => /* 执行规则动作 */); + } +} +``` + +3. 注册规则并执行 + +```csharp +public class YourService +{ + private readonly IRuleProvider _ruleProvider; + + public YourService(IRuleProvider ruleProvider) + { + _ruleProvider = ruleProvider; + } + + public async Task ProcessAsync() + { + var input = new YourInput(); + // 执行规则验证 + await _ruleProvider.ExecuteAsync(input); + } +} +``` + +[返回目录](../../../README.md) diff --git a/aspnet-core/framework/security/LINGYUN.Abp.Security/README.EN.md b/aspnet-core/framework/security/LINGYUN.Abp.Security/README.EN.md new file mode 100644 index 000000000..ea633b84b --- /dev/null +++ b/aspnet-core/framework/security/LINGYUN.Abp.Security/README.EN.md @@ -0,0 +1,38 @@ +# LINGYUN.Abp.Security + +## Module Description + +Extends the Abp Security module, providing additional security features. + +### Base Modules + +* Volo.Abp.Security + +### Features + +* Provides JWT Claims type mapping functionality +* Extends standard JWT Claims type definitions + +### Configuration + +No special configuration items + +### How to Use + +1. Add `AbpSecurityModule` dependency + +```csharp +[DependsOn(typeof(AbpSecurityModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Use JWT Claims mapping + +```csharp +// JWT Claims type mapping is done automatically, no manual configuration needed +// If you need custom mapping, you can configure it in the module's ConfigureServices method +``` + +[Back to TOC](../../../README.md) diff --git a/aspnet-core/framework/security/LINGYUN.Abp.Security/README.md b/aspnet-core/framework/security/LINGYUN.Abp.Security/README.md new file mode 100644 index 000000000..03110d2bb --- /dev/null +++ b/aspnet-core/framework/security/LINGYUN.Abp.Security/README.md @@ -0,0 +1,38 @@ +# LINGYUN.Abp.Security + +## 模块说明 + +扩展 Abp Security 模块,提供额外的安全功能。 + +### 基础模块 + +* Volo.Abp.Security + +### 功能定义 + +* 提供 JWT Claims 类型映射功能 +* 扩展了标准的 JWT Claims 类型定义 + +### 配置定义 + +无特殊配置项 + +### 如何使用 + +1. 添加 `AbpSecurityModule` 依赖 + +```csharp +[DependsOn(typeof(AbpSecurityModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 使用 JWT Claims 映射 + +```csharp +// JWT Claims 类型映射会自动完成,无需手动配置 +// 如果需要自定义映射,可以在模块的 ConfigureServices 方法中进行配置 +``` + +[返回目录](../../../README.md) diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/README.EN.md b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..439936a55 --- /dev/null +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/README.EN.md @@ -0,0 +1,85 @@ +# LINGYUN.Abp.SettingManagement.Application.Contracts + +## Module Description + +Setting management application service contracts module, providing interface definitions and DTOs for setting management. + +### Base Modules + +* Volo.Abp.SettingManagement.Application.Contracts +* Volo.Abp.Ddd.Application.Contracts + +### Features + +* Provides setting management application service interfaces + * ISettingAppService - General setting management service + * IUserSettingAppService - User setting management service + * IReadonlySettingAppService - Read-only setting service +* Provides setting-related DTO definitions + * SettingGroupDto - Setting group DTO + * SettingDto - Setting DTO + * SettingDetailsDto - Setting details DTO + * UpdateSettingDto - Update setting DTO +* Provides setting management related permission definitions + +### Permissions + +* SettingManagement.ManageHostFeatures - Manage host features +* SettingManagement.ManageFeatures - Manage features +* SettingManagement.Settings - Setting management +* SettingManagement.Settings.Update - Update settings +* SettingManagement.Settings.ManageGroup - Manage setting groups + +### Configuration + +* SettingManagementMergeOptions + * EnableCustomize - Enable custom settings + * EnableHost - Enable host settings + * EnableTenant - Enable tenant settings + * EnableUser - Enable user settings + +### How to Use + +1. Add `AbpSettingManagementApplicationContractsModule` dependency + +```csharp +[DependsOn(typeof(AbpSettingManagementApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Inject and use setting services + +```csharp +public class YourService +{ + private readonly ISettingAppService _settingAppService; + + public YourService(ISettingAppService settingAppService) + { + _settingAppService = settingAppService; + } + + public async Task ManageSettingsAsync() + { + // Get setting groups + var groups = await _settingAppService.GetAllGroupsAsync(); + + // Update settings + await _settingAppService.UpdateAsync("GroupName", new UpdateSettingsDto + { + Settings = new List + { + new UpdateSettingDto + { + Name = "SettingName", + Value = "NewValue" + } + } + }); + } +} +``` + +[Back to TOC](../../../README.md) diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/README.md b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/README.md new file mode 100644 index 000000000..91fc59f21 --- /dev/null +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/README.md @@ -0,0 +1,85 @@ +# LINGYUN.Abp.SettingManagement.Application.Contracts + +## 模块说明 + +设置管理应用服务契约模块,提供设置管理相关的接口定义和DTO。 + +### 基础模块 + +* Volo.Abp.SettingManagement.Application.Contracts +* Volo.Abp.Ddd.Application.Contracts + +### 功能定义 + +* 提供设置管理的应用服务接口定义 + * ISettingAppService - 通用设置管理服务 + * IUserSettingAppService - 用户设置管理服务 + * IReadonlySettingAppService - 只读设置服务 +* 提供设置相关的DTO定义 + * SettingGroupDto - 设置组DTO + * SettingDto - 设置DTO + * SettingDetailsDto - 设置详情DTO + * UpdateSettingDto - 更新设置DTO +* 提供设置管理相关的权限定义 + +### 权限定义 + +* SettingManagement.ManageHostFeatures - 管理主机功能 +* SettingManagement.ManageFeatures - 管理功能 +* SettingManagement.Settings - 设置管理 +* SettingManagement.Settings.Update - 更新设置 +* SettingManagement.Settings.ManageGroup - 管理设置组 + +### 配置定义 + +* SettingManagementMergeOptions + * EnableCustomize - 是否启用自定义设置 + * EnableHost - 是否启用主机设置 + * EnableTenant - 是否启用租户设置 + * EnableUser - 是否启用用户设置 + +### 如何使用 + +1. 添加 `AbpSettingManagementApplicationContractsModule` 依赖 + +```csharp +[DependsOn(typeof(AbpSettingManagementApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 注入并使用设置服务 + +```csharp +public class YourService +{ + private readonly ISettingAppService _settingAppService; + + public YourService(ISettingAppService settingAppService) + { + _settingAppService = settingAppService; + } + + public async Task ManageSettingsAsync() + { + // 获取设置组 + var groups = await _settingAppService.GetAllGroupsAsync(); + + // 更新设置 + await _settingAppService.UpdateAsync("GroupName", new UpdateSettingsDto + { + Settings = new List + { + new UpdateSettingDto + { + Name = "SettingName", + Value = "NewValue" + } + } + }); + } +} +``` + +[返回目录](../../../README.md) diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/README.EN.md b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/README.EN.md new file mode 100644 index 000000000..99a86c26f --- /dev/null +++ b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/README.EN.md @@ -0,0 +1,55 @@ +# LINGYUN.Abp.Settings + +## Module Description + +ABP Settings Management extension module, providing additional settings management functionality. + +### Base Modules + +* Volo.Abp.Settings + +### Features + +* Extends the ISettingProvider interface, providing more convenient setting retrieval methods + * GetOrDefaultAsync - Get setting value, returns default value if empty + +### Configuration + +No special configuration items + +### How to Use + +1. Add module dependency + +```csharp +[DependsOn(typeof(AbpSettingsModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Use extension methods + +```csharp +public class YourService +{ + private readonly ISettingProvider _settingProvider; + private readonly IServiceProvider _serviceProvider; + + public YourService( + ISettingProvider settingProvider, + IServiceProvider serviceProvider) + { + _settingProvider = settingProvider; + _serviceProvider = serviceProvider; + } + + public async Task GetSettingValueAsync(string name) + { + // Get setting value, returns default value if empty + return await _settingProvider.GetOrDefaultAsync(name, _serviceProvider); + } +} +``` + +[Back to TOC](../../../README.md) diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/README.md b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/README.md new file mode 100644 index 000000000..41b763009 --- /dev/null +++ b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/README.md @@ -0,0 +1,55 @@ +# LINGYUN.Abp.Settings + +## 模块说明 + +ABP 设置管理扩展模块,提供了额外的设置管理功能。 + +### 基础模块 + +* Volo.Abp.Settings + +### 功能定义 + +* 扩展了 ISettingProvider 接口,提供了更多便利的设置获取方法 + * GetOrDefaultAsync - 获取设置值,如果为空则返回默认值 + +### 配置定义 + +无特殊配置项 + +### 如何使用 + +1. 添加模块依赖 + +```csharp +[DependsOn(typeof(AbpSettingsModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 使用扩展方法 + +```csharp +public class YourService +{ + private readonly ISettingProvider _settingProvider; + private readonly IServiceProvider _serviceProvider; + + public YourService( + ISettingProvider settingProvider, + IServiceProvider serviceProvider) + { + _settingProvider = settingProvider; + _serviceProvider = serviceProvider; + } + + public async Task GetSettingValueAsync(string name) + { + // 获取设置值,如果为空则返回默认值 + return await _settingProvider.GetOrDefaultAsync(name, _serviceProvider); + } +} +``` + +[返回目录](../../../README.md) diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/README.EN.md b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/README.EN.md new file mode 100644 index 000000000..1a71a36d1 --- /dev/null +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/README.EN.md @@ -0,0 +1,101 @@ +# LINGYUN.Abp.MultiTenancy.Editions + +Multi-tenancy edition management module, providing basic functionality support for tenant editions. + +## Features + +- Edition Management + - Support for assigning different editions to tenants + - Edition information includes ID and display name + - Support for edition information storage and retrieval +- Global Feature Toggles + - Control edition functionality through global feature switches + - Flexible configuration for enabling/disabling edition features +- Authentication Integration + - Automatically adds edition information to user Claims + - Support for accessing current tenant's edition information in applications +- Extensibility + - Provides IEditionStore interface for custom edition storage + - Support for custom edition configuration providers + +## Module Reference + +```csharp +[DependsOn(typeof(AbpMultiTenancyEditionsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +### 1. Global Feature Configuration + +```csharp +GlobalFeatureManager.Instance.Modules.Editions(editions => +{ + // Configure edition-related global features here +}); +``` + +### 2. Implementing Edition Storage + +```csharp +public class YourEditionStore : IEditionStore +{ + public async Task FindByTenantAsync(Guid tenantId) + { + // Implement logic to retrieve tenant edition information from storage + return new EditionInfo( + id: Guid.NewGuid(), + displayName: "Standard Edition" + ); + } +} +``` + +### 3. Retrieving Edition Information + +```csharp +public class YourService +{ + private readonly IEditionConfigurationProvider _editionProvider; + + public YourService(IEditionConfigurationProvider editionProvider) + { + _editionProvider = editionProvider; + } + + public async Task GetEditionAsync(Guid? tenantId) + { + return await _editionProvider.GetAsync(tenantId); + } +} +``` + +## Using Edition Information in Claims + +When edition functionality is enabled, the module automatically adds edition information to user Claims: + +```csharp +public class YourController +{ + public async Task GetEditionInfo() + { + var editionId = User.FindFirstValue(AbpClaimTypes.EditionId); + // Perform operations using the edition ID + } +} +``` + +## Important Notes + +1. Ensure global feature toggle is enabled before using edition functionality. +2. Edition storage implementation should consider performance and concurrent access issues. +3. Changes to edition information may affect tenant feature access permissions. +4. Edition information in Claims is automatically updated during user authentication. + +## More Documentation + +- [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/README.md b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/README.md new file mode 100644 index 000000000..925c202e7 --- /dev/null +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/README.md @@ -0,0 +1,101 @@ +# LINGYUN.Abp.MultiTenancy.Editions + +多租户版本管理模块,提供租户版本(Edition)的基础功能支持。 + +## 功能特性 + +- 版本管理 + - 支持为租户分配不同版本 + - 版本信息包含 ID 和显示名称 + - 支持版本信息的存储和检索 +- 全局功能开关 + - 支持通过全局功能开关控制版本功能 + - 可灵活配置版本功能的启用/禁用 +- 身份认证集成 + - 自动将版本信息添加到用户 Claims 中 + - 支持在应用程序中获取当前租户的版本信息 +- 可扩展性 + - 提供 IEditionStore 接口用于自定义版本存储 + - 支持自定义版本配置提供程序 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpMultiTenancyEditionsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置说明 + +### 1. 全局功能配置 + +```csharp +GlobalFeatureManager.Instance.Modules.Editions(editions => +{ + // 在这里配置版本相关的全局功能 +}); +``` + +### 2. 实现版本存储 + +```csharp +public class YourEditionStore : IEditionStore +{ + public async Task FindByTenantAsync(Guid tenantId) + { + // 实现从存储中获取租户版本信息的逻辑 + return new EditionInfo( + id: Guid.NewGuid(), + displayName: "Standard Edition" + ); + } +} +``` + +### 3. 获取版本信息 + +```csharp +public class YourService +{ + private readonly IEditionConfigurationProvider _editionProvider; + + public YourService(IEditionConfigurationProvider editionProvider) + { + _editionProvider = editionProvider; + } + + public async Task GetEditionAsync(Guid? tenantId) + { + return await _editionProvider.GetAsync(tenantId); + } +} +``` + +## 版本信息在 Claims 中的使用 + +当启用版本功能时,模块会自动将版本信息添加到用户的 Claims 中: + +```csharp +public class YourController +{ + public async Task GetEditionInfo() + { + var editionId = User.FindFirstValue(AbpClaimTypes.EditionId); + // 使用版本ID进行相关操作 + } +} +``` + +## 注意事项 + +1. 使用版本功能前需要确保已启用全局功能开关。 +2. 版本存储的实现需要考虑性能和并发访问的问题。 +3. 版本信息的变更可能会影响租户的功能访问权限。 +4. Claims 中的版本信息会在用户认证时自动更新。 + +## 更多文档 + +- [English Documentation](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/README.EN.md new file mode 100644 index 000000000..3976f5839 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/README.EN.md @@ -0,0 +1,40 @@ +# LINGYUN.Abp.Identity.WeChat.Work + +WeChat Work (Enterprise WeChat) user identity integration module, providing integration between WeChat Work users and the ABP Identity system. + +## Features + +* WeChat Work user identity integration +* Support synchronizing WeChat Work user information to Identity system +* Support WeChat Work organizational structure synchronization +* Support automatic user creation + +## Module Reference + +```csharp +[DependsOn(typeof(AbpIdentityWeChatWorkModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Identity": { + "WeChat": { + "Work": { + "CreateUserIfNotExist": true, // Whether to automatically create user if not exists + "UpdateUserIfExist": true, // Whether to update user information if exists + "SyncOrganizationUnit": true // Whether to sync organizational structure + } + } + } +} +``` + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/README.md new file mode 100644 index 000000000..4bfa66a75 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/README.md @@ -0,0 +1,40 @@ +# LINGYUN.Abp.Identity.WeChat.Work + +企业微信用户身份集成模块,提供企业微信用户与ABP Identity系统的集成功能。 + +## 功能特性 + +* 企业微信用户身份集成 +* 支持企业微信用户信息同步到Identity系统 +* 支持企业微信组织架构同步 +* 支持自动创建用户 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpIdentityWeChatWorkModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Identity": { + "WeChat": { + "Work": { + "CreateUserIfNotExist": true, // 用户不存在时是否自动创建 + "UpdateUserIfExist": true, // 用户存在时是否更新信息 + "SyncOrganizationUnit": true // 是否同步组织架构 + } + } + } +} +``` + +## 更多文档 + +* [企业微信用户身份集成文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/README.EN.md new file mode 100644 index 000000000..1ad0d3115 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/README.EN.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Identity.WeChat + +WeChat user identity integration module, providing integration between WeChat users and the ABP Identity system. + +## Features + +* WeChat user identity integration +* Support synchronizing WeChat user information to Identity system +* Support for WeChat UnionId mechanism +* Support automatic user creation + +## Module Reference + +```csharp +[DependsOn(typeof(AbpIdentityWeChatModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Identity": { + "WeChat": { + "CreateUserIfNotExist": true, // Whether to automatically create user if not exists + "UpdateUserIfExist": true // Whether to update user information if exists + } + } +} +``` + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/README.md new file mode 100644 index 000000000..bf4a474d6 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/README.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Identity.WeChat + +微信用户身份集成模块,提供微信用户与ABP Identity系统的集成功能。 + +## 功能特性 + +* 微信用户身份集成 +* 支持微信用户信息同步到Identity系统 +* 支持微信UnionId机制 +* 支持自动创建用户 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpIdentityWeChatModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Identity": { + "WeChat": { + "CreateUserIfNotExist": true, // 用户不存在时是否自动创建 + "UpdateUserIfExist": true // 用户存在时是否更新信息 + } + } +} +``` + +## 更多文档 + +* [微信用户身份集成文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.EN.md new file mode 100644 index 000000000..d68c74bb9 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.EN.md @@ -0,0 +1,41 @@ +# LINGYUN.Abp.Notifications.WeChat.MiniProgram + +WeChat Mini Program notification module, providing functionality to send subscription messages to users through WeChat Mini Program. + +## Features + +* Support WeChat Mini Program subscription message sending +* Support message template management +* Support dynamic message data configuration +* Integration with ABP notification system + +## Module Reference + +```csharp +[DependsOn(typeof(AbpNotificationsWeChatMiniProgramModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "MiniProgram": { + "Notifications": { + "DefaultTemplateId": "", // Default template ID + "DefaultPage": "pages/index/index", // Default jump page + "DefaultState": "formal", // Default Mini Program version type: developer/trial/formal + "DefaultLang": "zh_CN" // Default language + } + } + } +} +``` + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.md new file mode 100644 index 000000000..43316a0e5 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.md @@ -0,0 +1,41 @@ +# LINGYUN.Abp.Notifications.WeChat.MiniProgram + +微信小程序消息通知模块,提供通过微信小程序向用户发送订阅消息的功能。 + +## 功能特性 + +* 支持微信小程序订阅消息发送 +* 支持消息模板管理 +* 支持动态消息数据配置 +* 集成ABP通知系统 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsWeChatMiniProgramModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WeChat": { + "MiniProgram": { + "Notifications": { + "DefaultTemplateId": "", // 默认模板ID + "DefaultPage": "pages/index/index", // 默认跳转页面 + "DefaultState": "formal", // 默认跳转小程序类型,developer为开发版;trial为体验版;formal为正式版 + "DefaultLang": "zh_CN" // 默认语言 + } + } + } +} +``` + +## 更多文档 + +* [微信小程序消息通知文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.Work/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.Work/README.EN.md new file mode 100644 index 000000000..62fe6b68f --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.Work/README.EN.md @@ -0,0 +1,49 @@ +# LINGYUN.Abp.Notifications.WeChat.Work + +WeChat Work (Enterprise WeChat) application message notification module, providing functionality to send messages to users through WeChat Work applications. + +## Features + +* Support WeChat Work application message sending +* Support text messages +* Support image messages +* Support voice messages +* Support video messages +* Support file messages +* Support news messages +* Support template card messages +* Integration with ABP notification system + +## Module Reference + +```csharp +[DependsOn(typeof(AbpNotificationsWeChatWorkModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "Work": { + "Notifications": { + "DefaultAgentId": 0, // Default application ID + "DefaultToParty": "", // Default department ID list to receive messages + "DefaultToTag": "", // Default tag ID list to receive messages + "DefaultSafe": 0, // Default indicator for confidential messages, 0: shareable, 1: non-shareable with watermark + "DefaultEnableIdTrans": 0, // Default indicator for ID translation, 0: disabled, 1: enabled + "DefaultEnableDuplicateCheck": 0, // Default indicator for duplicate message check, 0: disabled, 1: enabled + "DefaultDuplicateCheckInterval": 1800 // Default interval for duplicate message check in seconds + } + } + } +} +``` + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.Work/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.Work/README.md new file mode 100644 index 000000000..68207187e --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Notifications.WeChat.Work/README.md @@ -0,0 +1,49 @@ +# LINGYUN.Abp.Notifications.WeChat.Work + +企业微信应用消息通知模块,提供通过企业微信应用向用户发送消息的功能。 + +## 功能特性 + +* 支持企业微信应用消息发送 +* 支持文本消息 +* 支持图片消息 +* 支持语音消息 +* 支持视频消息 +* 支持文件消息 +* 支持图文消息 +* 支持模板卡片消息 +* 集成ABP通知系统 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsWeChatWorkModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WeChat": { + "Work": { + "Notifications": { + "DefaultAgentId": 0, // 默认应用ID + "DefaultToParty": "", // 默认接收消息的部门ID列表 + "DefaultToTag": "", // 默认接收消息的标签ID列表 + "DefaultSafe": 0, // 默认表示是否是保密消息,0表示可对外分享,1表示不能分享且内容显示水印 + "DefaultEnableIdTrans": 0, // 默认表示是否开启id转译,0表示否,1表示是 + "DefaultEnableDuplicateCheck": 0, // 默认表示是否开启重复消息检查,0表示否,1表示是 + "DefaultDuplicateCheckInterval": 1800 // 默认表示重复消息检查的时间间隔,默认1800秒 + } + } + } +} +``` + +## 更多文档 + +* [企业微信应用消息通知文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/README.EN.md new file mode 100644 index 000000000..3b0b4ed22 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/README.EN.md @@ -0,0 +1,51 @@ +# LINGYUN.Abp.WeChat.Common + +WeChat common module, providing shared fundamental functionality implementation for WeChat product lines. + +## Features + +* Unified message handling framework +* Unified message encryption/decryption mechanism +* Unified event handling mechanism +* Unified API calling interface +* Unified error handling mechanism + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatCommonModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "Common": { + "MessageHandlerFactory": { + "MessageResolvers": [], // Message resolver list + "MessageHandlers": [] // Message handler list + } + } + } +} +``` + +## Message Handling + +* Support text message handling +* Support image message handling +* Support voice message handling +* Support video message handling +* Support event message handling +* Support custom message handler extensions + +## More Documentation + +* [Chinese Documentation](README.md) + +### Change Log diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/README.md index d16a17a72..61caf660f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/README.md +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/README.md @@ -1,30 +1,50 @@ # LINGYUN.Abp.WeChat.Common -## 模块说明 +微信通用模块,提供微信产品线共享的基础功能实现。 -由于微信体系众多产品部分功能有共同点, 抽象一个通用模块, 实现一些通用的接口. +## 功能特性 -### 基础模块 +* 统一的消息处理框架 +* 统一的消息加解密机制 +* 统一的事件处理机制 +* 统一的API调用接口 +* 统一的错误处理机制 -### 高阶模块 +## 模块引用 -### 权限定义 - -### 功能定义 +```csharp +[DependsOn(typeof(AbpWeChatCommonModule))] +public class YouProjectModule : AbpModule +{ +} +``` -### 配置定义 +## 配置项 -### 如何使用 +```json +{ + "WeChat": { + "Common": { + "MessageHandlerFactory": { + "MessageResolvers": [], // 消息解析器列表 + "MessageHandlers": [] // 消息处理器列表 + } + } + } +} +``` +## 消息处理 -```csharp +* 支持文本消息处理 +* 支持图片消息处理 +* 支持语音消息处理 +* 支持视频消息处理 +* 支持事件消息处理 +* 支持自定义消息处理器扩展 - [DependsOn( - typeof(AbpWeChatCommonModule))] - public class YouProjectModule : AbpModule - { - } +## 更多文档 -``` +* [微信通用模块文档](README.EN.md) ### 更新日志 diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.EN.md new file mode 100644 index 000000000..8d0cd2d96 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.WeChat.MiniProgram + +WeChat Mini Program SDK integration module, providing necessary functionality support for WeChat Mini Program development. + +## Features + +* WeChat Mini Program login authentication +* Mini Program QR code generation +* Subscription message sending +* Mini Program data statistics +* Mini Program live streaming +* Mini Program payment integration +* Unified service messaging + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatMiniProgramModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "MiniProgram": { + "AppId": "", // Mini Program AppId + "AppSecret": "", // Mini Program AppSecret + "Token": "", // Mini Program message Token + "EncodingAESKey": "", // Mini Program message encryption key + "IsDebug": false, // Whether to enable debug mode + "DefaultEnvironment": "release" // Default environment, options: develop/trial/release + } + } +} +``` + +#### Important Note + +There is a known issue with dynamic configuration: https://github.com/abpframework/abp/issues/6318 +Therefore, you must use AbpWeChatMiniProgramOptionsFactory.CreateAsync() to dynamically change AbpWeChatMiniProgramOptions. + +## Settings Configuration + +* `WeChat.MiniProgram.AppId`: Mini Program AppId +* `WeChat.MiniProgram.AppSecret`: Mini Program AppSecret +* `WeChat.MiniProgram.Token`: Mini Program message Token +* `WeChat.MiniProgram.EncodingAESKey`: Mini Program message encryption key +* `WeChat.MiniProgram.IsDebug`: Whether to enable debug mode +* `WeChat.MiniProgram.DefaultEnvironment`: Default environment + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.md index 56dc35960..d9909ee51 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.md +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.md @@ -1,17 +1,18 @@ # LINGYUN.Abp.WeChat.MiniProgram -微信小程序SDK集成,考虑是否需要集成[Senparc.Weixin SDK](https://github.com/JeffreySu/WeiXinMPSDK) +微信小程序SDK集成模块,提供微信小程序开发所需的功能支持。 -大部分重写的模块都和官方模块名称保持一致,通过命名空间区分,主要是只改写了一小部分或者增加额外的功能 -如果大部分模块代码都重写,或者完全就是扩展模块,才会定义自己的名字 +## 功能特性 -#### 注意 - -在动态配置中有一个已知的问题: https://github.com/abpframework/abp/issues/6318 -因此必须要重建一个动态变更 AbpWeChatMiniProgramOptions 的方法,请使用AbpWeChatMiniProgramOptionsFactory.CreateAsync() - -## 配置使用 +* 微信小程序登录认证 +* 小程序码生成 +* 订阅消息发送 +* 小程序数据统计 +* 小程序直播 +* 小程序支付集成 +* 统一服务消息 +## 模块引用 ```csharp [DependsOn(typeof(AbpWeChatMiniProgramModule))] @@ -19,3 +20,39 @@ public class YouProjectModule : AbpModule { // other } +``` + +## 配置项 + +```json +{ + "WeChat": { + "MiniProgram": { + "AppId": "", // 小程序AppId + "AppSecret": "", // 小程序AppSecret + "Token": "", // 小程序消息Token + "EncodingAESKey": "", // 小程序消息加密密钥 + "IsDebug": false, // 是否开启调试模式 + "DefaultEnvironment": "release" // 默认环境,可选值:develop(开发版)、trial(体验版)、release(正式版) + } + } +} +``` + +#### 注意事项 + +在动态配置中有一个已知的问题: https://github.com/abpframework/abp/issues/6318 +因此必须要重建一个动态变更 AbpWeChatMiniProgramOptions 的方法,请使用AbpWeChatMiniProgramOptionsFactory.CreateAsync() + +## Settings配置 + +* `WeChat.MiniProgram.AppId`: 小程序AppId +* `WeChat.MiniProgram.AppSecret`: 小程序AppSecret +* `WeChat.MiniProgram.Token`: 小程序消息Token +* `WeChat.MiniProgram.EncodingAESKey`: 小程序消息加密密钥 +* `WeChat.MiniProgram.IsDebug`: 是否开启调试模式 +* `WeChat.MiniProgram.DefaultEnvironment`: 默认环境 + +## 更多文档 + +* [微信小程序模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Handlers/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Handlers/README.EN.md new file mode 100644 index 000000000..1d39be8c1 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Handlers/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.WeChat.Official.Handlers + +WeChat Official Account message handling module, providing basic implementation for WeChat Official Account message and event handling. + +## Features + +* Text message handling +* Image message handling +* Voice message handling +* Video message handling +* Short video message handling +* Location message handling +* Link message handling +* Subscribe/Unsubscribe event handling +* QR code scan event handling +* Location report event handling +* Custom menu event handling +* Template message event handling + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatOfficialHandlersModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "Official": { + "Handlers": { + "DefaultResponseType": "text", // Default response type: text/image/voice/video/music/news + "DefaultResponse": "", // Default response content + "EnableDefaultResponse": true // Whether to enable default response + } + } + } +} +``` + +## Custom Handlers + +To implement custom message handlers, inherit from the corresponding base class: + +* Text message: `WeChatOfficialTextMessageHandlerBase` +* Image message: `WeChatOfficialImageMessageHandlerBase` +* Voice message: `WeChatOfficialVoiceMessageHandlerBase` +* Video message: `WeChatOfficialVideoMessageHandlerBase` +* Event message: `WeChatOfficialEventMessageHandlerBase` + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Handlers/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Handlers/README.md new file mode 100644 index 000000000..99a678bc5 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Handlers/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.WeChat.Official.Handlers + +微信公众号消息处理模块,提供微信公众号消息和事件处理的基础实现。 + +## 功能特性 + +* 文本消息处理 +* 图片消息处理 +* 语音消息处理 +* 视频消息处理 +* 小视频消息处理 +* 地理位置消息处理 +* 链接消息处理 +* 关注/取消关注事件处理 +* 扫描带参数二维码事件处理 +* 上报地理位置事件处理 +* 自定义菜单事件处理 +* 模板消息事件处理 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatOfficialHandlersModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WeChat": { + "Official": { + "Handlers": { + "DefaultResponseType": "text", // 默认响应类型:text/image/voice/video/music/news + "DefaultResponse": "", // 默认响应内容 + "EnableDefaultResponse": true // 是否启用默认响应 + } + } + } +} +``` + +## 自定义处理器 + +要实现自定义消息处理器,需要继承相应的基类: + +* 文本消息:`WeChatOfficialTextMessageHandlerBase` +* 图片消息:`WeChatOfficialImageMessageHandlerBase` +* 语音消息:`WeChatOfficialVoiceMessageHandlerBase` +* 视频消息:`WeChatOfficialVideoMessageHandlerBase` +* 事件消息:`WeChatOfficialEventMessageHandlerBase` + +## 更多文档 + +* [微信公众号消息处理模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/README.EN.md new file mode 100644 index 000000000..9ed060a4a --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/README.EN.md @@ -0,0 +1,54 @@ +# LINGYUN.Abp.WeChat.Official.Senparc + +WeChat Official Account Senparc SDK integration module, providing integration support with Senparc.Weixin SDK. + +## Features + +* Senparc.Weixin SDK integration +* Compatible with Senparc message handling mechanism +* Compatible with Senparc event handling mechanism +* Support for Senparc configuration system +* Support for Senparc caching strategy + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatOfficialSenparcModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "Official": { + "Senparc": { + "IsEnabled": true, // Whether to enable Senparc integration + "Cache": { + "Type": "Local", // Cache type: Local/Redis/Memcached + "Configuration": "" // Cache configuration string + } + } + } + } +} +``` + +## Senparc Compatibility + +This module maintains compatibility with Senparc.Weixin SDK, allowing you to: + +* Use Senparc message handlers +* Use Senparc event handlers +* Use Senparc API calling methods +* Use Senparc caching mechanism +* Use Senparc extension features + +## More Documentation + +* [Chinese Documentation](README.md) +* [Senparc.Weixin SDK Documentation](https://github.com/JeffreySu/WeiXinMPSDK) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/README.md new file mode 100644 index 000000000..9f44068d6 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/README.md @@ -0,0 +1,54 @@ +# LINGYUN.Abp.WeChat.Official.Senparc + +微信公众号Senparc SDK集成模块,提供与Senparc.Weixin SDK的集成支持。 + +## 功能特性 + +* Senparc.Weixin SDK集成 +* 兼容Senparc消息处理机制 +* 兼容Senparc事件处理机制 +* 支持Senparc配置体系 +* 支持Senparc缓存策略 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatOfficialSenparcModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WeChat": { + "Official": { + "Senparc": { + "IsEnabled": true, // 是否启用Senparc集成 + "Cache": { + "Type": "Local", // 缓存类型:Local/Redis/Memcached + "Configuration": "" // 缓存配置字符串 + } + } + } + } +} +``` + +## Senparc兼容性 + +本模块与Senparc.Weixin SDK保持兼容,可以: + +* 使用Senparc的消息处理器 +* 使用Senparc的事件处理器 +* 使用Senparc的API调用方式 +* 使用Senparc的缓存机制 +* 使用Senparc的扩展功能 + +## 更多文档 + +* [微信公众号Senparc集成模块文档](README.EN.md) +* [Senparc.Weixin SDK文档](https://github.com/JeffreySu/WeiXinMPSDK) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/README.EN.md new file mode 100644 index 000000000..c1458fee0 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/README.EN.md @@ -0,0 +1,60 @@ +# LINGYUN.Abp.WeChat.Official + +WeChat Official Account SDK integration module, providing necessary functionality support for WeChat Official Account development. + +## Features + +* WeChat Official Account OAuth2.0 authentication +* Custom menu management +* Template message sending +* Media management +* User management +* Customer service messaging +* WeChat payment integration +* Message encryption/decryption +* Event handling + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatOfficialModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "Official": { + "AppId": "", // Official Account AppId + "AppSecret": "", // Official Account AppSecret + "Token": "", // Official Account message Token + "EncodingAESKey": "", // Official Account message encryption key + "IsSandBox": false, // Whether in sandbox environment + "Url": "" // Official Account server URL + } + } +} +``` + +#### Important Note + +There is a known issue with dynamic configuration: https://github.com/abpframework/abp/issues/6318 +Therefore, you must use AbpWeChatOfficialOptionsFactory.CreateAsync() to dynamically change AbpWeChatOfficialOptions. + +## Settings Configuration + +* `WeChat.Official.AppId`: Official Account AppId +* `WeChat.Official.AppSecret`: Official Account AppSecret +* `WeChat.Official.Token`: Official Account message Token +* `WeChat.Official.EncodingAESKey`: Official Account message encryption key +* `WeChat.Official.IsSandBox`: Whether in sandbox environment +* `WeChat.Official.Url`: Official Account server URL + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/README.md index c52069eab..c1d4f2f75 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/README.md +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/README.md @@ -1,17 +1,20 @@ # LINGYUN.Abp.WeChat.Official -微信公众号SDK集成,考虑是否需要集成[Senparc.Weixin SDK](https://github.com/JeffreySu/WeiXinMPSDK) +微信公众号SDK集成模块,提供微信公众号开发所需的功能支持。 -大部分重写的模块都和官方模块名称保持一致,通过命名空间区分,主要是只改写了一小部分或者增加额外的功能 -如果大部分模块代码都重写,或者完全就是扩展模块,才会定义自己的名字 +## 功能特性 -#### 注意 - -在动态配置中有一个已知的问题: https://github.com/abpframework/abp/issues/6318 -因此必须要重建一个动态变更 AbpWeChatOfficialOptions 的方法,请使用AbpWeChatOfficialOptionsFactory.CreateAsync() - -## 配置使用 +* 微信公众号OAuth2.0认证 +* 自定义菜单管理 +* 模板消息发送 +* 素材管理 +* 用户管理 +* 客服消息 +* 微信支付集成 +* 消息加解密 +* 事件处理 +## 模块引用 ```csharp [DependsOn(typeof(AbpWeChatOfficialModule))] @@ -19,3 +22,39 @@ public class YouProjectModule : AbpModule { // other } +``` + +## 配置项 + +```json +{ + "WeChat": { + "Official": { + "AppId": "", // 公众号AppId + "AppSecret": "", // 公众号AppSecret + "Token": "", // 公众号消息Token + "EncodingAESKey": "", // 公众号消息加密密钥 + "IsSandBox": false, // 是否为沙箱环境 + "Url": "" // 公众号服务器URL + } + } +} +``` + +#### 注意事项 + +在动态配置中有一个已知的问题: https://github.com/abpframework/abp/issues/6318 +因此必须要重建一个动态变更 AbpWeChatOfficialOptions 的方法,请使用AbpWeChatOfficialOptionsFactory.CreateAsync() + +## Settings配置 + +* `WeChat.Official.AppId`: 公众号AppId +* `WeChat.Official.AppSecret`: 公众号AppSecret +* `WeChat.Official.Token`: 公众号消息Token +* `WeChat.Official.EncodingAESKey`: 公众号消息加密密钥 +* `WeChat.Official.IsSandBox`: 是否为沙箱环境 +* `WeChat.Official.Url`: 公众号服务器URL + +## 更多文档 + +* [微信公众号模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/README.EN.md new file mode 100644 index 000000000..78c39822f --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/README.EN.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.WeChat.SettingManagement + +WeChat settings management module, providing management functionality for WeChat-related configurations. + +## Features + +* WeChat configuration management +* Official Account configuration management +* Mini Program configuration management +* WeChat Work configuration management +* Configuration UI integration +* Multi-tenant support + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Settings Configuration + +### Official Account Configuration + +* `WeChat.Official.AppId`: Official Account AppId +* `WeChat.Official.AppSecret`: Official Account AppSecret +* `WeChat.Official.Token`: Official Account message Token +* `WeChat.Official.EncodingAESKey`: Official Account message encryption key +* `WeChat.Official.IsSandBox`: Whether in sandbox environment +* `WeChat.Official.Url`: Official Account server URL + +### Mini Program Configuration + +* `WeChat.MiniProgram.AppId`: Mini Program AppId +* `WeChat.MiniProgram.AppSecret`: Mini Program AppSecret +* `WeChat.MiniProgram.Token`: Mini Program message Token +* `WeChat.MiniProgram.EncodingAESKey`: Mini Program message encryption key +* `WeChat.MiniProgram.IsDebug`: Whether to enable debug mode +* `WeChat.MiniProgram.DefaultEnvironment`: Default environment + +### WeChat Work Configuration + +* `WeChat.Work.CorpId`: Enterprise ID +* `WeChat.Work.AgentId`: Application ID +* `WeChat.Work.Secret`: Application secret +* `WeChat.Work.Token`: Message Token +* `WeChat.Work.EncodingAESKey`: Message encryption key + +## Permissions + +* `WeChat.Setting`: WeChat settings management +* `WeChat.Setting.Official`: Official Account settings management +* `WeChat.Setting.MiniProgram`: Mini Program settings management +* `WeChat.Setting.Work`: WeChat Work settings management + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/README.md new file mode 100644 index 000000000..bf85255b3 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/README.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.WeChat.SettingManagement + +微信设置管理模块,提供微信相关配置的管理功能。 + +## 功能特性 + +* 微信配置管理 +* 公众号配置管理 +* 小程序配置管理 +* 企业微信配置管理 +* 配置界面集成 +* 多租户支持 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Settings配置 + +### 公众号配置 + +* `WeChat.Official.AppId`: 公众号AppId +* `WeChat.Official.AppSecret`: 公众号AppSecret +* `WeChat.Official.Token`: 公众号消息Token +* `WeChat.Official.EncodingAESKey`: 公众号消息加密密钥 +* `WeChat.Official.IsSandBox`: 是否为沙箱环境 +* `WeChat.Official.Url`: 公众号服务器URL + +### 小程序配置 + +* `WeChat.MiniProgram.AppId`: 小程序AppId +* `WeChat.MiniProgram.AppSecret`: 小程序AppSecret +* `WeChat.MiniProgram.Token`: 小程序消息Token +* `WeChat.MiniProgram.EncodingAESKey`: 小程序消息加密密钥 +* `WeChat.MiniProgram.IsDebug`: 是否开启调试模式 +* `WeChat.MiniProgram.DefaultEnvironment`: 默认环境 + +### 企业微信配置 + +* `WeChat.Work.CorpId`: 企业ID +* `WeChat.Work.AgentId`: 应用ID +* `WeChat.Work.Secret`: 应用密钥 +* `WeChat.Work.Token`: 消息Token +* `WeChat.Work.EncodingAESKey`: 消息加密密钥 + +## 权限 + +* `WeChat.Setting`: 微信设置管理 +* `WeChat.Setting.Official`: 公众号设置管理 +* `WeChat.Setting.MiniProgram`: 小程序设置管理 +* `WeChat.Setting.Work`: 企业微信设置管理 + +## 更多文档 + +* [微信设置管理模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/README.EN.md new file mode 100644 index 000000000..699e756c1 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/README.EN.md @@ -0,0 +1,71 @@ +# LINGYUN.Abp.WeChat.Work.Application.Contracts + +WeChat Work application service contracts module, providing application layer service interface definitions for WeChat Work application development. + +## Features + +* Contact management service interfaces +* Application management service interfaces +* Message pushing service interfaces +* Customer contact service interfaces +* Authentication service interfaces +* Enterprise payment service interfaces +* Electronic invoice service interfaces + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatWorkApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Service Interfaces + +### Contact Management + +* `IWeChatWorkContactService` + * `CreateDepartmentAsync`: Create department + * `UpdateDepartmentAsync`: Update department + * `DeleteDepartmentAsync`: Delete department + * `CreateUserAsync`: Create member + * `UpdateUserAsync`: Update member + * `DeleteUserAsync`: Delete member + * `CreateTagAsync`: Create tag + * `UpdateTagAsync`: Update tag + * `DeleteTagAsync`: Delete tag + +### Application Management + +* `IWeChatWorkAgentService` + * `GetAgentAsync`: Get application + * `SetAgentAsync`: Set application + * `GetAgentListAsync`: Get application list + * `SetWorkbenchTemplateAsync`: Set workbench template + +### Message Pushing + +* `IWeChatWorkMessageService` + * `SendTextAsync`: Send text message + * `SendImageAsync`: Send image message + * `SendVoiceAsync`: Send voice message + * `SendVideoAsync`: Send video message + * `SendFileAsync`: Send file message + * `SendTextCardAsync`: Send text card message + * `SendNewsAsync`: Send news message + * `SendTemplateCardAsync`: Send template card message + +## Permissions + +* `WeChatWork.Contact`: Contact management +* `WeChatWork.Agent`: Application management +* `WeChatWork.Message`: Message management +* `WeChatWork.Customer`: Customer management +* `WeChatWork.Payment`: Enterprise payment +* `WeChatWork.Invoice`: Electronic invoice + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/README.md new file mode 100644 index 000000000..9170e4f15 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/README.md @@ -0,0 +1,71 @@ +# LINGYUN.Abp.WeChat.Work.Application.Contracts + +企业微信应用服务契约模块,提供企业微信应用开发的应用层服务接口定义。 + +## 功能特性 + +* 通讯录管理服务接口 +* 应用管理服务接口 +* 消息推送服务接口 +* 客户联系服务接口 +* 身份验证服务接口 +* 企业支付服务接口 +* 电子发票服务接口 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatWorkApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 服务接口 + +### 通讯录管理 + +* `IWeChatWorkContactService` + * `CreateDepartmentAsync`: 创建部门 + * `UpdateDepartmentAsync`: 更新部门 + * `DeleteDepartmentAsync`: 删除部门 + * `CreateUserAsync`: 创建成员 + * `UpdateUserAsync`: 更新成员 + * `DeleteUserAsync`: 删除成员 + * `CreateTagAsync`: 创建标签 + * `UpdateTagAsync`: 更新标签 + * `DeleteTagAsync`: 删除标签 + +### 应用管理 + +* `IWeChatWorkAgentService` + * `GetAgentAsync`: 获取应用 + * `SetAgentAsync`: 设置应用 + * `GetAgentListAsync`: 获取应用列表 + * `SetWorkbenchTemplateAsync`: 设置工作台模板 + +### 消息推送 + +* `IWeChatWorkMessageService` + * `SendTextAsync`: 发送文本消息 + * `SendImageAsync`: 发送图片消息 + * `SendVoiceAsync`: 发送语音消息 + * `SendVideoAsync`: 发送视频消息 + * `SendFileAsync`: 发送文件消息 + * `SendTextCardAsync`: 发送文本卡片消息 + * `SendNewsAsync`: 发送图文消息 + * `SendTemplateCardAsync`: 发送模板卡片消息 + +## 权限 + +* `WeChatWork.Contact`: 通讯录管理 +* `WeChatWork.Agent`: 应用管理 +* `WeChatWork.Message`: 消息管理 +* `WeChatWork.Customer`: 客户管理 +* `WeChatWork.Payment`: 企业支付 +* `WeChatWork.Invoice`: 电子发票 + +## 更多文档 + +* [企业微信应用服务契约模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/README.EN.md new file mode 100644 index 000000000..b0d20e333 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/README.EN.md @@ -0,0 +1,57 @@ +# LINGYUN.Abp.WeChat.Work.Application + +WeChat Work application service module, providing application layer service implementation for WeChat Work application development. + +## Features + +* Contact management service +* Application management service +* Message pushing service +* Customer contact service +* Authentication service +* Enterprise payment service +* Electronic invoice service + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatWorkApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Application Services + +### Contact Management + +* `IWeChatWorkContactService`: Contact management service + * Department management + * Member management + * Tag management + * Interconnected enterprise management + +### Application Management + +* `IWeChatWorkAgentService`: Application management service + * Application creation + * Application configuration + * Application visibility settings + * Application homepage settings + +### Message Pushing + +* `IWeChatWorkMessageService`: Message pushing service + * Text messages + * Image messages + * Voice messages + * Video messages + * File messages + * Text card messages + * News messages + * Template card messages + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/README.md new file mode 100644 index 000000000..60df77c7f --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/README.md @@ -0,0 +1,57 @@ +# LINGYUN.Abp.WeChat.Work.Application + +企业微信应用服务模块,提供企业微信应用开发的应用层服务实现。 + +## 功能特性 + +* 通讯录管理服务 +* 应用管理服务 +* 消息推送服务 +* 客户联系服务 +* 身份验证服务 +* 企业支付服务 +* 电子发票服务 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatWorkApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 应用服务 + +### 通讯录管理 + +* `IWeChatWorkContactService`: 通讯录管理服务 + * 部门管理 + * 成员管理 + * 标签管理 + * 互联企业管理 + +### 应用管理 + +* `IWeChatWorkAgentService`: 应用管理服务 + * 应用创建 + * 应用配置 + * 应用可见范围设置 + * 应用主页设置 + +### 消息推送 + +* `IWeChatWorkMessageService`: 消息推送服务 + * 文本消息 + * 图片消息 + * 语音消息 + * 视频消息 + * 文件消息 + * 文本卡片消息 + * 图文消息 + * 模板卡片消息 + +## 更多文档 + +* [企业微信应用服务模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/README.EN.md new file mode 100644 index 000000000..6d6acdce4 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/README.EN.md @@ -0,0 +1,71 @@ +# LINGYUN.Abp.WeChat.Work.Common + +WeChat Work common module, providing basic functionality implementation for WeChat Work application development. + +## Features + +* Unified message handling framework +* Unified message encryption/decryption mechanism +* Unified event handling mechanism +* Unified API calling interface +* Unified error handling mechanism +* AccessToken management +* JsApi Ticket management + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatWorkCommonModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "Work": { + "Common": { + "MessageHandlerFactory": { + "MessageResolvers": [], // Message resolver list + "MessageHandlers": [] // Message handler list + }, + "AccessToken": { + "CacheExpiration": 7200, // AccessToken cache duration (seconds) + "CacheKey": "WeChat:Work:AccessToken:{0}" // AccessToken cache key template + }, + "JsApiTicket": { + "CacheExpiration": 7200, // JsApi Ticket cache duration (seconds) + "CacheKey": "WeChat:Work:JsApiTicket:{0}" // JsApi Ticket cache key template + } + } + } + } +} +``` + +## Message Handling + +* Support text message handling +* Support image message handling +* Support voice message handling +* Support video message handling +* Support location message handling +* Support link message handling +* Support event message handling + +## Event Handling + +* Support application menu events +* Support application entry events +* Support location reporting events +* Support async task completion events +* Support external contact events +* Support contact change events + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/README.md new file mode 100644 index 000000000..731082ba5 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/README.md @@ -0,0 +1,71 @@ +# LINGYUN.Abp.WeChat.Work.Common + +企业微信通用模块,提供企业微信应用开发的基础功能实现。 + +## 功能特性 + +* 统一的消息处理框架 +* 统一的消息加解密机制 +* 统一的事件处理机制 +* 统一的API调用接口 +* 统一的错误处理机制 +* AccessToken管理 +* JsApi Ticket管理 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatWorkCommonModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WeChat": { + "Work": { + "Common": { + "MessageHandlerFactory": { + "MessageResolvers": [], // 消息解析器列表 + "MessageHandlers": [] // 消息处理器列表 + }, + "AccessToken": { + "CacheExpiration": 7200, // AccessToken缓存时间(秒) + "CacheKey": "WeChat:Work:AccessToken:{0}" // AccessToken缓存键模板 + }, + "JsApiTicket": { + "CacheExpiration": 7200, // JsApi Ticket缓存时间(秒) + "CacheKey": "WeChat:Work:JsApiTicket:{0}" // JsApi Ticket缓存键模板 + } + } + } + } +} +``` + +## 消息处理 + +* 支持文本消息处理 +* 支持图片消息处理 +* 支持语音消息处理 +* 支持视频消息处理 +* 支持位置消息处理 +* 支持链接消息处理 +* 支持事件消息处理 + +## 事件处理 + +* 支持应用菜单事件 +* 支持进入应用事件 +* 支持上报地理位置事件 +* 支持异步任务完成事件 +* 支持外部联系人事件 +* 支持通讯录变更事件 + +## 更多文档 + +* [企业微信通用模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Handlers/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Handlers/README.EN.md new file mode 100644 index 000000000..a92e5480f --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Handlers/README.EN.md @@ -0,0 +1,67 @@ +# LINGYUN.Abp.WeChat.Work.Handlers + +WeChat Work message handling module, providing basic implementation for WeChat Work message and event handling. + +## Features + +* Text message handling +* Image message handling +* Voice message handling +* Video message handling +* Location message handling +* Link message handling +* Event message handling +* Custom message handler extensions + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatWorkHandlersModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "Work": { + "Handlers": { + "DefaultResponseType": "text", // Default response type: text/image/voice/video/news + "DefaultResponse": "", // Default response content + "EnableDefaultResponse": true // Whether to enable default response + } + } + } +} +``` + +## Custom Handlers + +To implement custom message handlers, inherit from the corresponding base class: + +* Text message: `WeChatWorkTextMessageHandlerBase` +* Image message: `WeChatWorkImageMessageHandlerBase` +* Voice message: `WeChatWorkVoiceMessageHandlerBase` +* Video message: `WeChatWorkVideoMessageHandlerBase` +* Location message: `WeChatWorkLocationMessageHandlerBase` +* Link message: `WeChatWorkLinkMessageHandlerBase` +* Event message: `WeChatWorkEventMessageHandlerBase` + +## Event Handlers + +Built-in event handlers include: + +* Application menu event handler +* Application entry event handler +* Location reporting event handler +* Async task completion event handler +* External contact event handler +* Contact change event handler + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Handlers/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Handlers/README.md new file mode 100644 index 000000000..6d0825fd9 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Handlers/README.md @@ -0,0 +1,67 @@ +# LINGYUN.Abp.WeChat.Work.Handlers + +企业微信消息处理模块,提供企业微信消息和事件处理的基础实现。 + +## 功能特性 + +* 文本消息处理 +* 图片消息处理 +* 语音消息处理 +* 视频消息处理 +* 位置消息处理 +* 链接消息处理 +* 事件消息处理 +* 自定义消息处理器扩展 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatWorkHandlersModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WeChat": { + "Work": { + "Handlers": { + "DefaultResponseType": "text", // 默认响应类型:text/image/voice/video/news + "DefaultResponse": "", // 默认响应内容 + "EnableDefaultResponse": true // 是否启用默认响应 + } + } + } +} +``` + +## 自定义处理器 + +要实现自定义消息处理器,需要继承相应的基类: + +* 文本消息:`WeChatWorkTextMessageHandlerBase` +* 图片消息:`WeChatWorkImageMessageHandlerBase` +* 语音消息:`WeChatWorkVoiceMessageHandlerBase` +* 视频消息:`WeChatWorkVideoMessageHandlerBase` +* 位置消息:`WeChatWorkLocationMessageHandlerBase` +* 链接消息:`WeChatWorkLinkMessageHandlerBase` +* 事件消息:`WeChatWorkEventMessageHandlerBase` + +## 事件处理器 + +内置以下事件处理器: + +* 应用菜单事件处理器 +* 进入应用事件处理器 +* 上报地理位置事件处理器 +* 异步任务完成事件处理器 +* 外部联系人事件处理器 +* 通讯录变更事件处理器 + +## 更多文档 + +* [企业微信消息处理模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/README.EN.md new file mode 100644 index 000000000..76f23fc9e --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/README.EN.md @@ -0,0 +1,70 @@ +# LINGYUN.Abp.WeChat.Work.HttpApi + +WeChat Work HTTP API module, providing HTTP API interface implementation for WeChat Work application development. + +## Features + +* Contact management API +* Application management API +* Message pushing API +* Customer contact API +* Authentication API +* Enterprise payment API +* Electronic invoice API +* WeChat Work callback interface + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatWorkHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Interfaces + +### Contact Management + +* POST /api/wechat/work/contact/department/create +* POST /api/wechat/work/contact/department/update +* DELETE /api/wechat/work/contact/department/{id} +* POST /api/wechat/work/contact/user/create +* POST /api/wechat/work/contact/user/update +* DELETE /api/wechat/work/contact/user/{id} + +### Application Management + +* GET /api/wechat/work/agent/{agentId} +* POST /api/wechat/work/agent/set +* GET /api/wechat/work/agent/list +* POST /api/wechat/work/agent/workbench/template + +### Message Pushing + +* POST /api/wechat/work/message/text +* POST /api/wechat/work/message/image +* POST /api/wechat/work/message/voice +* POST /api/wechat/work/message/video +* POST /api/wechat/work/message/file +* POST /api/wechat/work/message/textcard +* POST /api/wechat/work/message/news +* POST /api/wechat/work/message/templatecard + +### Callback Interface + +* POST /api/wechat/work/callback/{corpId} + +## Permissions + +* `WeChatWork.Contact`: Contact management +* `WeChatWork.Agent`: Application management +* `WeChatWork.Message`: Message management +* `WeChatWork.Customer`: Customer management +* `WeChatWork.Payment`: Enterprise payment +* `WeChatWork.Invoice`: Electronic invoice + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/README.md new file mode 100644 index 000000000..f66f62625 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/README.md @@ -0,0 +1,70 @@ +# LINGYUN.Abp.WeChat.Work.HttpApi + +企业微信HTTP API模块,提供企业微信应用开发的HTTP API接口实现。 + +## 功能特性 + +* 通讯录管理API +* 应用管理API +* 消息推送API +* 客户联系API +* 身份验证API +* 企业支付API +* 电子发票API +* 企业微信回调接口 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatWorkHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API接口 + +### 通讯录管理 + +* POST /api/wechat/work/contact/department/create +* POST /api/wechat/work/contact/department/update +* DELETE /api/wechat/work/contact/department/{id} +* POST /api/wechat/work/contact/user/create +* POST /api/wechat/work/contact/user/update +* DELETE /api/wechat/work/contact/user/{id} + +### 应用管理 + +* GET /api/wechat/work/agent/{agentId} +* POST /api/wechat/work/agent/set +* GET /api/wechat/work/agent/list +* POST /api/wechat/work/agent/workbench/template + +### 消息推送 + +* POST /api/wechat/work/message/text +* POST /api/wechat/work/message/image +* POST /api/wechat/work/message/voice +* POST /api/wechat/work/message/video +* POST /api/wechat/work/message/file +* POST /api/wechat/work/message/textcard +* POST /api/wechat/work/message/news +* POST /api/wechat/work/message/templatecard + +### 回调接口 + +* POST /api/wechat/work/callback/{corpId} + +## 权限 + +* `WeChatWork.Contact`: 通讯录管理 +* `WeChatWork.Agent`: 应用管理 +* `WeChatWork.Message`: 消息管理 +* `WeChatWork.Customer`: 客户管理 +* `WeChatWork.Payment`: 企业支付 +* `WeChatWork.Invoice`: 电子发票 + +## 更多文档 + +* [企业微信HTTP API模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/README.EN.md new file mode 100644 index 000000000..ab3812bc0 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/README.EN.md @@ -0,0 +1,55 @@ +# LINGYUN.Abp.WeChat.Work + +WeChat Work (Enterprise WeChat) integration module, providing necessary functionality support for WeChat Work application development. + +## Features + +* WeChat Work authentication +* Contact management +* Message pushing +* Media management +* Customer contact +* Application management +* Authentication +* Enterprise payment +* Electronic invoice + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatWorkModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "Work": { + "CorpId": "", // Enterprise ID + "AgentId": 0, // Application ID + "Secret": "", // Application secret + "Token": "", // Message Token + "EncodingAESKey": "", // Message encryption key + "ApiUrl": "https://qyapi.weixin.qq.com" // API URL + } + } +} +``` + +## Settings Configuration + +* `WeChat.Work.CorpId`: Enterprise ID +* `WeChat.Work.AgentId`: Application ID +* `WeChat.Work.Secret`: Application secret +* `WeChat.Work.Token`: Message Token +* `WeChat.Work.EncodingAESKey`: Message encryption key +* `WeChat.Work.ApiUrl`: API URL + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/README.md index 64022ba82..1f168c735 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/README.md +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/README.md @@ -1,10 +1,20 @@ # LINGYUN.Abp.WeChat.Work -企业微信集成 +企业微信集成模块,提供企业微信应用开发所需的功能支持。 +## 功能特性 -## 配置使用 +* 企业微信身份验证 +* 通讯录管理 +* 消息推送 +* 素材管理 +* 客户联系 +* 应用管理 +* 身份验证 +* 企业支付 +* 电子发票 +## 模块引用 ```csharp [DependsOn(typeof(AbpWeChatWorkModule))] @@ -12,3 +22,34 @@ public class YouProjectModule : AbpModule { // other } +``` + +## 配置项 + +```json +{ + "WeChat": { + "Work": { + "CorpId": "", // 企业ID + "AgentId": 0, // 应用ID + "Secret": "", // 应用密钥 + "Token": "", // 消息Token + "EncodingAESKey": "", // 消息加密密钥 + "ApiUrl": "https://qyapi.weixin.qq.com" // API地址 + } + } +} +``` + +## Settings配置 + +* `WeChat.Work.CorpId`: 企业ID +* `WeChat.Work.AgentId`: 应用ID +* `WeChat.Work.Secret`: 应用密钥 +* `WeChat.Work.Token`: 消息Token +* `WeChat.Work.EncodingAESKey`: 消息加密密钥 +* `WeChat.Work.ApiUrl`: API地址 + +## 更多文档 + +* [企业微信集成模块文档](README.EN.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/README.EN.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/README.EN.md new file mode 100644 index 000000000..d7e7402e0 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/README.EN.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.WeChat + +WeChat base module, providing fundamental functionality and configuration for WeChat application development. + +## Features + +* WeChat basic configuration management +* Unified WeChat API calling interface +* WeChat AccessToken management +* Unified error handling mechanism + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWeChatModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WeChat": { + "BaseUrl": "https://api.weixin.qq.com", // WeChat API base URL + "DefaultTimeout": 30000, // Default timeout in milliseconds + "RetryCount": 3, // Number of retry attempts + "RetryMilliseconds": 1000 // Retry interval in milliseconds + } +} +``` + +## Settings Configuration + +* `WeChat.BaseUrl` : WeChat API base URL +* `WeChat.DefaultTimeout` : Default timeout +* `WeChat.RetryCount` : Number of retry attempts +* `WeChat.RetryMilliseconds` : Retry interval + +## More Documentation + +* [Chinese Documentation](README.md) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/README.md b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/README.md new file mode 100644 index 000000000..9a26d09f3 --- /dev/null +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/README.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.WeChat + +微信基础模块,提供微信应用开发的基础功能和配置。 + +## 功能特性 + +* 微信基础配置管理 +* 统一的微信API调用接口 +* 微信AccessToken管理 +* 统一的错误处理机制 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWeChatModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WeChat": { + "BaseUrl": "https://api.weixin.qq.com", // 微信API基础地址 + "DefaultTimeout": 30000, // 默认超时时间(毫秒) + "RetryCount": 3, // 重试次数 + "RetryMilliseconds": 1000 // 重试间隔(毫秒) + } +} +``` + +## Settings配置 + +* `WeChat.BaseUrl` : 微信API基础地址 +* `WeChat.DefaultTimeout` : 默认超时时间 +* `WeChat.RetryCount` : 重试次数 +* `WeChat.RetryMilliseconds` : 重试间隔 + +## 更多文档 + +* [微信基础模块文档](README.EN.md) diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/README.EN.md b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/README.EN.md new file mode 100644 index 000000000..0fe971528 --- /dev/null +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/README.EN.md @@ -0,0 +1,79 @@ +# LINGYUN.Abp.Identity.WxPusher + +Implementation of the IWxPusherUserStore interface for the Identity module, retrieving subscribed topic lists through user Claims. + +[简体中文](./README.md) + +## Features + +* Integration with WxPusher user storage interface +* Manage WxPusher UID and Topic through user Claims +* Support batch retrieval of user-bound UIDs +* Support batch retrieval of user-subscribed Topics + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Identity.WxPusher +``` + +## Module Reference + +```csharp +[DependsOn(typeof(AbpIdentityWxPusherModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Usage + +This module implements the `IWxPusherUserStore` interface, storing WxPusher-related information through user Claims: + +* `AbpWxPusherClaimTypes.Uid`: Stores the WxPusher UID bound to the user +* `AbpWxPusherClaimTypes.Topic`: Stores the Topic ID subscribed by the user + +### Get User-Bound UIDs + +```csharp +public class YourService +{ + private readonly IWxPusherUserStore _wxPusherUserStore; + + public YourService(IWxPusherUserStore wxPusherUserStore) + { + _wxPusherUserStore = wxPusherUserStore; + } + + public async Task DoSomethingAsync(IEnumerable userIds) + { + var uids = await _wxPusherUserStore.GetBindUidsAsync(userIds); + // Use the retrieved uids for message pushing or other operations + } +} +``` + +### Get User-Subscribed Topics + +```csharp +public class YourService +{ + private readonly IWxPusherUserStore _wxPusherUserStore; + + public YourService(IWxPusherUserStore wxPusherUserStore) + { + _wxPusherUserStore = wxPusherUserStore; + } + + public async Task DoSomethingAsync(IEnumerable userIds) + { + var topics = await _wxPusherUserStore.GetSubscribeTopicsAsync(userIds); + // Use the retrieved topics for message pushing or other operations + } +} +``` + +## Source Code + +[LINGYUN.Abp.Identity.WxPusher](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher) diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/README.md b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/README.md index 70ad9ce49..ea3f791cf 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/README.md +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/README.md @@ -2,12 +2,78 @@ IWxPusherUserStore 接口的Identity模块实现, 通过用户Claims来获取关注的topic列表 +[English](./README.EN.md) + +## 功能特性 + +* 集成WxPusher用户存储接口 +* 通过用户Claims管理WxPusher的UID和Topic +* 支持批量获取用户绑定的UID +* 支持批量获取用户订阅的Topic + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Identity.WxPusher +``` + ## 模块引用 ```csharp [DependsOn(typeof(AbpIdentityWxPusherModule))] public class YouProjectModule : AbpModule { - // other + // other } ``` + +## 使用方式 + +该模块实现了 `IWxPusherUserStore` 接口,通过用户Claims存储WxPusher相关信息: + +* `AbpWxPusherClaimTypes.Uid`: 存储用户绑定的WxPusher UID +* `AbpWxPusherClaimTypes.Topic`: 存储用户订阅的Topic ID + +### 获取用户绑定的UID + +```csharp +public class YourService +{ + private readonly IWxPusherUserStore _wxPusherUserStore; + + public YourService(IWxPusherUserStore wxPusherUserStore) + { + _wxPusherUserStore = wxPusherUserStore; + } + + public async Task DoSomethingAsync(IEnumerable userIds) + { + var uids = await _wxPusherUserStore.GetBindUidsAsync(userIds); + // 使用获取到的uids进行消息推送等操作 + } +} +``` + +### 获取用户订阅的Topic + +```csharp +public class YourService +{ + private readonly IWxPusherUserStore _wxPusherUserStore; + + public YourService(IWxPusherUserStore wxPusherUserStore) + { + _wxPusherUserStore = wxPusherUserStore; + } + + public async Task DoSomethingAsync(IEnumerable userIds) + { + var topics = await _wxPusherUserStore.GetSubscribeTopicsAsync(userIds); + // 使用获取到的topics进行消息推送等操作 + } +} +``` + +## 源码位置 + +[LINGYUN.Abp.Identity.WxPusher](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher) diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/README.EN.md b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/README.EN.md new file mode 100644 index 000000000..92e6fe62b --- /dev/null +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/README.EN.md @@ -0,0 +1,98 @@ +# LINGYUN.Abp.WxPusher.SettingManagement + +WxPusher setting management module, providing management functionality for WxPusher-related settings. + +[简体中文](./README.md) + +## Features + +* WxPusher settings management + * AppToken management + * Security settings management +* Permission control + * Based on ABP permission system + * Fine-grained settings management permissions +* Multi-tenant support + * Global settings support + * Tenant-level settings support +* Localization support + * Multi-language interface + * Localized setting descriptions + +## Installation + +```bash +dotnet add package LINGYUN.Abp.WxPusher.SettingManagement +``` + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWxPusherSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Permission Configuration + +### 1. Permission Definitions + +* `WxPusher`: WxPusher permission group +* `WxPusher.ManageSetting`: Permission to manage WxPusher settings + +### 2. Authorization Configuration + +```csharp +public class YourAuthorizationProvider : AuthorizationProvider +{ + public override void Define(IAuthorizationDefinitionContext context) + { + var wxPusher = context.GetPermissionOrNull(WxPusherSettingPermissionNames.GroupName) + ?? context.AddGroup(WxPusherSettingPermissionNames.GroupName); + + wxPusher.AddPermission(WxPusherSettingPermissionNames.ManageSetting); + } +} +``` + +## Usage + +### 1. Getting Settings + +```csharp +public class YourService +{ + private readonly IWxPusherSettingAppService _wxPusherSettingAppService; + + public YourService(IWxPusherSettingAppService wxPusherSettingAppService) + { + _wxPusherSettingAppService = wxPusherSettingAppService; + } + + public async Task GetSettingsAsync() + { + // Get global settings + var globalSettings = await _wxPusherSettingAppService.GetAllForGlobalAsync(); + + // Get current tenant settings + var tenantSettings = await _wxPusherSettingAppService.GetAllForCurrentTenantAsync(); + } +} +``` + +### 2. API Endpoints + +* `GET /api/setting-management/wxpusher/by-global`: Get global settings +* `GET /api/setting-management/wxpusher/by-current-tenant`: Get current tenant settings + +## Important Notes + +1. Proper permission configuration is required to manage settings. +2. Sensitive information like AppToken needs to be properly secured. +3. Pay attention to the scope of settings in multi-tenant environments. + +## Source Code + +[LINGYUN.Abp.WxPusher.SettingManagement](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement) diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/README.md b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/README.md new file mode 100644 index 000000000..d7bb44da4 --- /dev/null +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/README.md @@ -0,0 +1,98 @@ +# LINGYUN.Abp.WxPusher.SettingManagement + +WxPusher设置管理模块,提供WxPusher相关设置的管理功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 支持WxPusher设置管理 + * AppToken管理 + * 安全设置管理 +* 权限控制 + * 基于ABP权限系统 + * 细粒度的设置管理权限 +* 多租户支持 + * 支持全局设置 + * 支持租户级设置 +* 本地化支持 + * 支持多语言界面 + * 支持本地化设置描述 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.WxPusher.SettingManagement +``` + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWxPusherSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 权限配置 + +### 1. 权限定义 + +* `WxPusher`: WxPusher权限组 +* `WxPusher.ManageSetting`: 管理WxPusher设置的权限 + +### 2. 授权配置 + +```csharp +public class YourAuthorizationProvider : AuthorizationProvider +{ + public override void Define(IAuthorizationDefinitionContext context) + { + var wxPusher = context.GetPermissionOrNull(WxPusherSettingPermissionNames.GroupName) + ?? context.AddGroup(WxPusherSettingPermissionNames.GroupName); + + wxPusher.AddPermission(WxPusherSettingPermissionNames.ManageSetting); + } +} +``` + +## 使用方式 + +### 1. 获取设置 + +```csharp +public class YourService +{ + private readonly IWxPusherSettingAppService _wxPusherSettingAppService; + + public YourService(IWxPusherSettingAppService wxPusherSettingAppService) + { + _wxPusherSettingAppService = wxPusherSettingAppService; + } + + public async Task GetSettingsAsync() + { + // 获取全局设置 + var globalSettings = await _wxPusherSettingAppService.GetAllForGlobalAsync(); + + // 获取当前租户设置 + var tenantSettings = await _wxPusherSettingAppService.GetAllForCurrentTenantAsync(); + } +} +``` + +### 2. API接口 + +* `GET /api/setting-management/wxpusher/by-global`: 获取全局设置 +* `GET /api/setting-management/wxpusher/by-current-tenant`: 获取当前租户设置 + +## 注意事项 + +1. 需要正确配置权限才能管理设置。 +2. AppToken等敏感信息需要妥善保管。 +3. 多租户环境下需要注意设置的作用范围。 + +## 源码位置 + +[LINGYUN.Abp.WxPusher.SettingManagement](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement) diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/README.EN.md b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/README.EN.md new file mode 100644 index 000000000..80529d14e --- /dev/null +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/README.EN.md @@ -0,0 +1,102 @@ +# LINGYUN.Abp.WxPusher + +ABP module integrating WxPusher WeChat push service, implementing WxPusher related API documentation and providing WxPusher capabilities. + +[简体中文](./README.md) + +For more details, see WxPusher documentation: https://wxpusher.dingliqc.com/docs/#/ + +## Features + +* Integration with WxPusher API +* Support message pushing to users and Topics +* Support multiple message types (Text, HTML, Markdown) +* Support message sending limits and quota management +* Support QR code generation +* Support user subscription management + +## Installation + +```bash +dotnet add package LINGYUN.Abp.WxPusher +``` + +## Module Reference + +```csharp +[DependsOn(typeof(AbpWxPusherModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +### Settings Configuration + +* `WxPusher.Security.AppToken`: Application identity token. With APP_TOKEN, you can send messages to users of the corresponding application. Please keep it strictly confidential. + +### Features Configuration + +* `WxPusher`: WxPusher feature group +* `WxPusher.Enable`: Globally enable WxPusher +* `WxPusher.Message.Enable`: Globally enable WxPusher message channel +* `WxPusher.Message`: WxPusher message push +* `WxPusher.Message.SendLimit`: WxPusher message push limit count +* `WxPusher.Message.SendLimitInterval`: WxPusher message push limit interval (days) + +## Usage + +### Sending Messages + +```csharp +public class YourService +{ + private readonly IWxPusherMessageSender _messageSender; + + public YourService(IWxPusherMessageSender messageSender) + { + _messageSender = messageSender; + } + + public async Task SendMessageAsync() + { + await _messageSender.SendAsync( + content: "Hello, WxPusher!", + summary: "Message Summary", + contentType: MessageContentType.Text, + topicIds: new List { 1, 2 }, // Optional: Send to specific Topics + uids: new List { "UID1", "UID2" }, // Optional: Send to specific users + url: "https://example.com" // Optional: URL to jump to when clicking the message + ); + } +} +``` + +### User Subscription + +Implement the `IWxPusherUserStore` interface to manage user subscriptions: + +```csharp +public class YourWxPusherUserStore : IWxPusherUserStore +{ + public async Task> GetBindUidsAsync( + IEnumerable userIds, + CancellationToken cancellationToken = default) + { + // Implement logic to get WxPusher UIDs bound to users + } + + public async Task> GetSubscribeTopicsAsync( + IEnumerable userIds, + CancellationToken cancellationToken = default) + { + // Implement logic to get Topic list subscribed by users + } +} +``` + +## Source Code + +[LINGYUN.Abp.WxPusher](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher) diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/README.md b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/README.md index aff1f7eed..19a98c639 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/README.md +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/README.md @@ -1,35 +1,102 @@ # LINGYUN.Abp.WxPusher -集成WxPusher +集成WxPusher微信推送服务的ABP模块,实现WxPusher相关Api文档,拥有WxPusher开放能力。 -实现WxPusher相关Api文档,拥有WxPusher开放能力 +[English](./README.EN.md) 详情见WxPusher文档: https://wxpusher.dingliqc.com/docs/#/ +## 功能特性 + +* 集成WxPusher API +* 支持消息推送到用户和Topic +* 支持多种消息类型(文本、HTML、Markdown) +* 支持消息发送限制和配额管理 +* 支持二维码生成 +* 支持用户订阅管理 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.WxPusher +``` + ## 模块引用 ```csharp [DependsOn(typeof(AbpWxPusherModule))] public class YouProjectModule : AbpModule { - // other + // other } ``` -## 用户订阅 +## 配置 + +### Settings配置 -实现 [IWxPusherUserStore](./LINGYUN/Abp/WxPusher/User/IWxPusherUserStore) 接口获取用户订阅列表 +* `WxPusher.Security.AppToken`: 应用的身份标志,拥有APP_TOKEN后可以给对应的应用的用户发送消息,请严格保密。 -## Features +### Features功能 + +* `WxPusher`: WxPusher特性分组 +* `WxPusher.Enable`: 全局启用WxPusher +* `WxPusher.Message.Enable`: 全局启用WxPusher消息通道 +* `WxPusher.Message`: WxPusher消息推送 +* `WxPusher.Message.SendLimit`: WxPusher消息推送限制次数 +* `WxPusher.Message.SendLimitInterval`: WxPusher消息推送限制周期(天) + +## 使用方式 + +### 发送消息 + +```csharp +public class YourService +{ + private readonly IWxPusherMessageSender _messageSender; -* WxPusher WxPusher特性分组 -* WxPusher.Enable 全局启用WxPusher -* WxPusher.Message.Enable 全局启用WxPusher消息通道 -* WxPusher.Message WxPusher消息推送 -* WxPusher.Message.Enable 启用WxPusher消息推送 -* WxPusher.Message.SendLimit WxPusher消息推送限制次数 -* WxPusher.Message.SendLimitInterval WxPusher消息推送限制周期(天) + public YourService(IWxPusherMessageSender messageSender) + { + _messageSender = messageSender; + } + + public async Task SendMessageAsync() + { + await _messageSender.SendAsync( + content: "Hello, WxPusher!", + summary: "消息摘要", + contentType: MessageContentType.Text, + topicIds: new List { 1, 2 }, // 可选:发送到指定Topic + uids: new List { "UID1", "UID2" }, // 可选:发送到指定用户 + url: "https://example.com" // 可选:点击消息跳转的URL + ); + } +} +``` + +### 用户订阅 + +实现 `IWxPusherUserStore` 接口来管理用户订阅: + +```csharp +public class YourWxPusherUserStore : IWxPusherUserStore +{ + public async Task> GetBindUidsAsync( + IEnumerable userIds, + CancellationToken cancellationToken = default) + { + // 实现获取用户绑定的WxPusher UID的逻辑 + } + + public async Task> GetSubscribeTopicsAsync( + IEnumerable userIds, + CancellationToken cancellationToken = default) + { + // 实现获取用户订阅的Topic列表的逻辑 + } +} +``` -## Settings +## 源码位置 -* WxPusher.Security.AppToken 应用的身份标志,拥有APP_TOKEN,就可以给对应的应用的用户发送消息, 请严格保密. +[LINGYUN.Abp.WxPusher](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher) diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/LY.MicroService.Applications.Single.DbMigrator.csproj b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/LY.MicroService.Applications.Single.DbMigrator.csproj index 5279f8ae4..438ad81cf 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/LY.MicroService.Applications.Single.DbMigrator.csproj +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/LY.MicroService.Applications.Single.DbMigrator.csproj @@ -46,19 +46,6 @@ - - - PreserveNewest - true - PreserveNewest - - - - - - - - diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/README.EN.md b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/README.EN.md new file mode 100644 index 000000000..e60db3ab6 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/README.EN.md @@ -0,0 +1,75 @@ +# LY.MicroService.Applications.Single.DbMigrator + +Single application database migration tool for automatically executing database migrations and initializing data. + +[简体中文](./README.md) + +## Features + +* Automatic database migration execution +* Multi-environment configuration support +* Integrated Serilog logging +* Data migration environment configuration support +* Automatic database migration check and application +* Console application, easy to integrate into CI/CD pipelines + +## Configuration + +```json +{ + "ConnectionStrings": { + "Default": "your-database-connection-string" + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Volo.Abp": "Warning" + } + } + } +} +``` + +## Basic Usage + +1. Configure Database Connection + * Configure database connection string in appsettings.json + * Use appsettings.{Environment}.json for different environment configurations + +2. Run Migration Tool + ```bash + dotnet run + ``` + +3. View Migration Logs + * Console output + * Logs/migrations.txt file + +## Environment Variables + +* `ASPNETCORE_ENVIRONMENT`: Set runtime environment (Development, Staging, Production, etc.) +* `DOTNET_ENVIRONMENT`: Same as above, for compatibility + +## Notes + +* Ensure database connection string includes sufficient permissions +* Recommended to backup database before executing migrations +* Check migrations.txt log file for migration details +* If migration fails, check error messages in logs + +## Development and Debugging + +1. Set Environment Variables + ```bash + export ASPNETCORE_ENVIRONMENT=Development + ``` + +2. Debug with Visual Studio or Visual Studio Code + * Set breakpoints + * View detailed migration process + +3. Customize Migration Logic + * Modify SingleDbMigrationService class + * Add new data seeds diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/README.md b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/README.md new file mode 100644 index 000000000..1a997f51b --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/README.md @@ -0,0 +1,75 @@ +# LY.MicroService.Applications.Single.DbMigrator + +单体应用数据库迁移工具,用于自动执行数据库迁移和初始化数据。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动执行数据库迁移 +* 支持多环境配置 +* 集成Serilog日志记录 +* 支持数据迁移环境配置 +* 自动检查和应用数据库迁移 +* 控制台应用程序,方便集成到CI/CD流程 + +## 配置项 + +```json +{ + "ConnectionStrings": { + "Default": "你的数据库连接字符串" + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Volo.Abp": "Warning" + } + } + } +} +``` + +## 基本用法 + +1. 配置数据库连接 + * 在appsettings.json中配置数据库连接字符串 + * 可以通过appsettings.{Environment}.json配置不同环境的连接字符串 + +2. 运行迁移工具 + ```bash + dotnet run + ``` + +3. 查看迁移日志 + * 控制台输出 + * Logs/migrations.txt文件 + +## 环境变量 + +* `ASPNETCORE_ENVIRONMENT`: 设置运行环境(Development、Staging、Production等) +* `DOTNET_ENVIRONMENT`: 同上,用于兼容性 + +## 注意事项 + +* 确保数据库连接字符串中包含足够的权限 +* 建议在执行迁移前备份数据库 +* 查看migrations.txt日志文件以了解迁移详情 +* 如果迁移失败,检查日志中的错误信息 + +## 开发调试 + +1. 设置环境变量 + ```bash + export ASPNETCORE_ENVIRONMENT=Development + ``` + +2. 使用Visual Studio或Visual Studio Code进行调试 + * 可以设置断点 + * 查看详细的迁移过程 + +3. 自定义迁移逻辑 + * 修改SingleDbMigrationService类 + * 添加新的数据种子 diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.Development.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.MySql.json similarity index 100% rename from aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.Development.json rename to aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.MySql.json diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/SingleMigrationsDbContextFactory.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/SingleMigrationsDbContextFactory.cs index c90580072..0916c22a7 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/SingleMigrationsDbContextFactory.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/SingleMigrationsDbContextFactory.cs @@ -24,7 +24,7 @@ public class SingleMigrationsDbContextFactory : IDesignTimeDbContextFactory(); + + Configure(options => + { + options.UseMySQL(); + }); + } + ``` + +3. Execute Database Migration + * Use EF Core CLI tools to execute migrations + ```bash + dotnet ef database update + ``` + +## Notes + +* Ensure the database connection string includes the correct permissions to create and modify database tables +* It's recommended to backup the database before executing migrations +* Migration scripts will automatically handle dependencies between modules diff --git a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/README.md b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/README.md new file mode 100644 index 000000000..a29091af8 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/README.md @@ -0,0 +1,76 @@ +# LY.MicroService.AuthServer.EntityFrameworkCore + +认证服务器数据库迁移模块,提供认证服务器所需的数据库迁移功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 集成OpenIddict认证框架的数据库迁移 +* 集成ABP Identity模块的数据库迁移 +* 集成ABP权限管理模块的数据库迁移 +* 集成ABP设置管理模块的数据库迁移 +* 集成ABP特性管理模块的数据库迁移 +* 集成ABP SaaS多租户模块的数据库迁移 +* 集成文本模板模块的数据库迁移 +* 支持MySQL数据库 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpAuthorizationModule), + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpOpenIddictEntityFrameworkCoreModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpTextTemplatingEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +public class YourModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "AuthServerDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置AuthServerDbMigrator连接字符串 + +2. 添加数据库上下文 + ```csharp + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(); + + Configure(options => + { + options.UseMySQL(); + }); + } + ``` + +3. 执行数据库迁移 + * 使用EF Core命令行工具执行迁移 + ```bash + dotnet ef database update + ``` + +## 注意事项 + +* 确保数据库连接字符串中包含正确的权限,以便能够创建和修改数据库表 +* 在执行迁移之前,建议先备份数据库 +* 迁移脚本会自动处理模块间的依赖关系 diff --git a/aspnet-core/migrations/LY.MicroService.BackendAdmin.DbMigrator/README.EN.md b/aspnet-core/migrations/LY.MicroService.BackendAdmin.DbMigrator/README.EN.md new file mode 100644 index 000000000..d0fb379bc --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.BackendAdmin.DbMigrator/README.EN.md @@ -0,0 +1,98 @@ +# LY.MicroService.BackendAdmin.DbMigrator + +Backend Administration System Database Migration Console Application, used for executing database migrations and initializing seed data for the backend administration system. + +[简体中文](./README.md) + +## Features + +* Automatic database migration execution +* Initialize necessary system seed data +* Support command line parameter configuration +* Integrated Autofac dependency injection container +* Integrated Feature Management +* Integrated Setting Management +* Integrated Permission Management +* Integrated Localization Management +* Integrated Cache Management +* Integrated Auditing +* Integrated Text Templating +* Integrated Identity Authentication +* Integrated IdentityServer +* Integrated OpenIddict +* Integrated Platform Management +* Integrated Object Storage Management +* Integrated Notification System +* Integrated Message Service +* Integrated Task Management +* Integrated Webhooks Management + +## Module Dependencies + +```csharp +[DependsOn( + typeof(BackendAdminMigrationsEntityFrameworkCoreModule), + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpLocalizationManagementApplicationContractsModule), + typeof(AbpCachingManagementApplicationContractsModule), + typeof(AbpAuditingApplicationContractsModule), + typeof(AbpTextTemplatingApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpIdentityServerApplicationContractsModule), + typeof(AbpOpenIddictApplicationContractsModule), + typeof(PlatformApplicationContractModule), + typeof(AbpOssManagementApplicationContractsModule), + typeof(AbpNotificationsApplicationContractsModule), + typeof(AbpMessageServiceApplicationContractsModule), + typeof(TaskManagementApplicationContractsModule), + typeof(WebhooksManagementApplicationContractsModule), + typeof(AbpAutofacModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "BackendAdminDbMigrator": "Your database connection string" + }, + "IdentityServer": { + "Clients": { + "BackendAdmin_App": { + "ClientId": "BackendAdmin_App" + } + } + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure BackendAdminDbMigrator connection string in appsettings.json + +2. Run Migration Program + ```bash + dotnet run + ``` + +## Command Line Arguments + +* --database-provider + * Specify database provider (default: MySQL) +* --connection-string + * Specify database connection string +* --skip-db-migrations + * Skip database migrations +* --skip-seed-data + * Skip seed data initialization + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [EF Core Migrations Documentation](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/) +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io) +* [OpenIddict Documentation](https://documentation.openiddict.com) diff --git a/aspnet-core/migrations/LY.MicroService.BackendAdmin.DbMigrator/README.md b/aspnet-core/migrations/LY.MicroService.BackendAdmin.DbMigrator/README.md new file mode 100644 index 000000000..cfedda71c --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.BackendAdmin.DbMigrator/README.md @@ -0,0 +1,98 @@ +# LY.MicroService.BackendAdmin.DbMigrator + +后台管理系统数据库迁移控制台应用程序,用于执行后台管理系统的数据库迁移和初始化种子数据。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动执行数据库迁移 +* 初始化系统必要的种子数据 +* 支持命令行参数配置 +* 集成Autofac依赖注入容器 +* 集成特性管理功能 +* 集成设置管理功能 +* 集成权限管理功能 +* 集成本地化管理功能 +* 集成缓存管理功能 +* 集成审计日志功能 +* 集成文本模板功能 +* 集成身份认证功能 +* 集成IdentityServer功能 +* 集成OpenIddict功能 +* 集成平台管理功能 +* 集成对象存储功能 +* 集成通知系统功能 +* 集成消息服务功能 +* 集成任务管理功能 +* 集成Webhooks管理功能 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(BackendAdminMigrationsEntityFrameworkCoreModule), + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpLocalizationManagementApplicationContractsModule), + typeof(AbpCachingManagementApplicationContractsModule), + typeof(AbpAuditingApplicationContractsModule), + typeof(AbpTextTemplatingApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpIdentityServerApplicationContractsModule), + typeof(AbpOpenIddictApplicationContractsModule), + typeof(PlatformApplicationContractModule), + typeof(AbpOssManagementApplicationContractsModule), + typeof(AbpNotificationsApplicationContractsModule), + typeof(AbpMessageServiceApplicationContractsModule), + typeof(TaskManagementApplicationContractsModule), + typeof(WebhooksManagementApplicationContractsModule), + typeof(AbpAutofacModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "BackendAdminDbMigrator": "你的数据库连接字符串" + }, + "IdentityServer": { + "Clients": { + "BackendAdmin_App": { + "ClientId": "BackendAdmin_App" + } + } + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置BackendAdminDbMigrator连接字符串 + +2. 运行迁移程序 + ```bash + dotnet run + ``` + +## 命令行参数 + +* --database-provider + * 指定数据库提供程序 (默认: MySQL) +* --connection-string + * 指定数据库连接字符串 +* --skip-db-migrations + * 跳过数据库迁移 +* --skip-seed-data + * 跳过种子数据初始化 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [EF Core迁移文档](https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/) +* [IdentityServer4文档](https://identityserver4.readthedocs.io) +* [OpenIddict文档](https://documentation.openiddict.com) diff --git a/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/README.EN.md b/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..ae8a99c84 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/README.EN.md @@ -0,0 +1,67 @@ +# LY.MicroService.BackendAdmin.EntityFrameworkCore + +Backend Administration Database Migration Module, providing database migration functionality for the backend management system. + +[简体中文](./README.md) + +## Features + +* Integrated SaaS multi-tenancy data migration +* Integrated Setting Management data migration +* Integrated Data Protection Management data migration +* Integrated Permission Management data migration +* Integrated Feature Management data migration +* Integrated Text Templating data migration +* Support for MySQL database + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpDataProtectionManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpTextTemplatingEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "BackendAdminDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure BackendAdminDbMigrator connection string in appsettings.json + +2. Add Module Dependency + ```csharp + [DependsOn(typeof(BackendAdminMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## Database Tables Description + +* Saas Related Tables - Tenant, edition and other multi-tenancy related data +* AbpSettings - System settings data +* AbpDataProtection - Data protection related data +* AbpPermissionGrants - Permission authorization data +* AbpFeatures - Feature data +* AbpTextTemplates - Text template data + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [ASP.NET Core Data Protection](https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/introduction) diff --git a/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/README.md b/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/README.md new file mode 100644 index 000000000..bca4f966b --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/README.md @@ -0,0 +1,67 @@ +# LY.MicroService.BackendAdmin.EntityFrameworkCore + +后台管理数据迁移模块,提供后台管理系统相关的数据库迁移功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 集成SaaS多租户数据迁移 +* 集成设置管理数据迁移 +* 集成数据保护管理数据迁移 +* 集成权限管理数据迁移 +* 集成特性管理数据迁移 +* 集成文本模板数据迁移 +* 支持MySQL数据库 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpDataProtectionManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpTextTemplatingEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "BackendAdminDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置BackendAdminDbMigrator连接字符串 + +2. 添加模块依赖 + ```csharp + [DependsOn(typeof(BackendAdminMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## 数据库表说明 + +* Saas相关表 - 租户、版本等多租户相关数据 +* AbpSettings - 系统设置数据 +* AbpDataProtection - 数据保护相关数据 +* AbpPermissionGrants - 权限授权数据 +* AbpFeatures - 功能特性数据 +* AbpTextTemplates - 文本模板数据 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [ASP.NET Core数据保护](https://docs.microsoft.com/zh-cn/aspnet/core/security/data-protection/introduction) diff --git a/aspnet-core/migrations/LY.MicroService.IdentityServer.DbMigrator/README.EN.md b/aspnet-core/migrations/LY.MicroService.IdentityServer.DbMigrator/README.EN.md new file mode 100644 index 000000000..0a9fa59db --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.IdentityServer.DbMigrator/README.EN.md @@ -0,0 +1,79 @@ +# LY.MicroService.IdentityServer.DbMigrator + +Identity Server Database Migration Console Application, used for executing database migrations and initializing seed data for the identity server. + +[简体中文](./README.md) + +## Features + +* Automatic database migration execution +* Initialize necessary system seed data +* Support command line parameter configuration +* Integrated Autofac dependency injection container +* Inherit all migration features from identity server +* Support IdentityServer4 configuration +* Support OAuth 2.0 and OpenID Connect protocols +* Support user and role management +* Support client and API resource management + +## Module Dependencies + +```csharp +[DependsOn( + typeof(IdentityServerMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "IdentityServerDbMigrator": "Your database connection string" + }, + "IdentityServer": { + "Clients": { + "IdentityServer_App": { + "ClientId": "IdentityServer_App" + } + } + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure IdentityServerDbMigrator connection string in appsettings.json + +2. Run Migration Program + ```bash + dotnet run + ``` + +## Command Line Arguments + +* --database-provider + * Specify database provider (default: MySQL) +* --connection-string + * Specify database connection string +* --skip-db-migrations + * Skip database migrations +* --skip-seed-data + * Skip seed data initialization + +## Seed Data + +* Default users and roles +* Standard identity resources +* API resources and scopes +* Default client configurations +* Basic permission configurations + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io) +* [OAuth 2.0 Specification](https://oauth.net/2/) +* [OpenID Connect Specification](https://openid.net/connect/) diff --git a/aspnet-core/migrations/LY.MicroService.IdentityServer.DbMigrator/README.md b/aspnet-core/migrations/LY.MicroService.IdentityServer.DbMigrator/README.md new file mode 100644 index 000000000..1a88c522b --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.IdentityServer.DbMigrator/README.md @@ -0,0 +1,79 @@ +# LY.MicroService.IdentityServer.DbMigrator + +身份认证服务器数据库迁移控制台应用程序,用于执行身份认证服务器的数据库迁移和初始化种子数据。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动执行数据库迁移 +* 初始化系统必要的种子数据 +* 支持命令行参数配置 +* 集成Autofac依赖注入容器 +* 继承身份认证服务器的所有迁移功能 +* 支持IdentityServer4配置 +* 支持OAuth 2.0和OpenID Connect协议 +* 支持用户和角色管理 +* 支持客户端和API资源管理 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(IdentityServerMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "IdentityServerDbMigrator": "你的数据库连接字符串" + }, + "IdentityServer": { + "Clients": { + "IdentityServer_App": { + "ClientId": "IdentityServer_App" + } + } + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置IdentityServerDbMigrator连接字符串 + +2. 运行迁移程序 + ```bash + dotnet run + ``` + +## 命令行参数 + +* --database-provider + * 指定数据库提供程序 (默认: MySQL) +* --connection-string + * 指定数据库连接字符串 +* --skip-db-migrations + * 跳过数据库迁移 +* --skip-seed-data + * 跳过种子数据初始化 + +## 种子数据 + +* 默认用户和角色 +* 标准身份资源 +* API资源和范围 +* 默认客户端配置 +* 基本权限配置 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [IdentityServer4文档](https://identityserver4.readthedocs.io) +* [OAuth 2.0规范](https://oauth.net/2/) +* [OpenID Connect规范](https://openid.net/connect/) diff --git a/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/README.EN.md b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..7d0a5cf57 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/README.EN.md @@ -0,0 +1,72 @@ +# LY.MicroService.IdentityServer.EntityFrameworkCore + +Identity Server Database Migration Module, providing database migration functionality for IdentityServer. + +[简体中文](./README.md) + +## Features + +* Integrated ABP Identity data migration +* Integrated IdentityServer data migration +* Integrated Permission Management data migration +* Integrated Setting Management data migration +* Integrated Feature Management data migration +* Integrated Text Templating data migration +* Integrated SaaS multi-tenancy data migration +* Support for MySQL database + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpIdentityServerEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpTextTemplatingEntityFrameworkCoreModule), + typeof(AbpWeChatModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "IdentityServerDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure IdentityServerDbMigrator connection string in appsettings.json + +2. Add Module Dependency + ```csharp + [DependsOn(typeof(IdentityServerMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## Database Tables Description + +* Identity Related Tables - User, role, claims and other authentication related data +* IdentityServer Related Tables - Client, API resources, identity resources and other OAuth/OpenID Connect related data +* AbpPermissionGrants - Permission authorization data +* AbpSettings - System settings data +* AbpFeatures - Feature data +* AbpTextTemplates - Text template data +* Saas Related Tables - Tenant, edition and other multi-tenancy related data + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io) diff --git a/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/README.md b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/README.md new file mode 100644 index 000000000..b6d261846 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/README.md @@ -0,0 +1,72 @@ +# LY.MicroService.IdentityServer.EntityFrameworkCore + +身份认证服务器数据迁移模块,提供IdentityServer的数据库迁移功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 集成ABP Identity数据迁移 +* 集成IdentityServer数据迁移 +* 集成权限管理数据迁移 +* 集成设置管理数据迁移 +* 集成特性管理数据迁移 +* 集成文本模板数据迁移 +* 集成SaaS多租户数据迁移 +* 支持MySQL数据库 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpIdentityServerEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpTextTemplatingEntityFrameworkCoreModule), + typeof(AbpWeChatModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "IdentityServerDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置IdentityServerDbMigrator连接字符串 + +2. 添加模块依赖 + ```csharp + [DependsOn(typeof(IdentityServerMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## 数据库表说明 + +* Identity相关表 - 用户、角色、声明等身份认证相关数据 +* IdentityServer相关表 - 客户端、API资源、身份资源等OAuth/OpenID Connect相关数据 +* AbpPermissionGrants - 权限授权数据 +* AbpSettings - 系统设置数据 +* AbpFeatures - 功能特性数据 +* AbpTextTemplates - 文本模板数据 +* Saas相关表 - 租户、版本等多租户相关数据 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [IdentityServer4文档](https://identityserver4.readthedocs.io) diff --git a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.DbMigrator/README.EN.md b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.DbMigrator/README.EN.md new file mode 100644 index 000000000..0250062a1 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.DbMigrator/README.EN.md @@ -0,0 +1,68 @@ +# LY.MicroService.LocalizationManagement.DbMigrator + +Localization Management Database Migration Console Application, used for executing database migrations and initializing seed data for the localization management system. + +[简体中文](./README.md) + +## Features + +* Automatic database migration execution +* Initialize necessary system seed data +* Support command line parameter configuration +* Integrated Autofac dependency injection container +* Inherit all migration features from localization management system +* Support multi-language resource management +* Support dynamic language text management +* Support language management + +## Module Dependencies + +```csharp +[DependsOn( + typeof(LocalizationManagementMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "LocalizationManagementDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure LocalizationManagementDbMigrator connection string in appsettings.json + +2. Run Migration Program + ```bash + dotnet run + ``` + +## Command Line Arguments + +* --database-provider + * Specify database provider (default: MySQL) +* --connection-string + * Specify database connection string +* --skip-db-migrations + * Skip database migrations +* --skip-seed-data + * Skip seed data initialization + +## Seed Data + +* Default language configurations +* Basic localization resources +* System text resources +* Default permission configurations + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [ABP Localization Documentation](https://docs.abp.io/en/abp/latest/Localization) diff --git a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.DbMigrator/README.md b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.DbMigrator/README.md new file mode 100644 index 000000000..a5589741d --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.DbMigrator/README.md @@ -0,0 +1,68 @@ +# LY.MicroService.LocalizationManagement.DbMigrator + +本地化管理数据库迁移控制台应用程序,用于执行本地化管理系统的数据库迁移和初始化种子数据。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动执行数据库迁移 +* 初始化系统必要的种子数据 +* 支持命令行参数配置 +* 集成Autofac依赖注入容器 +* 继承本地化管理系统的所有迁移功能 +* 支持多语言资源管理 +* 支持动态语言文本管理 +* 支持语言管理 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(LocalizationManagementMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "LocalizationManagementDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置LocalizationManagementDbMigrator连接字符串 + +2. 运行迁移程序 + ```bash + dotnet run + ``` + +## 命令行参数 + +* --database-provider + * 指定数据库提供程序 (默认: MySQL) +* --connection-string + * 指定数据库连接字符串 +* --skip-db-migrations + * 跳过数据库迁移 +* --skip-seed-data + * 跳过种子数据初始化 + +## 种子数据 + +* 默认语言配置 +* 基础本地化资源 +* 系统文本资源 +* 默认权限配置 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [ABP本地化文档](https://docs.abp.io/zh-Hans/abp/latest/Localization) diff --git a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/README.EN.md b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..19fd5344b --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/README.EN.md @@ -0,0 +1,64 @@ +# LY.MicroService.LocalizationManagement.EntityFrameworkCore + +Localization Management Database Migration Module, providing database migration functionality for the localization management system. + +[简体中文](./README.md) + +## Features + +* Integrated SaaS multi-tenancy data migration +* Integrated Localization Management data migration +* Integrated Setting Management data migration +* Integrated Permission Management data migration +* Integrated Feature Management data migration +* Support for MySQL database + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpLocalizationManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "LocalizationManagementDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure LocalizationManagementDbMigrator connection string in appsettings.json + +2. Add Module Dependency + ```csharp + [DependsOn(typeof(LocalizationManagementMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## Database Tables Description + +* AbpLocalization - Localization resources and text data +* Saas Related Tables - Tenant, edition and other multi-tenancy related data +* AbpSettings - System settings data +* AbpPermissionGrants - Permission authorization data +* AbpFeatures - Feature data + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [ABP Localization Documentation](https://docs.abp.io/en/abp/latest/Localization) diff --git a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/README.md b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/README.md new file mode 100644 index 000000000..c506bdc1c --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/README.md @@ -0,0 +1,64 @@ +# LY.MicroService.LocalizationManagement.EntityFrameworkCore + +本地化管理数据迁移模块,提供本地化管理系统相关的数据库迁移功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 集成SaaS多租户数据迁移 +* 集成本地化管理数据迁移 +* 集成设置管理数据迁移 +* 集成权限管理数据迁移 +* 集成特性管理数据迁移 +* 支持MySQL数据库 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpLocalizationManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "LocalizationManagementDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置LocalizationManagementDbMigrator连接字符串 + +2. 添加模块依赖 + ```csharp + [DependsOn(typeof(LocalizationManagementMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## 数据库表说明 + +* AbpLocalization - 本地化资源和文本数据 +* Saas相关表 - 租户、版本等多租户相关数据 +* AbpSettings - 系统设置数据 +* AbpPermissionGrants - 权限授权数据 +* AbpFeatures - 功能特性数据 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [ABP本地化文档](https://docs.abp.io/zh-Hans/abp/latest/Localization) diff --git a/aspnet-core/migrations/LY.MicroService.Platform.DbMigrator/README.EN.md b/aspnet-core/migrations/LY.MicroService.Platform.DbMigrator/README.EN.md new file mode 100644 index 000000000..12bbd4be5 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Platform.DbMigrator/README.EN.md @@ -0,0 +1,71 @@ +# LY.MicroService.Platform.DbMigrator + +Platform Management Database Migration Console Application, used for executing database migrations and initializing seed data for the platform management system. + +[简体中文](./README.md) + +## Features + +* Automatic database migration execution +* Initialize necessary system seed data +* Support command line parameter configuration +* Integrated Autofac dependency injection container +* Inherit all migration features from platform management system +* Support data dictionary management +* Support organization management +* Support menu management +* Support version management +* Support Vue Vben Admin UI navigation + +## Module Dependencies + +```csharp +[DependsOn( + typeof(PlatformMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "PlatformDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure PlatformDbMigrator connection string in appsettings.json + +2. Run Migration Program + ```bash + dotnet run + ``` + +## Command Line Arguments + +* --database-provider + * Specify database provider (default: MySQL) +* --connection-string + * Specify database connection string +* --skip-db-migrations + * Skip database migrations +* --skip-seed-data + * Skip seed data initialization + +## Seed Data + +* Default data dictionaries +* Basic organizations +* System menus +* Default version configurations +* UI navigation configurations + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [Vue Vben Admin Documentation](https://doc.vvbin.cn/) diff --git a/aspnet-core/migrations/LY.MicroService.Platform.DbMigrator/README.md b/aspnet-core/migrations/LY.MicroService.Platform.DbMigrator/README.md new file mode 100644 index 000000000..a1b7a8481 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Platform.DbMigrator/README.md @@ -0,0 +1,71 @@ +# LY.MicroService.Platform.DbMigrator + +平台管理数据库迁移控制台应用程序,用于执行平台管理系统的数据库迁移和初始化种子数据。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动执行数据库迁移 +* 初始化系统必要的种子数据 +* 支持命令行参数配置 +* 集成Autofac依赖注入容器 +* 继承平台管理系统的所有迁移功能 +* 支持数据字典管理 +* 支持组织机构管理 +* 支持菜单管理 +* 支持版本管理 +* 支持Vue Vben Admin UI导航 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(PlatformMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "PlatformDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置PlatformDbMigrator连接字符串 + +2. 运行迁移程序 + ```bash + dotnet run + ``` + +## 命令行参数 + +* --database-provider + * 指定数据库提供程序 (默认: MySQL) +* --connection-string + * 指定数据库连接字符串 +* --skip-db-migrations + * 跳过数据库迁移 +* --skip-seed-data + * 跳过种子数据初始化 + +## 种子数据 + +* 默认数据字典 +* 基础组织机构 +* 系统菜单 +* 默认版本配置 +* UI导航配置 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [Vue Vben Admin文档](https://doc.vvbin.cn/) diff --git a/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/README.EN.md b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..ee66ad2a4 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/README.EN.md @@ -0,0 +1,67 @@ +# LY.MicroService.Platform.EntityFrameworkCore + +Platform Management Database Migration Module, providing database migration functionality for the platform management system. + +[简体中文](./README.md) + +## Features + +* Integrated SaaS multi-tenancy data migration +* Integrated Platform Management data migration +* Integrated Setting Management data migration +* Integrated Permission Management data migration +* Integrated Feature Management data migration +* Integrated Vue Vben Admin UI navigation data migration +* Support for MySQL database + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(PlatformEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpUINavigationVueVbenAdminModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "PlatformDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure PlatformDbMigrator connection string in appsettings.json + +2. Add Module Dependency + ```csharp + [DependsOn(typeof(PlatformMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## Database Tables Description + +* Platform Related Tables - Contains data dictionary, organization structure, menu, version and other platform basic data +* Saas Related Tables - Tenant, edition and other multi-tenancy related data +* AbpSettings - System settings data +* AbpPermissionGrants - Permission authorization data +* AbpFeatures - Feature data +* AbpUINavigation - Vue Vben Admin UI navigation data + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [Vue Vben Admin Documentation](https://doc.vvbin.cn/) diff --git a/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/README.md b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/README.md new file mode 100644 index 000000000..ec0856f0c --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/README.md @@ -0,0 +1,67 @@ +# LY.MicroService.Platform.EntityFrameworkCore + +平台管理数据迁移模块,提供平台管理系统相关的数据库迁移功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 集成SaaS多租户数据迁移 +* 集成平台管理数据迁移 +* 集成设置管理数据迁移 +* 集成权限管理数据迁移 +* 集成特性管理数据迁移 +* 集成Vue Vben Admin UI导航数据迁移 +* 支持MySQL数据库 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(PlatformEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpUINavigationVueVbenAdminModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "PlatformDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置PlatformDbMigrator连接字符串 + +2. 添加模块依赖 + ```csharp + [DependsOn(typeof(PlatformMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## 数据库表说明 + +* Platform相关表 - 包含数据字典、组织机构、菜单、版本等平台基础数据 +* Saas相关表 - 租户、版本等多租户相关数据 +* AbpSettings - 系统设置数据 +* AbpPermissionGrants - 权限授权数据 +* AbpFeatures - 功能特性数据 +* AbpUINavigation - Vue Vben Admin UI导航数据 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [Vue Vben Admin文档](https://doc.vvbin.cn/) diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/README.EN.md b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/README.EN.md new file mode 100644 index 000000000..4d437bd50 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/README.EN.md @@ -0,0 +1,69 @@ +# LY.MicroService.RealtimeMessage.DbMigrator + +Real-time Message Database Migration Console Application, used for executing database migrations and initializing seed data for the real-time message system. + +[简体中文](./README.md) + +## Features + +* Automatic database migration execution +* Initialize necessary system seed data +* Support command line parameter configuration +* Integrated Autofac dependency injection container +* Inherit all migration features from real-time message system +* Support SignalR message management +* Support message group management +* Support message subscription management +* Support message history + +## Module Dependencies + +```csharp +[DependsOn( + typeof(RealtimeMessageMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "RealtimeMessageDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure RealtimeMessageDbMigrator connection string in appsettings.json + +2. Run Migration Program + ```bash + dotnet run + ``` + +## Command Line Arguments + +* --database-provider + * Specify database provider (default: MySQL) +* --connection-string + * Specify database connection string +* --skip-db-migrations + * Skip database migrations +* --skip-seed-data + * Skip seed data initialization + +## Seed Data + +* Default message group configurations +* Basic message subscription configurations +* System message templates +* Default permission configurations + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [SignalR Documentation](https://docs.microsoft.com/aspnet/core/signalr/introduction) diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/README.md b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/README.md new file mode 100644 index 000000000..36a2b00e0 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/README.md @@ -0,0 +1,69 @@ +# LY.MicroService.RealtimeMessage.DbMigrator + +实时消息数据库迁移控制台应用程序,用于执行实时消息系统的数据库迁移和初始化种子数据。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动执行数据库迁移 +* 初始化系统必要的种子数据 +* 支持命令行参数配置 +* 集成Autofac依赖注入容器 +* 继承实时消息系统的所有迁移功能 +* 支持SignalR消息管理 +* 支持消息分组管理 +* 支持消息订阅管理 +* 支持消息历史记录 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(RealtimeMessageMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "RealtimeMessageDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置RealtimeMessageDbMigrator连接字符串 + +2. 运行迁移程序 + ```bash + dotnet run + ``` + +## 命令行参数 + +* --database-provider + * 指定数据库提供程序 (默认: MySQL) +* --connection-string + * 指定数据库连接字符串 +* --skip-db-migrations + * 跳过数据库迁移 +* --skip-seed-data + * 跳过种子数据初始化 + +## 种子数据 + +* 默认消息组配置 +* 基础消息订阅配置 +* 系统消息模板 +* 默认权限配置 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [SignalR文档](https://docs.microsoft.com/aspnet/core/signalr/introduction) diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/README.EN.md b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..8942ab5dd --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/README.EN.md @@ -0,0 +1,71 @@ +# LY.MicroService.RealtimeMessage.EntityFrameworkCore + +Real-time Message Database Migration Module, providing database migration functionality for real-time messaging and notification systems. + +[简体中文](./README.md) + +## Features + +* Integrated SaaS multi-tenancy data migration +* Integrated Notification System data migration +* Integrated Message Service data migration +* Integrated Text Templating data migration +* Integrated Setting Management data migration +* Integrated Permission Management data migration +* Integrated Feature Management data migration +* Support for MySQL database + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpNotificationsEntityFrameworkCoreModule), + typeof(AbpMessageServiceEntityFrameworkCoreModule), + typeof(AbpTextTemplatingEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "RealtimeMessageDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure RealtimeMessageDbMigrator connection string in appsettings.json + +2. Add Module Dependency + ```csharp + [DependsOn(typeof(RealtimeMessageMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## Database Tables Description + +* AbpNotifications - Notification system data tables +* AbpNotificationsDefinition - Notification definition data tables +* AbpMessageService - Message service data tables +* Saas Related Tables - Tenant, edition and other multi-tenancy related data +* AbpSettings - System settings data +* AbpPermissionGrants - Permission authorization data +* AbpFeatures - Feature data +* AbpTextTemplates - Text template data + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [ABP Notification System Documentation](https://docs.abp.io/en/abp/latest/Notification-System) diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/README.md b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/README.md new file mode 100644 index 000000000..3cc1243c8 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/README.md @@ -0,0 +1,71 @@ +# LY.MicroService.RealtimeMessage.EntityFrameworkCore + +实时消息数据迁移模块,提供实时消息和通知系统相关的数据库迁移功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 集成SaaS多租户数据迁移 +* 集成通知系统数据迁移 +* 集成消息服务数据迁移 +* 集成文本模板数据迁移 +* 集成设置管理数据迁移 +* 集成权限管理数据迁移 +* 集成特性管理数据迁移 +* 支持MySQL数据库 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(AbpNotificationsEntityFrameworkCoreModule), + typeof(AbpMessageServiceEntityFrameworkCoreModule), + typeof(AbpTextTemplatingEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "RealtimeMessageDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置RealtimeMessageDbMigrator连接字符串 + +2. 添加模块依赖 + ```csharp + [DependsOn(typeof(RealtimeMessageMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## 数据库表说明 + +* AbpNotifications - 通知系统数据表 +* AbpNotificationsDefinition - 通知定义数据表 +* AbpMessageService - 消息服务数据表 +* Saas相关表 - 租户、版本等多租户相关数据 +* AbpSettings - 系统设置数据 +* AbpPermissionGrants - 权限授权数据 +* AbpFeatures - 功能特性数据 +* AbpTextTemplates - 文本模板数据 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [ABP通知系统文档](https://docs.abp.io/zh-Hans/abp/latest/Notification-System) diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/README.EN.md b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/README.EN.md new file mode 100644 index 000000000..2fa132c9d --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/README.EN.md @@ -0,0 +1,65 @@ +# LY.MicroService.TaskManagement.DbMigrator + +Task Management Database Migration Console Application, used for executing database migrations and initializing seed data for the task management system. + +[简体中文](./README.md) + +## Features + +* Automatic database migration execution +* Initialize necessary system seed data +* Support command line parameter configuration +* Integrated Autofac dependency injection container +* Inherit all migration features from task management system + +## Module Dependencies + +```csharp +[DependsOn( + typeof(TaskManagementMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "TaskManagementDbMigrator": "Your database connection string" + }, + "IdentityServer": { + "Clients": { + "TaskManagement_App": { + "ClientId": "TaskManagement_App" + } + } + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure TaskManagementDbMigrator connection string in appsettings.json + +2. Run Migration Program + ```bash + dotnet run + ``` + +## Command Line Arguments + +* --database-provider + * Specify database provider (default: MySQL) +* --connection-string + * Specify database connection string +* --skip-db-migrations + * Skip database migrations +* --skip-seed-data + * Skip seed data initialization + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [EF Core Migrations Documentation](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/) diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/README.md b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/README.md new file mode 100644 index 000000000..022349040 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.DbMigrator/README.md @@ -0,0 +1,65 @@ +# LY.MicroService.TaskManagement.DbMigrator + +任务管理数据库迁移控制台应用程序,用于执行任务管理系统的数据库迁移和初始化种子数据。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动执行数据库迁移 +* 初始化系统必要的种子数据 +* 支持命令行参数配置 +* 集成Autofac依赖注入容器 +* 继承任务管理系统的所有迁移功能 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(TaskManagementMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "TaskManagementDbMigrator": "你的数据库连接字符串" + }, + "IdentityServer": { + "Clients": { + "TaskManagement_App": { + "ClientId": "TaskManagement_App" + } + } + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置TaskManagementDbMigrator连接字符串 + +2. 运行迁移程序 + ```bash + dotnet run + ``` + +## 命令行参数 + +* --database-provider + * 指定数据库提供程序 (默认: MySQL) +* --connection-string + * 指定数据库连接字符串 +* --skip-db-migrations + * 跳过数据库迁移 +* --skip-seed-data + * 跳过种子数据初始化 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [EF Core迁移文档](https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/) diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/README.EN.md b/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..204c9aa0f --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/README.EN.md @@ -0,0 +1,68 @@ +# LY.MicroService.TaskManagement.EntityFrameworkCore + +Task Management Database Migration Module, providing database migration functionality for the task management system. + +[简体中文](./README.md) + +## Features + +* Integrated SaaS multi-tenancy data migration +* Integrated Task Management data migration +* Integrated Setting Management data migration +* Integrated Permission Management data migration +* Integrated Feature Management data migration +* Support for MySQL database + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(TaskManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "TaskManagementDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure TaskManagementDbMigrator connection string in appsettings.json + +2. Add Module Dependency + ```csharp + [DependsOn(typeof(TaskManagementMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## Database Tables Description + +* AbpTasks - Task basic information table +* AbpTaskCategories - Task categories table +* AbpTaskStatuses - Task statuses table +* AbpTaskAssignments - Task assignments table +* Saas Related Tables - Tenant, edition and other multi-tenancy related data +* AbpSettings - System settings data +* AbpPermissionGrants - Permission authorization data +* AbpFeatures - Feature data + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [ABP Task Management Module](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/modules/task-management) diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/README.md b/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/README.md new file mode 100644 index 000000000..b98067158 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/README.md @@ -0,0 +1,68 @@ +# LY.MicroService.TaskManagement.EntityFrameworkCore + +任务管理数据迁移模块,提供任务管理系统相关的数据库迁移功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 集成SaaS多租户数据迁移 +* 集成任务管理数据迁移 +* 集成设置管理数据迁移 +* 集成权限管理数据迁移 +* 集成特性管理数据迁移 +* 支持MySQL数据库 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(TaskManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "TaskManagementDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置TaskManagementDbMigrator连接字符串 + +2. 添加模块依赖 + ```csharp + [DependsOn(typeof(TaskManagementMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## 数据库表说明 + +* AbpTasks - 任务基本信息表 +* AbpTaskCategories - 任务分类表 +* AbpTaskStatuses - 任务状态表 +* AbpTaskAssignments - 任务分配表 +* Saas相关表 - 租户、版本等多租户相关数据 +* AbpSettings - 系统设置数据 +* AbpPermissionGrants - 权限授权数据 +* AbpFeatures - 功能特性数据 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [ABP任务管理模块](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/modules/task-management) diff --git a/aspnet-core/migrations/LY.MicroService.WebhooksManagement.DbMigrator/README.EN.md b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.DbMigrator/README.EN.md new file mode 100644 index 000000000..7c7afceec --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.DbMigrator/README.EN.md @@ -0,0 +1,65 @@ +# LY.MicroService.WebhooksManagement.DbMigrator + +Webhooks Management Database Migration Console Application, used for executing database migrations and initializing seed data for the webhooks management system. + +[简体中文](./README.md) + +## Features + +* Automatic database migration execution +* Initialize necessary system seed data +* Support command line parameter configuration +* Integrated Autofac dependency injection container +* Inherit all migration features from webhooks management system + +## Module Dependencies + +```csharp +[DependsOn( + typeof(WebhooksManagementMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "WebhooksManagementDbMigrator": "Your database connection string" + }, + "IdentityServer": { + "Clients": { + "WebhooksManagement_App": { + "ClientId": "WebhooksManagement_App" + } + } + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure WebhooksManagementDbMigrator connection string in appsettings.json + +2. Run Migration Program + ```bash + dotnet run + ``` + +## Command Line Arguments + +* --database-provider + * Specify database provider (default: MySQL) +* --connection-string + * Specify database connection string +* --skip-db-migrations + * Skip database migrations +* --skip-seed-data + * Skip seed data initialization + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [EF Core Migrations Documentation](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/) diff --git a/aspnet-core/migrations/LY.MicroService.WebhooksManagement.DbMigrator/README.md b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.DbMigrator/README.md new file mode 100644 index 000000000..9b739fc14 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.DbMigrator/README.md @@ -0,0 +1,65 @@ +# LY.MicroService.WebhooksManagement.DbMigrator + +Webhooks管理数据库迁移控制台应用程序,用于执行Webhooks管理系统的数据库迁移和初始化种子数据。 + +[English](./README.EN.md) + +## 功能特性 + +* 自动执行数据库迁移 +* 初始化系统必要的种子数据 +* 支持命令行参数配置 +* 集成Autofac依赖注入容器 +* 继承Webhooks管理系统的所有迁移功能 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(WebhooksManagementMigrationsEntityFrameworkCoreModule), + typeof(AbpAutofacModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "WebhooksManagementDbMigrator": "你的数据库连接字符串" + }, + "IdentityServer": { + "Clients": { + "WebhooksManagement_App": { + "ClientId": "WebhooksManagement_App" + } + } + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置WebhooksManagementDbMigrator连接字符串 + +2. 运行迁移程序 + ```bash + dotnet run + ``` + +## 命令行参数 + +* --database-provider + * 指定数据库提供程序 (默认: MySQL) +* --connection-string + * 指定数据库连接字符串 +* --skip-db-migrations + * 跳过数据库迁移 +* --skip-seed-data + * 跳过种子数据初始化 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [EF Core迁移文档](https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/) diff --git a/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/README.EN.md b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..58bfe8b95 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/README.EN.md @@ -0,0 +1,69 @@ +# LY.MicroService.WebhooksManagement.EntityFrameworkCore + +Webhooks Management Database Migration Module, providing database migration functionality for the webhooks management system. + +[简体中文](./README.md) + +## Features + +* Integrated SaaS multi-tenancy data migration +* Integrated Webhooks Management data migration +* Integrated Setting Management data migration +* Integrated Permission Management data migration +* Integrated Feature Management data migration +* Support for MySQL database + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(WebhooksManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## Configuration + +```json +{ + "ConnectionStrings": { + "WebhooksManagementDbMigrator": "Your database connection string" + } +} +``` + +## Basic Usage + +1. Configure Database Connection String + * Configure WebhooksManagementDbMigrator connection string in appsettings.json + +2. Add Module Dependency + ```csharp + [DependsOn(typeof(WebhooksManagementMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## Database Tables Description + +* AbpWebhooks - Webhooks basic information table +* AbpWebhookSubscriptions - Webhooks subscriptions table +* AbpWebhookGroups - Webhooks groups table +* AbpWebhookEvents - Webhooks events table +* AbpWebhookSendAttempts - Webhooks send attempts table +* Saas Related Tables - Tenant, edition and other multi-tenancy related data +* AbpSettings - System settings data +* AbpPermissionGrants - Permission authorization data +* AbpFeatures - Feature data + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [ABP Webhooks Module](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/modules/webhooks-management) diff --git a/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/README.md b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/README.md new file mode 100644 index 000000000..b7a950adf --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/README.md @@ -0,0 +1,69 @@ +# LY.MicroService.WebhooksManagement.EntityFrameworkCore + +Webhooks管理数据迁移模块,提供Webhooks管理系统相关的数据库迁移功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 集成SaaS多租户数据迁移 +* 集成Webhooks管理数据迁移 +* 集成设置管理数据迁移 +* 集成权限管理数据迁移 +* 集成特性管理数据迁移 +* 支持MySQL数据库 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpSaasEntityFrameworkCoreModule), + typeof(WebhooksManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule) +)] +``` + +## 配置项 + +```json +{ + "ConnectionStrings": { + "WebhooksManagementDbMigrator": "你的数据库连接字符串" + } +} +``` + +## 基本用法 + +1. 配置数据库连接字符串 + * 在appsettings.json中配置WebhooksManagementDbMigrator连接字符串 + +2. 添加模块依赖 + ```csharp + [DependsOn(typeof(WebhooksManagementMigrationsEntityFrameworkCoreModule))] + public class YourModule : AbpModule + { + // ... + } + ``` + +## 数据库表说明 + +* AbpWebhooks - Webhooks基本信息表 +* AbpWebhookSubscriptions - Webhooks订阅表 +* AbpWebhookGroups - Webhooks分组表 +* AbpWebhookEvents - Webhooks事件表 +* AbpWebhookSendAttempts - Webhooks发送记录表 +* Saas相关表 - 租户、版本等多租户相关数据 +* AbpSettings - 系统设置数据 +* AbpPermissionGrants - 权限授权数据 +* AbpFeatures - 功能特性数据 + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [ABP Webhooks模块](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/modules/webhooks-management) diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/README.EN.md b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/README.EN.md new file mode 100644 index 000000000..df472b950 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/README.EN.md @@ -0,0 +1,60 @@ +# LINGYUN.Abp.Account.Application.Contracts + +Application service contracts for the ABP account module, providing interface definitions for account management. + +[简体中文](./README.md) + +## Features + +* Phone number registration +* WeChat Mini Program registration +* Password reset via phone number +* Phone verification code functionality (registration, login, password reset) +* Email verification code login +* User profile management +* User session management +* Two-factor authentication +* User claims management + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAccountApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Service Interfaces + +### IAccountAppService + +Account management service interface, providing: +* Phone number registration +* WeChat Mini Program registration +* Password reset via phone number +* Send phone verification codes (registration, login, password reset) +* Send email verification codes (login) + +### IMyProfileAppService + +Profile management service interface, providing: +* Get/Update personal profile +* Change password +* Change phone number +* Change avatar +* Two-factor authentication management +* Get/Verify authenticator +* Get recovery codes + +### IMyClaimAppService + +User claims management service interface, providing: +* Get user claims +* Update user claims + +## Localization + +The module includes multi-language support, with resource files located at: +* `/LINGYUN/Abp/Account/Localization/Resources` diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/README.md b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/README.md new file mode 100644 index 000000000..fdc72adf8 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/README.md @@ -0,0 +1,60 @@ +# LINGYUN.Abp.Account.Application.Contracts + +ABP账户模块的应用服务契约,提供账户管理相关的接口定义。 + +[English](./README.EN.md) + +## 功能特性 + +* 手机号注册账户 +* 微信小程序注册账户 +* 手机号重置密码 +* 手机验证码功能(注册、登录、重置密码) +* 邮箱验证码登录 +* 用户个人资料管理 +* 用户会话管理 +* 双因素认证 +* 用户声明管理 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAccountApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 接口服务 + +### IAccountAppService + +账户管理服务接口,提供以下功能: +* 手机号注册 +* 微信小程序注册 +* 手机号重置密码 +* 发送手机验证码(注册、登录、重置密码) +* 发送邮箱验证码(登录) + +### IMyProfileAppService + +个人资料管理服务接口,提供以下功能: +* 获取/更新个人资料 +* 更改密码 +* 更改手机号 +* 更改头像 +* 双因素认证管理 +* 获取/验证认证器 +* 获取恢复代码 + +### IMyClaimAppService + +用户声明管理服务接口,提供以下功能: +* 获取用户声明 +* 更新用户声明 + +## 本地化 + +模块包含多语言支持,资源文件位于: +* `/LINGYUN/Abp/Account/Localization/Resources` diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/README.EN.md b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/README.EN.md new file mode 100644 index 000000000..b48f683ac --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/README.EN.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.Account.Application + +Implementation of ABP account module application services, providing complete account management functionality. + +[简体中文](./README.md) + +## Features + +* Account Management Service Implementation + * Phone number registration + * WeChat Mini Program registration + * Password reset + * Verification code sending (SMS, Email) +* Profile Management + * Basic information maintenance + * Password modification + * Phone number change + * Avatar update + * Two-factor authentication +* User Claims Management +* Email Services + * Email confirmation + * Email verification +* SMS Services + * Verification code sending +* WeChat Mini Program Integration +* Virtual File System Support + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpAccountApplicationModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpAccountTemplatesModule), + typeof(AbpIdentityDomainModule), + typeof(AbpWeChatMiniProgramModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Application Services + +### AccountAppService + +Implements `IAccountAppService` interface, providing: +* User registration (phone number, WeChat Mini Program) +* Password reset +* Verification code sending + +### MyProfileAppService + +Implements `IMyProfileAppService` interface, providing: +* Profile management +* Password modification +* Phone number change +* Avatar update +* Two-factor authentication management + +### MyClaimAppService + +Implements `IMyClaimAppService` interface, providing: +* User claims management + +## Email Services + +Provides the following email services: +* `IAccountEmailConfirmSender` - Email confirmation service +* `IAccountEmailVerifySender` - Email verification service +* `AccountEmailSender` - Email sending implementation + +## SMS Services + +Provides the following SMS services: +* `IAccountSmsSecurityCodeSender` - SMS verification code sending service +* `AccountSmsSecurityCodeSender` - SMS verification code sending implementation + +## URL Configuration + +The module pre-configures the following URLs: +* EmailConfirm - Email confirmation URL, defaults to "Account/EmailConfirm" diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/README.md b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/README.md new file mode 100644 index 000000000..c6fc50aa6 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/README.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.Account.Application + +ABP账户模块的应用服务实现,提供完整的账户管理功能实现。 + +[English](./README.EN.md) + +## 功能特性 + +* 账户管理服务实现 + * 手机号注册 + * 微信小程序注册 + * 密码重置 + * 验证码发送(短信、邮件) +* 个人资料管理 + * 基本信息维护 + * 密码修改 + * 手机号变更 + * 头像更新 + * 双因素认证 +* 用户声明管理 +* 邮件服务 + * 邮件确认 + * 邮件验证 +* 短信服务 + * 验证码发送 +* 微信小程序集成 +* 虚拟文件系统支持 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpAccountApplicationModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpAccountTemplatesModule), + typeof(AbpIdentityDomainModule), + typeof(AbpWeChatMiniProgramModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 应用服务 + +### AccountAppService + +实现`IAccountAppService`接口,提供: +* 用户注册(手机号、微信小程序) +* 密码重置 +* 验证码发送 + +### MyProfileAppService + +实现`IMyProfileAppService`接口,提供: +* 个人资料管理 +* 密码修改 +* 手机号变更 +* 头像更新 +* 双因素认证管理 + +### MyClaimAppService + +实现`IMyClaimAppService`接口,提供: +* 用户声明管理 + +## 邮件服务 + +提供以下邮件服务: +* `IAccountEmailConfirmSender` - 邮件确认服务 +* `IAccountEmailVerifySender` - 邮件验证服务 +* `AccountEmailSender` - 邮件发送实现 + +## 短信服务 + +提供以下短信服务: +* `IAccountSmsSecurityCodeSender` - 短信验证码发送服务 +* `AccountSmsSecurityCodeSender` - 短信验证码发送实现 + +## URL配置 + +模块预配置了以下URL: +* EmailConfirm - 邮件确认URL,默认为"Account/EmailConfirm" diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/README.EN.md b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/README.EN.md new file mode 100644 index 000000000..77e73c4be --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/README.EN.md @@ -0,0 +1,59 @@ +# LINGYUN.Abp.Account.HttpApi + +The HTTP API layer of the ABP account module, providing RESTful API implementations. + +[简体中文](./README.md) + +## Features + +* Provides HTTP API endpoints for account management +* Supports localization and multi-language +* Integrates with ABP MVC framework +* Automatic API controller registration + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpAccountHttpApiModule), + typeof(AbpAccountApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Controllers + +### AccountController + +Provides the following HTTP API endpoints: +* POST /api/account/register - Register with phone number +* POST /api/account/register-by-wechat - Register with WeChat Mini Program +* POST /api/account/reset-password - Reset password +* POST /api/account/send-phone-register-code - Send phone registration verification code +* POST /api/account/send-phone-signin-code - Send phone login verification code +* POST /api/account/send-email-signin-code - Send email login verification code +* POST /api/account/send-phone-reset-password-code - Send phone password reset verification code + +### MyProfileController + +Provides the following HTTP API endpoints: +* GET /api/account/my-profile - Get personal profile +* PUT /api/account/my-profile - Update personal profile +* POST /api/account/my-profile/change-password - Change password +* POST /api/account/my-profile/change-phone-number - Change phone number +* POST /api/account/my-profile/send-phone-number-change-code - Send phone number change verification code +* POST /api/account/my-profile/change-avatar - Update avatar + +### MyClaimController + +Provides the following HTTP API endpoints: +* GET /api/account/my-claim - Get user claims +* PUT /api/account/my-claim - Update user claims + +## Localization Configuration + +The module pre-configures localization options: +* Supports AccountResource localization +* Automatically registers MVC application parts diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/README.md b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/README.md new file mode 100644 index 000000000..1b3606425 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/README.md @@ -0,0 +1,59 @@ +# LINGYUN.Abp.Account.HttpApi + +ABP账户模块的HTTP API层,提供RESTful API接口实现。 + +[English](./README.EN.md) + +## 功能特性 + +* 提供账户管理的HTTP API接口 +* 支持本地化和多语言 +* 集成ABP MVC框架 +* 自动API控制器注册 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpAccountHttpApiModule), + typeof(AbpAccountApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API控制器 + +### AccountController + +提供以下HTTP API端点: +* POST /api/account/register - 手机号注册 +* POST /api/account/register-by-wechat - 微信小程序注册 +* POST /api/account/reset-password - 重置密码 +* POST /api/account/send-phone-register-code - 发送手机注册验证码 +* POST /api/account/send-phone-signin-code - 发送手机登录验证码 +* POST /api/account/send-email-signin-code - 发送邮箱登录验证码 +* POST /api/account/send-phone-reset-password-code - 发送手机重置密码验证码 + +### MyProfileController + +提供以下HTTP API端点: +* GET /api/account/my-profile - 获取个人资料 +* PUT /api/account/my-profile - 更新个人资料 +* POST /api/account/my-profile/change-password - 修改密码 +* POST /api/account/my-profile/change-phone-number - 修改手机号 +* POST /api/account/my-profile/send-phone-number-change-code - 发送手机号变更验证码 +* POST /api/account/my-profile/change-avatar - 更新头像 + +### MyClaimController + +提供以下HTTP API端点: +* GET /api/account/my-claim - 获取用户声明 +* PUT /api/account/my-claim - 更新用户声明 + +## 本地化配置 + +模块预配置了本地化选项: +* 支持AccountResource资源本地化 +* 自动注册MVC应用程序部件 diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/README.EN.md b/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/README.EN.md new file mode 100644 index 000000000..78c7f6153 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Account.Templates + +Email template definition module for the ABP account module, providing account-related email template functionality. + +[简体中文](./README.md) + +## Features + +* Provides standard account email templates +* Supports email template localization +* Integrates with ABP Virtual File System +* Uses ABP Text Template System + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpEmailingModule), + typeof(AbpAccountApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Email Templates + +### Template Definitions + +The module defines the following email templates: + +* `Abp.Account.MailConfirmLink` - Email Address Confirmation Template + * Used for user email address verification + * Template file: `/LINGYUN/Abp/Account/Emailing/Templates/MailConfirm.tpl` + * Uses standard email layout + +* `Abp.Account.MailSecurityVerifyLink` - Email Security Verification Template + * Used for email security verification + * Template file: `/LINGYUN/Abp/Account/Emailing/Templates/MailSecurityVerify.tpl` + * Uses standard email layout + +### Template System + +* Uses ABP Text Template System (TextTemplating) +* Supports template localization +* Template definition provider: `AccountTemplateDefinitionProvider` + +## Localization + +The module includes localization resources: +* Resource type: `AccountResource` +* Resource path: `/LINGYUN/Abp/Account/Templates/Localization/Resources` + +## Virtual File System + +The module uses ABP Virtual File System to manage template files: +* All template files are embedded through the virtual file system +* Supports template file override and customization diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/README.md b/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/README.md new file mode 100644 index 000000000..e740a7dab --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Account.Templates + +ABP账户模块的邮件模板定义模块,提供账户相关的邮件模板功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 提供标准的账户邮件模板 +* 支持邮件模板本地化 +* 集成ABP虚拟文件系统 +* 使用ABP文本模板系统 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpEmailingModule), + typeof(AbpAccountApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 邮件模板 + +### 模板定义 + +模块定义了以下邮件模板: + +* `Abp.Account.MailConfirmLink` - 邮件地址确认模板 + * 用于用户邮箱地址验证 + * 模板文件:`/LINGYUN/Abp/Account/Emailing/Templates/MailConfirm.tpl` + * 使用标准邮件布局 + +* `Abp.Account.MailSecurityVerifyLink` - 邮件安全验证模板 + * 用于邮箱安全验证 + * 模板文件:`/LINGYUN/Abp/Account/Emailing/Templates/MailSecurityVerify.tpl` + * 使用标准邮件布局 + +### 模板系统 + +* 使用ABP文本模板系统(TextTemplating) +* 支持模板本地化 +* 模板定义提供者:`AccountTemplateDefinitionProvider` + +## 本地化 + +模块包含本地化资源: +* 资源类型:`AccountResource` +* 资源路径:`/LINGYUN/Abp/Account/Templates/Localization/Resources` + +## 虚拟文件系统 + +模块使用ABP虚拟文件系统来管理模板文件: +* 所有模板文件都通过虚拟文件系统嵌入 +* 支持模板文件的覆盖和自定义 diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/README.EN.md b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/README.EN.md new file mode 100644 index 000000000..1c068d4dc --- /dev/null +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/README.EN.md @@ -0,0 +1,62 @@ +# LINGYUN.Abp.Auditing.Application.Contracts + +Application layer contracts module for audit logging, defining application service interfaces and data transfer objects. + +[简体中文](./README.md) + +## Features + +* Audit log application service interface definitions +* Audit log Data Transfer Objects (DTOs) definitions +* Audit log permission definitions +* Audit log query parameter definitions + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuditingApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Permission Definitions + +* AuditLogging.AuditLogs - Audit log management + - AuditLogging.AuditLogs.Delete - Delete audit logs + - AuditLogging.SecurityLogs - Security log management + - AuditLogging.SecurityLogs.Delete - Delete security logs + +## Service Interfaces + +* IAuditLogAppService + ```csharp + public interface IAuditLogAppService : IApplicationService + { + Task GetAsync(Guid id); + Task> GetListAsync(GetAuditLogsInput input); + Task DeleteAsync(Guid id); + Task DeleteManyAsync(DeleteManyAuditLogsInput input); + } + ``` + +* ISecurityLogAppService + ```csharp + public interface ISecurityLogAppService : IApplicationService + { + Task GetAsync(Guid id); + Task> GetListAsync(GetSecurityLogsInput input); + Task DeleteAsync(Guid id); + Task DeleteManyAsync(DeleteManySecurityLogsInput input); + } + ``` + +## Data Transfer Objects + +* AuditLogDto - Audit log DTO +* SecurityLogDto - Security log DTO +* GetAuditLogsInput - Input parameters for getting audit logs +* GetSecurityLogsInput - Input parameters for getting security logs +* DeleteManyAuditLogsInput - Input parameters for batch deleting audit logs +* DeleteManySecurityLogsInput - Input parameters for batch deleting security logs diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/README.md b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/README.md new file mode 100644 index 000000000..8d4bdddaf --- /dev/null +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/README.md @@ -0,0 +1,62 @@ +# LINGYUN.Abp.Auditing.Application.Contracts + +审计日志应用层契约模块,定义审计日志的应用服务接口和数据传输对象。 + +[English](./README.EN.md) + +## 功能特性 + +* 审计日志应用服务接口定义 +* 审计日志数据传输对象(DTO)定义 +* 审计日志权限定义 +* 审计日志查询参数定义 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAuditingApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 权限定义 + +* AuditLogging.AuditLogs - 审计日志管理 + - AuditLogging.AuditLogs.Delete - 删除审计日志 + - AuditLogging.SecurityLogs - 安全日志管理 + - AuditLogging.SecurityLogs.Delete - 删除安全日志 + +## 服务接口 + +* IAuditLogAppService + ```csharp + public interface IAuditLogAppService : IApplicationService + { + Task GetAsync(Guid id); + Task> GetListAsync(GetAuditLogsInput input); + Task DeleteAsync(Guid id); + Task DeleteManyAsync(DeleteManyAuditLogsInput input); + } + ``` + +* ISecurityLogAppService + ```csharp + public interface ISecurityLogAppService : IApplicationService + { + Task GetAsync(Guid id); + Task> GetListAsync(GetSecurityLogsInput input); + Task DeleteAsync(Guid id); + Task DeleteManyAsync(DeleteManySecurityLogsInput input); + } + ``` + +## 数据传输对象 + +* AuditLogDto - 审计日志DTO +* SecurityLogDto - 安全日志DTO +* GetAuditLogsInput - 获取审计日志输入参数 +* GetSecurityLogsInput - 获取安全日志输入参数 +* DeleteManyAuditLogsInput - 批量删除审计日志输入参数 +* DeleteManySecurityLogsInput - 批量删除安全日志输入参数 diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/README.EN.md b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/README.EN.md new file mode 100644 index 000000000..5a26eb74d --- /dev/null +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/README.EN.md @@ -0,0 +1,66 @@ +# LINGYUN.Abp.Auditing.Application + +Application layer module for audit logging, providing implementation of audit logging application services. + +[简体中文](./README.md) + +## Features + +* Audit log query service +* Audit log management service +* Security log query service +* Integration with auto-mapping functionality + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuditingApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Required Modules + +* `LINGYUN.Abp.AuditLogging` - Audit logging core module +* `LINGYUN.Abp.Logging` - Logging infrastructure module +* `AbpAutoMapper` - ABP auto-mapping module + +## Service Interfaces + +* IAuditLogAppService - Audit log application service + - GetAsync - Get a specific audit log + - GetListAsync - Get a list of audit logs + - DeleteAsync - Delete a specific audit log + - DeleteManyAsync - Batch delete audit logs + +* ISecurityLogAppService - Security log application service + - GetAsync - Get a specific security log + - GetListAsync - Get a list of security logs + - DeleteAsync - Delete a specific security log + - DeleteManyAsync - Batch delete security logs + +## Basic Usage + +1. Reference the module +2. Inject the required application service +3. Call the appropriate service methods + +Example: +```csharp +public class YourService +{ + private readonly IAuditLogAppService _auditLogAppService; + + public YourService(IAuditLogAppService auditLogAppService) + { + _auditLogAppService = auditLogAppService; + } + + public async Task GetAuditLogAsync(Guid id) + { + return await _auditLogAppService.GetAsync(id); + } +} +``` diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/README.md b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/README.md new file mode 100644 index 000000000..b6f71df79 --- /dev/null +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/README.md @@ -0,0 +1,66 @@ +# LINGYUN.Abp.Auditing.Application + +审计日志应用层模块,提供审计日志的应用服务实现。 + +[English](./README.EN.md) + +## 功能特性 + +* 审计日志查询服务 +* 审计日志管理服务 +* 安全日志查询服务 +* 集成自动映射功能 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAuditingApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 依赖模块 + +* `LINGYUN.Abp.AuditLogging` - 审计日志核心模块 +* `LINGYUN.Abp.Logging` - 日志基础模块 +* `AbpAutoMapper` - ABP自动映射模块 + +## 服务接口 + +* IAuditLogAppService - 审计日志应用服务 + - GetAsync - 获取指定的审计日志 + - GetListAsync - 获取审计日志列表 + - DeleteAsync - 删除指定的审计日志 + - DeleteManyAsync - 批量删除审计日志 + +* ISecurityLogAppService - 安全日志应用服务 + - GetAsync - 获取指定的安全日志 + - GetListAsync - 获取安全日志列表 + - DeleteAsync - 删除指定的安全日志 + - DeleteManyAsync - 批量删除安全日志 + +## 基本用法 + +1. 引用模块 +2. 注入所需的应用服务 +3. 调用相应的服务方法 + +示例: +```csharp +public class YourService +{ + private readonly IAuditLogAppService _auditLogAppService; + + public YourService(IAuditLogAppService auditLogAppService) + { + _auditLogAppService = auditLogAppService; + } + + public async Task GetAuditLogAsync(Guid id) + { + return await _auditLogAppService.GetAsync(id); + } +} +``` diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/README.EN.md b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/README.EN.md new file mode 100644 index 000000000..3e698878d --- /dev/null +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/README.EN.md @@ -0,0 +1,50 @@ +# LINGYUN.Abp.Auditing.HttpApi + +HTTP API module for audit logging, providing REST API interfaces for audit logging functionality. + +[简体中文](./README.md) + +## Features + +* Audit log REST API interfaces +* Security log REST API interfaces +* Support for API versioning +* Integration with Swagger documentation + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuditingHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Endpoints + +### Audit Logs + +* GET /api/audit-logging/audit-logs/{id} - Get a specific audit log +* GET /api/audit-logging/audit-logs - Get a list of audit logs +* DELETE /api/audit-logging/audit-logs/{id} - Delete a specific audit log +* DELETE /api/audit-logging/audit-logs/batch - Batch delete audit logs + +### Security Logs + +* GET /api/audit-logging/security-logs/{id} - Get a specific security log +* GET /api/audit-logging/security-logs - Get a list of security logs +* DELETE /api/audit-logging/security-logs/{id} - Delete a specific security log +* DELETE /api/audit-logging/security-logs/batch - Batch delete security logs + +## Basic Usage + +1. Reference the module +2. Configure permissions (if needed) +3. Call the appropriate API endpoints using an HTTP client + +## API Documentation + +After starting the application, you can view the complete API documentation through: +* /swagger - Swagger UI interface +* /swagger/v1/swagger.json - OpenAPI specification document diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/README.md b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/README.md new file mode 100644 index 000000000..e051079dd --- /dev/null +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/README.md @@ -0,0 +1,50 @@ +# LINGYUN.Abp.Auditing.HttpApi + +审计日志HTTP API模块,提供审计日志的REST API接口。 + +[English](./README.EN.md) + +## 功能特性 + +* 审计日志REST API接口 +* 安全日志REST API接口 +* 支持API版本控制 +* 集成Swagger文档 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpAuditingHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API接口 + +### 审计日志 + +* GET /api/audit-logging/audit-logs/{id} - 获取指定的审计日志 +* GET /api/audit-logging/audit-logs - 获取审计日志列表 +* DELETE /api/audit-logging/audit-logs/{id} - 删除指定的审计日志 +* DELETE /api/audit-logging/audit-logs/batch - 批量删除审计日志 + +### 安全日志 + +* GET /api/audit-logging/security-logs/{id} - 获取指定的安全日志 +* GET /api/audit-logging/security-logs - 获取安全日志列表 +* DELETE /api/audit-logging/security-logs/{id} - 删除指定的安全日志 +* DELETE /api/audit-logging/security-logs/batch - 批量删除安全日志 + +## 基本用法 + +1. 引用模块 +2. 配置权限(如需要) +3. 通过HTTP客户端调用相应的API接口 + +## API文档 + +启动应用程序后,可以通过Swagger UI查看完整的API文档: +* /swagger - Swagger UI界面 +* /swagger/v1/swagger.json - OpenAPI规范文档 diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..2a78d4c1d --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/README.EN.md @@ -0,0 +1,36 @@ +# LINGYUN.Abp.CachingManagement.Application.Contracts + +Cache management application service contract module. + +## Interfaces + +### ICacheAppService + +Cache management application service interface, providing the following features: + +* `GetKeysAsync`: Get cache key list +* `GetValueAsync`: Get cache value +* `SetAsync`: Set cache value +* `RefreshAsync`: Refresh cache +* `RemoveAsync`: Remove cache + +## Permissions + +* AbpCachingManagement.Cache: Cache management + * AbpCachingManagement.Cache.Refresh: Refresh cache + * AbpCachingManagement.Cache.Delete: Delete cache + * AbpCachingManagement.Cache.ManageValue: Manage cache value + +## Installation + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## More + +For more information, please refer to the following resources: + +* [Application Service Implementation](../LINGYUN.Abp.CachingManagement.Application/README.EN.md) +* [HTTP API](../LINGYUN.Abp.CachingManagement.HttpApi/README.EN.md) +* [Domain Layer](../LINGYUN.Abp.CachingManagement.Domain/README.EN.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/README.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/README.md new file mode 100644 index 000000000..209caa8e8 --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/README.md @@ -0,0 +1,36 @@ +# LINGYUN.Abp.CachingManagement.Application.Contracts + +缓存管理应用服务契约模块。 + +## 接口 + +### ICacheAppService + +缓存管理应用服务接口,提供以下功能: + +* `GetKeysAsync`: 获取缓存键列表 +* `GetValueAsync`: 获取缓存值 +* `SetAsync`: 设置缓存值 +* `RefreshAsync`: 刷新缓存 +* `RemoveAsync`: 删除缓存 + +## 权限 + +* AbpCachingManagement.Cache:缓存管理 + * AbpCachingManagement.Cache.Refresh:刷新缓存 + * AbpCachingManagement.Cache.Delete:删除缓存 + * AbpCachingManagement.Cache.ManageValue:管理缓存值 + +## 安装 + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## 更多 + +有关更多信息,请参阅以下资源: + +* [应用服务实现](../LINGYUN.Abp.CachingManagement.Application/README.md) +* [HTTP API](../LINGYUN.Abp.CachingManagement.HttpApi/README.md) +* [领域层](../LINGYUN.Abp.CachingManagement.Domain/README.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/README.EN.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/README.EN.md new file mode 100644 index 000000000..1b29e7290 --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.CachingManagement.Application + +Implementation of the cache management application service module. + +## Features + +* Implements the `ICacheAppService` interface, providing basic cache management functions: + * Get cache key list + * Get cache value + * Set cache value + * Refresh cache + * Delete cache + +## Permissions + +* AbpCachingManagement.Cache: Cache management + * AbpCachingManagement.Cache.Refresh: Refresh cache + * AbpCachingManagement.Cache.Delete: Delete cache + * AbpCachingManagement.Cache.ManageValue: Manage cache value + +## Installation + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## Configuration and Usage + +1. First, you need to install the corresponding cache implementation module, for example: [LINGYUN.Abp.CachingManagement.StackExchangeRedis](../LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.EN.md) + +2. Add the following code in the `ConfigureServices` method of your module: + +```csharp +Configure(options => +{ + options.AddProfile(validate: true); +}); +``` + +## More + +For more information, please refer to the following resources: + +* [Application Service Contracts](../LINGYUN.Abp.CachingManagement.Application.Contracts/README.EN.md) +* [HTTP API](../LINGYUN.Abp.CachingManagement.HttpApi/README.EN.md) +* [Domain Layer](../LINGYUN.Abp.CachingManagement.Domain/README.EN.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/README.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/README.md new file mode 100644 index 000000000..c2c1423de --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/README.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.CachingManagement.Application + +缓存管理应用服务模块的实现。 + +## 功能 + +* 实现了 `ICacheAppService` 接口,提供缓存管理的基本功能: + * 获取缓存键列表 + * 获取缓存值 + * 设置缓存值 + * 刷新缓存 + * 删除缓存 + +## 权限 + +* AbpCachingManagement.Cache:缓存管理 + * AbpCachingManagement.Cache.Refresh:刷新缓存 + * AbpCachingManagement.Cache.Delete:删除缓存 + * AbpCachingManagement.Cache.ManageValue:管理缓存值 + +## 安装 + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## 配置使用 + +1. 首先需要安装相应的缓存实现模块,例如:[LINGYUN.Abp.CachingManagement.StackExchangeRedis](../LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.md) + +2. 在模块的 `ConfigureServices` 方法中添加以下代码: + +```csharp +Configure(options => +{ + options.AddProfile(validate: true); +}); +``` + +## 更多 + +有关更多信息,请参阅以下资源: + +* [应用服务契约](../LINGYUN.Abp.CachingManagement.Application.Contracts/README.md) +* [HTTP API](../LINGYUN.Abp.CachingManagement.HttpApi/README.md) +* [领域层](../LINGYUN.Abp.CachingManagement.Domain/README.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/README.EN.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/README.EN.md new file mode 100644 index 000000000..604ff14d5 --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/README.EN.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.CachingManagement.Domain + +Domain layer implementation of the cache management module. + +## Core Interfaces + +### ICacheManager + +Cache manager interface, defining core cache management functionality: + +* `GetKeysAsync`: Get cache key list +* `GetValueAsync`: Get cache value +* `SetAsync`: Set cache value +* `RefreshAsync`: Refresh cache +* `RemoveAsync`: Remove cache + +## Domain Services + +### CacheManager + +Abstract base class for cache manager, providing basic cache management implementation. Specific cache providers (like Redis) need to inherit this class and implement the corresponding methods. + +## Installation + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## Extension Development + +To support a new cache provider, you need to: + +1. Create a new project, inherit from `CacheManager` class +2. Implement all abstract methods +3. Register as implementation of `ICacheManager` (using `[Dependency(ReplaceServices = true)]`) + +## More + +For more information, please refer to the following resources: + +* [Application Service Implementation](../LINGYUN.Abp.CachingManagement.Application/README.EN.md) +* [Application Service Contracts](../LINGYUN.Abp.CachingManagement.Application.Contracts/README.EN.md) +* [HTTP API](../LINGYUN.Abp.CachingManagement.HttpApi/README.EN.md) +* [Redis Implementation](../LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.EN.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/README.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/README.md new file mode 100644 index 000000000..38c431af8 --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/README.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.CachingManagement.Domain + +缓存管理模块的领域层实现。 + +## 核心接口 + +### ICacheManager + +缓存管理器接口,定义了缓存管理的核心功能: + +* `GetKeysAsync`: 获取缓存键列表 +* `GetValueAsync`: 获取缓存值 +* `SetAsync`: 设置缓存值 +* `RefreshAsync`: 刷新缓存 +* `RemoveAsync`: 删除缓存 + +## 领域服务 + +### CacheManager + +缓存管理器的抽象基类,提供了基础的缓存管理实现。具体的缓存提供程序(如Redis)需要继承此类并实现相应的方法。 + +## 安装 + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## 扩展开发 + +如果需要支持新的缓存提供程序,需要: + +1. 创建新的项目,继承 `CacheManager` 类 +2. 实现所有抽象方法 +3. 注册为 `ICacheManager` 的实现(使用 `[Dependency(ReplaceServices = true)]`) + +## 更多 + +有关更多信息,请参阅以下资源: + +* [应用服务实现](../LINGYUN.Abp.CachingManagement.Application/README.md) +* [应用服务契约](../LINGYUN.Abp.CachingManagement.Application.Contracts/README.md) +* [HTTP API](../LINGYUN.Abp.CachingManagement.HttpApi/README.md) +* [Redis实现](../LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/README.EN.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..1a56ec4ab --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/README.EN.md @@ -0,0 +1,53 @@ +# LINGYUN.Abp.CachingManagement.HttpApi + +HTTP API implementation for the cache management module. + +## API Endpoints + +### /api/caching-management/cache + +* GET `/api/caching-management/cache/keys`: Get cache key list + * Parameters: + * prefix (string, optional): Key prefix + * filter (string, optional): Filter condition + * marker (string, optional): Pagination marker + * Permission: AbpCachingManagement.Cache + +* GET `/api/caching-management/cache/{key}`: Get cache value for specified key + * Parameters: + * key (string, required): Cache key + * Permission: AbpCachingManagement.Cache + +* POST `/api/caching-management/cache`: Set cache value + * Parameters: + * key (string, required): Cache key + * value (string, required): Cache value + * absoluteExpiration (DateTime, optional): Absolute expiration time + * slidingExpiration (DateTime, optional): Sliding expiration time + * Permission: AbpCachingManagement.Cache.ManageValue + +* PUT `/api/caching-management/cache/refresh`: Refresh cache + * Parameters: + * key (string, required): Cache key + * absoluteExpiration (DateTime, optional): Absolute expiration time + * slidingExpiration (DateTime, optional): Sliding expiration time + * Permission: AbpCachingManagement.Cache.Refresh + +* DELETE `/api/caching-management/cache`: Delete cache + * Parameters: + * key (string, required): Cache key + * Permission: AbpCachingManagement.Cache.Delete + +## Installation + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## More + +For more information, please refer to the following resources: + +* [Application Service Implementation](../LINGYUN.Abp.CachingManagement.Application/README.EN.md) +* [Application Service Contracts](../LINGYUN.Abp.CachingManagement.Application.Contracts/README.EN.md) +* [Domain Layer](../LINGYUN.Abp.CachingManagement.Domain/README.EN.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/README.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/README.md new file mode 100644 index 000000000..f1ffbabd1 --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/README.md @@ -0,0 +1,53 @@ +# LINGYUN.Abp.CachingManagement.HttpApi + +缓存管理模块的 HTTP API 实现。 + +## API 接口 + +### /api/caching-management/cache + +* GET `/api/caching-management/cache/keys`: 获取缓存键列表 + * 参数: + * prefix (string, optional): 键前缀 + * filter (string, optional): 过滤条件 + * marker (string, optional): 分页标记 + * 权限:AbpCachingManagement.Cache + +* GET `/api/caching-management/cache/{key}`: 获取指定键的缓存值 + * 参数: + * key (string, required): 缓存键 + * 权限:AbpCachingManagement.Cache + +* POST `/api/caching-management/cache`: 设置缓存值 + * 参数: + * key (string, required): 缓存键 + * value (string, required): 缓存值 + * absoluteExpiration (DateTime, optional): 绝对过期时间 + * slidingExpiration (DateTime, optional): 滑动过期时间 + * 权限:AbpCachingManagement.Cache.ManageValue + +* PUT `/api/caching-management/cache/refresh`: 刷新缓存 + * 参数: + * key (string, required): 缓存键 + * absoluteExpiration (DateTime, optional): 绝对过期时间 + * slidingExpiration (DateTime, optional): 滑动过期时间 + * 权限:AbpCachingManagement.Cache.Refresh + +* DELETE `/api/caching-management/cache`: 删除缓存 + * 参数: + * key (string, required): 缓存键 + * 权限:AbpCachingManagement.Cache.Delete + +## 安装 + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## 更多 + +有关更多信息,请参阅以下资源: + +* [应用服务实现](../LINGYUN.Abp.CachingManagement.Application/README.md) +* [应用服务契约](../LINGYUN.Abp.CachingManagement.Application.Contracts/README.md) +* [领域层](../LINGYUN.Abp.CachingManagement.Domain/README.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.EN.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.EN.md new file mode 100644 index 000000000..d0ed1282c --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.EN.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.CachingManagement.StackExchangeRedis + +Cache management implementation module based on StackExchange.Redis. + +## Features + +* Implements the `ICacheManager` interface, providing Redis-based cache management features: + * Get cache key list (supports prefix matching and filtering) + * Get cache value + * Set cache value (supports absolute and sliding expiration) + * Refresh cache + * Delete cache + +## Installation + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## Configuration and Usage + +1. First, configure the Redis connection string in `appsettings.json`: + +```json +{ + "Redis": { + "Configuration": "127.0.0.1:6379" + } +} +``` + +2. Add the following code in the `ConfigureServices` method of your module: + +```csharp +Configure(options => +{ + // Optional: Configure Redis instance name prefix + options.InstanceName = "MyApp:"; +}); + +Configure(options => +{ + // Optional: Configure cache key prefix + options.KeyPrefix = "MyApp:"; +}); +``` + +## Multi-tenancy Support + +The module has built-in multi-tenancy support, automatically isolating cache data based on the current tenant ID: +* Key format with tenant: `{InstanceName}t:{TenantId}:{KeyPrefix}:{Key}` +* Key format without tenant: `{InstanceName}c:{KeyPrefix}:{Key}` + +## More + +For more information, please refer to the following resources: + +* [Application Service Implementation](../LINGYUN.Abp.CachingManagement.Application/README.EN.md) +* [Application Service Contracts](../LINGYUN.Abp.CachingManagement.Application.Contracts/README.EN.md) +* [HTTP API](../LINGYUN.Abp.CachingManagement.HttpApi/README.EN.md) +* [Domain Layer](../LINGYUN.Abp.CachingManagement.Domain/README.EN.md) diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.md b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.md new file mode 100644 index 000000000..c246f7b62 --- /dev/null +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/README.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.CachingManagement.StackExchangeRedis + +基于 StackExchange.Redis 的缓存管理实现模块。 + +## 功能 + +* 实现了 `ICacheManager` 接口,提供基于 Redis 的缓存管理功能: + * 获取缓存键列表(支持前缀匹配和过滤) + * 获取缓存值 + * 设置缓存值(支持绝对过期时间和滑动过期时间) + * 刷新缓存 + * 删除缓存 + +## 安装 + +```bash +abp add-module LINGYUN.Abp.CachingManagement +``` + +## 配置使用 + +1. 首先需要配置 Redis 连接字符串,在 `appsettings.json` 中添加: + +```json +{ + "Redis": { + "Configuration": "127.0.0.1:6379" + } +} +``` + +2. 在模块的 `ConfigureServices` 方法中添加以下代码: + +```csharp +Configure(options => +{ + // 可选:配置 Redis 实例名称前缀 + options.InstanceName = "MyApp:"; +}); + +Configure(options => +{ + // 可选:配置缓存键前缀 + options.KeyPrefix = "MyApp:"; +}); +``` + +## 多租户支持 + +模块内置了多租户支持,会自动根据当前租户ID来隔离缓存数据: +* 有租户时的键格式:`{InstanceName}t:{TenantId}:{KeyPrefix}:{Key}` +* 无租户时的键格式:`{InstanceName}c:{KeyPrefix}:{Key}` + +## 更多 + +有关更多信息,请参阅以下资源: + +* [应用服务实现](../LINGYUN.Abp.CachingManagement.Application/README.md) +* [应用服务契约](../LINGYUN.Abp.CachingManagement.Application.Contracts/README.md) +* [HTTP API](../LINGYUN.Abp.CachingManagement.HttpApi/README.md) +* [领域层](../LINGYUN.Abp.CachingManagement.Domain/README.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..77e532731 --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/README.EN.md @@ -0,0 +1,36 @@ +# LINGYUN.Abp.DataProtectionManagement.Application.Contracts + +Data protection management application service contracts module, providing application service interfaces and DTOs for data protection management. + +## Features + +* Data Protection Management Application Service Interfaces +* Data Protection DTO Definitions +* Data Protection Query Definitions + +## Application Service Interfaces + +* `IDataProtectionAppService` - Data Protection Application Service Interface + * `GetAsync` - Get Data Protection + * `GetListAsync` - Get Data Protection List + * `CreateAsync` - Create Data Protection + * `UpdateAsync` - Update Data Protection + * `DeleteAsync` - Delete Data Protection + +## DTO Definitions + +* `DataProtectionDto` - Data Protection DTO + * `Id` - Primary Key + * `Name` - Name + * `DisplayName` - Display Name + * `Description` - Description + * `AllowProperties` - List of Allowed Properties + * `FilterGroup` - Filter Rule Group + +* `DataProtectionCreateDto` - Create Data Protection DTO +* `DataProtectionUpdateDto` - Update Data Protection DTO +* `DataProtectionGetListInput` - Get Data Protection List Input DTO + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/README.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/README.md new file mode 100644 index 000000000..0bfa2ea2f --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/README.md @@ -0,0 +1,36 @@ +# LINGYUN.Abp.DataProtectionManagement.Application.Contracts + +数据权限管理应用服务契约模块,提供数据权限管理的应用服务接口和DTO。 + +## 功能 + +* 数据权限管理应用服务接口 +* 数据权限DTO定义 +* 数据权限查询定义 + +## 应用服务接口 + +* `IDataProtectionAppService` - 数据权限应用服务接口 + * `GetAsync` - 获取数据权限 + * `GetListAsync` - 获取数据权限列表 + * `CreateAsync` - 创建数据权限 + * `UpdateAsync` - 更新数据权限 + * `DeleteAsync` - 删除数据权限 + +## DTO定义 + +* `DataProtectionDto` - 数据权限DTO + * `Id` - 主键 + * `Name` - 名称 + * `DisplayName` - 显示名称 + * `Description` - 描述 + * `AllowProperties` - 允许的属性列表 + * `FilterGroup` - 过滤规则组 + +* `DataProtectionCreateDto` - 创建数据权限DTO +* `DataProtectionUpdateDto` - 更新数据权限DTO +* `DataProtectionGetListInput` - 获取数据权限列表输入DTO + +## 相关链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/README.EN.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/README.EN.md new file mode 100644 index 000000000..05ba0c88e --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/README.EN.md @@ -0,0 +1,39 @@ +# LINGYUN.Abp.DataProtectionManagement.Application + +Data protection management application service module, providing application service implementation for data protection management. + +## Features + +* Data Protection Management Application Service + * Create Data Protection + * Update Data Protection + * Delete Data Protection + * Query Data Protection +* Auto Mapping Configuration +* Permission Validation + +## Application Service Implementation + +* `DataProtectionAppService` - Data Protection Application Service + * Implements `IDataProtectionAppService` interface + * Provides CRUD operations for data protection + * Includes permission validation + * Includes data validation + +## Auto Mapping Configuration + +* `DataProtectionManagementApplicationAutoMapperProfile` - Auto Mapping Configuration Profile + * `DataProtection` -> `DataProtectionDto` + * `DataProtectionCreateDto` -> `DataProtection` + * `DataProtectionUpdateDto` -> `DataProtection` + +## Permission Validation + +* Creating data protection requires `DataProtectionManagement.DataProtection.Create` permission +* Updating data protection requires `DataProtectionManagement.DataProtection.Update` permission +* Deleting data protection requires `DataProtectionManagement.DataProtection.Delete` permission +* Querying data protection requires `DataProtectionManagement.DataProtection` permission + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/README.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/README.md new file mode 100644 index 000000000..3ffc89c30 --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/README.md @@ -0,0 +1,39 @@ +# LINGYUN.Abp.DataProtectionManagement.Application + +数据权限管理应用服务模块,提供数据权限管理的应用服务实现。 + +## 功能 + +* 数据权限管理应用服务 + * 创建数据权限 + * 更新数据权限 + * 删除数据权限 + * 查询数据权限 +* 自动映射配置 +* 权限验证 + +## 应用服务实现 + +* `DataProtectionAppService` - 数据权限应用服务 + * 实现 `IDataProtectionAppService` 接口 + * 提供数据权限的CRUD操作 + * 包含权限验证 + * 包含数据验证 + +## 自动映射配置 + +* `DataProtectionManagementApplicationAutoMapperProfile` - 自动映射配置文件 + * `DataProtection` -> `DataProtectionDto` + * `DataProtectionCreateDto` -> `DataProtection` + * `DataProtectionUpdateDto` -> `DataProtection` + +## 权限验证 + +* 创建数据权限需要 `DataProtectionManagement.DataProtection.Create` 权限 +* 更新数据权限需要 `DataProtectionManagement.DataProtection.Update` 权限 +* 删除数据权限需要 `DataProtectionManagement.DataProtection.Delete` 权限 +* 查询数据权限需要 `DataProtectionManagement.DataProtection` 权限 + +## 相关链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/README.EN.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/README.EN.md new file mode 100644 index 000000000..f4eac36bd --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/README.EN.md @@ -0,0 +1,26 @@ +# LINGYUN.Abp.DataProtectionManagement.Domain.Shared + +Data protection management domain shared module, providing constants, enums, and other shared types for data protection management. + +## Features + +* Localization Resources +* Permission Definitions +* Setting Definitions + +## Permission Definitions + +* DataProtectionManagement.DataProtection - Data Protection Management + * DataProtectionManagement.DataProtection.Create - Create Data Protection + * DataProtectionManagement.DataProtection.Update - Update Data Protection + * DataProtectionManagement.DataProtection.Delete - Delete Data Protection + +## Setting Definitions + +* DataProtectionManagement.EnabledDataProtection - Whether to enable data protection management + * Default value: true + * Can be modified through configuration file or management interface + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/README.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/README.md new file mode 100644 index 000000000..37394b91e --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/README.md @@ -0,0 +1,26 @@ +# LINGYUN.Abp.DataProtectionManagement.Domain.Shared + +数据权限管理领域共享模块,提供数据权限管理的常量、枚举和其他共享类型。 + +## 功能 + +* 本地化资源 +* 权限定义 +* 设置定义 + +## 权限定义 + +* DataProtectionManagement.DataProtection - 数据权限管理 + * DataProtectionManagement.DataProtection.Create - 创建数据权限 + * DataProtectionManagement.DataProtection.Update - 更新数据权限 + * DataProtectionManagement.DataProtection.Delete - 删除数据权限 + +## 设置定义 + +* DataProtectionManagement.EnabledDataProtection - 是否启用数据权限管理 + * 默认值: true + * 可以通过配置文件或管理界面修改 + +## 相关链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/README.EN.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/README.EN.md new file mode 100644 index 000000000..3da0f6e6b --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/README.EN.md @@ -0,0 +1,49 @@ +# LINGYUN.Abp.DataProtectionManagement.Domain + +Data protection management domain module, providing core business logic for data protection management. + +## Features + +* Data Protection Management + * Create Data Protection + * Update Data Protection + * Delete Data Protection + * Query Data Protection +* Data Protection Resource Management + * Resource Definition + * Resource Grouping + * Resource Properties +* Data Protection Rule Management + * Rule Definition + * Rule Grouping + * Rule Operators + +## Domain Services + +* `IDataProtectionManager` - Data Protection Management Service + * `CreateAsync` - Create Data Protection + * `UpdateAsync` - Update Data Protection + * `DeleteAsync` - Delete Data Protection + * `GetAsync` - Get Data Protection + * `GetListAsync` - Get Data Protection List + +## Entities + +* `DataProtection` - Data Protection Entity + * `Id` - Primary Key + * `Name` - Name + * `DisplayName` - Display Name + * `Description` - Description + * `AllowProperties` - List of Allowed Properties + * `FilterGroup` - Filter Rule Group + +## Repositories + +* `IDataProtectionRepository` - Data Protection Repository Interface + * `GetListAsync` - Get Data Protection List + * `FindByNameAsync` - Find Data Protection by Name + * `GetCountAsync` - Get Data Protection Count + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/README.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/README.md new file mode 100644 index 000000000..7176d60b0 --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/README.md @@ -0,0 +1,49 @@ +# LINGYUN.Abp.DataProtectionManagement.Domain + +数据权限管理领域模块,提供数据权限管理的核心业务逻辑。 + +## 功能 + +* 数据权限管理 + * 创建数据权限 + * 更新数据权限 + * 删除数据权限 + * 查询数据权限 +* 数据权限资源管理 + * 资源定义 + * 资源分组 + * 资源属性 +* 数据权限规则管理 + * 规则定义 + * 规则分组 + * 规则操作符 + +## 领域服务 + +* `IDataProtectionManager` - 数据权限管理服务 + * `CreateAsync` - 创建数据权限 + * `UpdateAsync` - 更新数据权限 + * `DeleteAsync` - 删除数据权限 + * `GetAsync` - 获取数据权限 + * `GetListAsync` - 获取数据权限列表 + +## 实体 + +* `DataProtection` - 数据权限实体 + * `Id` - 主键 + * `Name` - 名称 + * `DisplayName` - 显示名称 + * `Description` - 描述 + * `AllowProperties` - 允许的属性列表 + * `FilterGroup` - 过滤规则组 + +## 仓储 + +* `IDataProtectionRepository` - 数据权限仓储接口 + * `GetListAsync` - 获取数据权限列表 + * `FindByNameAsync` - 根据名称查找数据权限 + * `GetCountAsync` - 获取数据权限数量 + +## 相关链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..397b96f2e --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/README.EN.md @@ -0,0 +1,72 @@ +# LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore + +Data protection management EntityFrameworkCore module, providing data access implementation for data protection management. + +## Features + +* Data Protection Management Repository Implementation +* Database Mapping Configuration +* Database Migration + +## Repository Implementation + +* `EfCoreDataProtectionRepository` - Data Protection Repository EF Core Implementation + * Implements `IDataProtectionRepository` interface + * Provides CRUD operations for data protection + * Supports data filtering + +## Database Mapping Configuration + +```csharp +public static class DataProtectionDbContextModelCreatingExtensions +{ + public static void ConfigureDataProtectionManagement( + this ModelBuilder builder, + Action optionsAction = null) + { + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "DataProtections", options.Schema); + + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(DataProtectionConsts.MaxNameLength); + b.Property(x => x.DisplayName).HasMaxLength(DataProtectionConsts.MaxDisplayNameLength); + b.Property(x => x.Description).HasMaxLength(DataProtectionConsts.MaxDescriptionLength); + + b.HasIndex(x => x.Name); + }); + } +} +``` + +## Configuration and Usage + +1. Add Module Dependency + +```csharp +[DependsOn(typeof(AbpDataProtectionManagementEntityFrameworkCoreModule))] +public class YourModule : AbpModule +{ +} +``` + +2. Configure DbContext + +```csharp +public class YourDbContext : AbpDbContext, IDataProtectionManagementDbContext +{ + public DbSet DataProtections { get; set; } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureDataProtectionManagement(); + } +} +``` + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/README.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/README.md new file mode 100644 index 000000000..2dff63916 --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/README.md @@ -0,0 +1,72 @@ +# LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore + +数据权限管理EntityFrameworkCore模块,提供数据权限管理的数据访问实现。 + +## 功能 + +* 数据权限管理仓储实现 +* 数据库映射配置 +* 数据库迁移 + +## 仓储实现 + +* `EfCoreDataProtectionRepository` - 数据权限仓储EF Core实现 + * 实现 `IDataProtectionRepository` 接口 + * 提供数据权限的CRUD操作 + * 支持数据过滤 + +## 数据库映射配置 + +```csharp +public static class DataProtectionDbContextModelCreatingExtensions +{ + public static void ConfigureDataProtectionManagement( + this ModelBuilder builder, + Action optionsAction = null) + { + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "DataProtections", options.Schema); + + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(DataProtectionConsts.MaxNameLength); + b.Property(x => x.DisplayName).HasMaxLength(DataProtectionConsts.MaxDisplayNameLength); + b.Property(x => x.Description).HasMaxLength(DataProtectionConsts.MaxDescriptionLength); + + b.HasIndex(x => x.Name); + }); + } +} +``` + +## 配置使用 + +1. 添加模块依赖 + +```csharp +[DependsOn(typeof(AbpDataProtectionManagementEntityFrameworkCoreModule))] +public class YourModule : AbpModule +{ +} +``` + +2. 配置DbContext + +```csharp +public class YourDbContext : AbpDbContext, IDataProtectionManagementDbContext +{ + public DbSet DataProtections { get; set; } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureDataProtectionManagement(); + } +} +``` + +## 相关链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/README.EN.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..ec958a2b3 --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/README.EN.md @@ -0,0 +1,32 @@ +# LINGYUN.Abp.DataProtectionManagement.HttpApi + +Data protection management HTTP API module, providing REST API interfaces for data protection management. + +## Features + +* Data Protection Management REST API + * Create Data Protection + * Update Data Protection + * Delete Data Protection + * Query Data Protection + +## API Controllers + +* `DataProtectionController` - Data Protection Controller + * `GET /api/data-protection-management/data-protection/{id}` - Get Specific Data Protection + * `GET /api/data-protection-management/data-protection` - Get Data Protection List + * `POST /api/data-protection-management/data-protection` - Create Data Protection + * `PUT /api/data-protection-management/data-protection/{id}` - Update Data Protection + * `DELETE /api/data-protection-management/data-protection/{id}` - Delete Data Protection + +## Permission Validation + +* All APIs require authentication +* Creating data protection requires `DataProtectionManagement.DataProtection.Create` permission +* Updating data protection requires `DataProtectionManagement.DataProtection.Update` permission +* Deleting data protection requires `DataProtectionManagement.DataProtection.Delete` permission +* Querying data protection requires `DataProtectionManagement.DataProtection` permission + +## Related Links + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/README.md b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/README.md new file mode 100644 index 000000000..c6c31c389 --- /dev/null +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/README.md @@ -0,0 +1,32 @@ +# LINGYUN.Abp.DataProtectionManagement.HttpApi + +数据权限管理HTTP API模块,提供数据权限管理的REST API接口。 + +## 功能 + +* 数据权限管理REST API + * 创建数据权限 + * 更新数据权限 + * 删除数据权限 + * 查询数据权限 + +## API控制器 + +* `DataProtectionController` - 数据权限控制器 + * `GET /api/data-protection-management/data-protection/{id}` - 获取指定数据权限 + * `GET /api/data-protection-management/data-protection` - 获取数据权限列表 + * `POST /api/data-protection-management/data-protection` - 创建数据权限 + * `PUT /api/data-protection-management/data-protection/{id}` - 更新数据权限 + * `DELETE /api/data-protection-management/data-protection/{id}` - 删除数据权限 + +## 权限验证 + +* 所有API都需要认证 +* 创建数据权限需要 `DataProtectionManagement.DataProtection.Create` 权限 +* 更新数据权限需要 `DataProtectionManagement.DataProtection.Update` 权限 +* 删除数据权限需要 `DataProtectionManagement.DataProtection.Delete` 权限 +* 查询数据权限需要 `DataProtectionManagement.DataProtection` 权限 + +## 相关链接 + +* [English document](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/README.EN.md new file mode 100644 index 000000000..b7d8cdb5a --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/README.EN.md @@ -0,0 +1,34 @@ +# LINGYUN.Abp.Elsa.Activities.BlobStoring + +Blob Storage Activities integration module for Elsa workflow + +## Features + +* Provides the following Blob Storage activities: + * **BlobExists**: Check if a blob exists + * **WriteBlob**: Write blob data + * **ReadBlob**: Read blob data + * **DeleteBlob**: Delete blob data + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesBlobStoringModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "BlobStoring": true // Enable Blob Storage activities + } +} +``` + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/README.md new file mode 100644 index 000000000..0e3a26d2c --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/README.md @@ -0,0 +1,34 @@ +# LINGYUN.Abp.Elsa.Activities.BlobStoring + +Elsa工作流的Blob存储活动集成模块 + +## 功能 + +* 提供以下Blob存储活动: + * **BlobExists**: 检查Blob是否存在 + * **WriteBlob**: 写入Blob数据 + * **ReadBlob**: 读取Blob数据 + * **DeleteBlob**: 删除Blob数据 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesBlobStoringModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "BlobStoring": true // 启用Blob存储活动 + } +} +``` + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/README.EN.md new file mode 100644 index 000000000..47b77928d --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/README.EN.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.Elsa.Activities.Emailing + +Email sending activities integration module for Elsa workflow + +## Features + +* Provides **SendEmailing** activity for sending emails + * Support sending to multiple recipients + * Support template rendering for email content + * Support JavaScript and Liquid syntax + * Integration with ABP framework's `IEmailSender` interface + * Integration with ABP framework's `ITemplateRenderer` interface for template rendering + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesEmailingModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "Emailing": true // Enable email sending activities + } +} +``` + +## Activity Parameters + +* **To**: List of recipient email addresses +* **Subject**: Email subject +* **Body**: Email body content +* **Culture**: Culture information +* **Template**: Template name +* **Model**: Model parameters used to format the template content + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/README.md new file mode 100644 index 000000000..2586fe4f8 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/README.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.Elsa.Activities.Emailing + +Elsa工作流的邮件发送活动集成模块 + +## 功能 + +* 提供 **SendEmailing** 活动用于发送电子邮件 + * 支持发送给多个收件人 + * 支持使用模板渲染邮件内容 + * 支持JavaScript和Liquid语法 + * 集成ABP框架的 `IEmailSender` 接口 + * 集成ABP框架的 `ITemplateRenderer` 接口进行模板渲染 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesEmailingModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "Emailing": true // 启用邮件发送活动 + } +} +``` + +## 活动参数 + +* **To**: 收件人邮箱地址列表 +* **Subject**: 邮件主题 +* **Body**: 邮件正文内容 +* **Culture**: 文化信息 +* **Template**: 模板名称 +* **Model**: 用于格式化模板内容的模型参数 + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/README.EN.md new file mode 100644 index 000000000..922bf0546 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/README.EN.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.Elsa.Activities.IM + +Instant Messaging activities integration module for Elsa workflow + +## Features + +* Provides **SendMessage** activity for sending instant messages + * Support sending user messages and group messages + * Integration with ABP framework's `IMessageSender` interface + * Support multi-tenancy + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesIMModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "IM": true // Enable instant messaging activities + } +} +``` + +## Activity Parameters + +* **Content**: Message content +* **FormUser**: Sender user ID +* **FormUserName**: Sender username +* **To**: Recipient user ID (for user messages) +* **GroupId**: Recipient group ID (for group messages) + +## Output Parameters + +* **MessageId**: ID of the sent message + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/README.md new file mode 100644 index 000000000..90aac100c --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/README.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.Elsa.Activities.IM + +Elsa工作流的即时消息活动集成模块 + +## 功能 + +* 提供 **SendMessage** 活动用于发送即时消息 + * 支持发送用户消息和群组消息 + * 集成ABP框架的 `IMessageSender` 接口 + * 支持多租户 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesIMModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "IM": true // 启用即时消息活动 + } +} +``` + +## 活动参数 + +* **Content**: 消息内容 +* **FormUser**: 发送者用户ID +* **FormUserName**: 发送者用户名 +* **To**: 接收用户ID(用户消息) +* **GroupId**: 接收群组ID(群组消息) + +## 输出参数 + +* **MessageId**: 发送的消息ID + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/README.EN.md new file mode 100644 index 000000000..9eaa5db56 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/README.EN.md @@ -0,0 +1,47 @@ +# LINGYUN.Abp.Elsa.Activities.Notifications + +Notification activities integration module for Elsa workflow + +## Features + +* Provides **SendNotification** activity for sending notifications + * Support sending to multiple users + * Support notification data and template content + * Support JavaScript and Liquid syntax + * Support setting notification severity + * Integration with ABP framework's `INotificationSender` interface + * Support multi-tenancy + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesNotificationsModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "Notification": true // Enable notification activities + } +} +``` + +## Activity Parameters + +* **NotificationName**: Name of the registered notification +* **NotificationData**: Notification data or template content +* **To**: List of recipient user IDs +* **Severity**: Notification severity (default is Info) + +## Output Parameters + +* **NotificationId**: ID of the sent notification + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/README.md new file mode 100644 index 000000000..59d740f52 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/README.md @@ -0,0 +1,47 @@ +# LINGYUN.Abp.Elsa.Activities.Notifications + +Elsa工作流的通知活动集成模块 + +## 功能 + +* 提供 **SendNotification** 活动用于发送通知 + * 支持发送给多个用户 + * 支持通知数据和模板内容 + * 支持JavaScript和Liquid语法 + * 支持设置通知严重程度 + * 集成ABP框架的 `INotificationSender` 接口 + * 支持多租户 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesNotificationsModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "Notification": true // 启用通知活动 + } +} +``` + +## 活动参数 + +* **NotificationName**: 注册的通知名称 +* **NotificationData**: 通知数据或模板内容 +* **To**: 接收用户ID列表 +* **Severity**: 通知严重程度(默认为Info) + +## 输出参数 + +* **NotificationId**: 发送的通知ID + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/README.EN.md new file mode 100644 index 000000000..0dc03eefa --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/README.EN.md @@ -0,0 +1,40 @@ +# LINGYUN.Abp.Elsa.Activities.Sms + +SMS activities integration module for Elsa workflow + +## Features + +* Provides **SendSms** activity for sending SMS messages + * Support sending to multiple phone numbers + * Support custom message properties + * Support JavaScript, JSON, and Liquid syntax + * Integration with ABP framework's `ISmsSender` interface + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesSmsModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "Sms": true // Enable SMS activities + } +} +``` + +## Activity Parameters + +* **To**: List of recipient phone numbers +* **Message**: SMS content +* **Properties**: Additional properties (advanced option) + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/README.md new file mode 100644 index 000000000..552f59285 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/README.md @@ -0,0 +1,40 @@ +# LINGYUN.Abp.Elsa.Activities.Sms + +Elsa工作流的短信活动集成模块 + +## 功能 + +* 提供 **SendSms** 活动用于发送短信 + * 支持发送给多个手机号码 + * 支持自定义消息属性 + * 支持JavaScript、JSON和Liquid语法 + * 集成ABP框架的 `ISmsSender` 接口 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesSmsModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "Sms": true // 启用短信活动 + } +} +``` + +## 活动参数 + +* **To**: 接收手机号码列表 +* **Message**: 短信内容 +* **Properties**: 附加属性(高级选项) + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/README.EN.md new file mode 100644 index 000000000..ae06c82c9 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/README.EN.md @@ -0,0 +1,43 @@ +# LINGYUN.Abp.Elsa.Activities.Webhooks + +Webhook activities integration module for Elsa workflow + +## Features + +* Provides **PublishWebhook** activity for publishing webhooks + * Support sending data to subscribers + * Support custom HTTP headers + * Support JavaScript, JSON, and Liquid syntax + * Integration with ABP framework's `IWebhookPublisher` interface + * Support multi-tenancy + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesWebhooksModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "PublishWebhook": true // Enable webhook activities + } +} +``` + +## Activity Parameters + +* **WebhooName**: Unique name of the webhook +* **WebhookData**: Data to send +* **SendExactSameData**: If true, it sends the exact same data as the parameter to clients +* **UseOnlyGivenHeaders**: If true, webhook will only contain given headers; if false, given headers will be added to predefined headers in subscription +* **Headers**: HTTP headers to be sent (advanced option) + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/README.md new file mode 100644 index 000000000..8d127f3d9 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/README.md @@ -0,0 +1,43 @@ +# LINGYUN.Abp.Elsa.Activities.Webhooks + +Elsa工作流的Webhook活动集成模块 + +## 功能 + +* 提供 **PublishWebhook** 活动用于发布Webhook + * 支持发送数据到订阅者 + * 支持自定义HTTP头部 + * 支持JavaScript、JSON和Liquid语法 + * 集成ABP框架的 `IWebhookPublisher` 接口 + * 支持多租户 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesWebhooksModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json + +```json +{ + "Elsa": { + "PublishWebhook": true // 启用Webhook活动 + } +} +``` + +## 活动参数 + +* **WebhooName**: Webhook的唯一名称 +* **WebhookData**: 要发送的数据 +* **SendExactSameData**: 是否直接发送原始数据(如果为true,将直接发送参数中的数据给客户端) +* **UseOnlyGivenHeaders**: 是否仅使用给定的头部(如果为true,将仅使用给定的头部;如果为false,给定的头部将添加到订阅中预定义的头部) +* **Headers**: 要发送的HTTP头部(高级选项) + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.EN.md new file mode 100644 index 000000000..aa248a361 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.EN.md @@ -0,0 +1,41 @@ +# LINGYUN.Abp.Elsa.Activities + +Integration of commonly used Activities for Elsa workflow engine. + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaActivitiesModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## appsettings.json +```json +{ + "Elsa": { + "BlobStoring": true, // Enable blob storage activities + "Emailing": true, // Enable email activities + "Notification": true, // Enable notification activities + "Sms": true, // Enable SMS activities + "IM": true, // Enable instant messaging activities + "PublishWebhook": true // Enable webhook publishing activities + } +} +``` + +## Features + +This module integrates several commonly used activities for the Elsa workflow engine: + +* **Blob Storage Activities**: File storage and management operations +* **Email Activities**: Email sending and processing +* **Notification Activities**: System notification handling +* **SMS Activities**: SMS message sending +* **IM Activities**: Instant messaging operations +* **Webhook Activities**: Webhook publishing and handling + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/README.EN.md new file mode 100644 index 000000000..3c2211b1b --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/README.EN.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql + +MySql database provider module for Elsa workflow + +## Features + +* Provides MySql database support for Elsa workflow +* Depends on `AbpElsaEntityFrameworkCoreModule` and `AbpEntityFrameworkCoreMySQLModule` +* Pre-configures the following features: + * Persistence storage + * Webhooks storage + * Workflow settings storage + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaEntityFrameworkCoreMySqlModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## Configuration Options + +```json +{ + "Elsa": { + "Persistence": true, // Enable persistence storage + "Webhooks": true, // Enable webhooks storage + "WorkflowSettings": true // Enable workflow settings storage + } +} +``` + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/README.md new file mode 100644 index 000000000..f87a96f7a --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/README.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql + +Elsa工作流的MySql数据库提供程序模块 + +## 功能 + +* 提供Elsa工作流的MySql数据库支持 +* 依赖于 `AbpElsaEntityFrameworkCoreModule` 和 `AbpEntityFrameworkCoreMySQLModule` +* 预配置以下功能: + * 持久化存储 + * Webhooks存储 + * 工作流设置存储 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaEntityFrameworkCoreMySqlModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## 配置项 + +```json +{ + "Elsa": { + "Persistence": true, // 启用持久化存储 + "Webhooks": true, // 启用Webhooks存储 + "WorkflowSettings": true // 启用工作流设置存储 + } +} +``` + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/README.EN.md new file mode 100644 index 000000000..b55ffdb70 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/README.EN.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql + +PostgreSql database provider module for Elsa workflow + +## Features + +* Provides PostgreSql database support for Elsa workflow +* Depends on `AbpElsaEntityFrameworkCoreModule` and `AbpEntityFrameworkCorePostgreSqlModule` +* Pre-configures the following features: + * Persistence storage + * Webhooks storage + * Workflow settings storage + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaEntityFrameworkCorePostgreSqlModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## Configuration Options + +```json +{ + "Elsa": { + "Persistence": true, // Enable persistence storage + "Webhooks": true, // Enable webhooks storage + "WorkflowSettings": true // Enable workflow settings storage + } +} +``` + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/README.md new file mode 100644 index 000000000..d5a797c47 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/README.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql + +Elsa工作流的PostgreSql数据库提供程序模块 + +## 功能 + +* 提供Elsa工作流的PostgreSql数据库支持 +* 依赖于 `AbpElsaEntityFrameworkCoreModule` 和 `AbpEntityFrameworkCorePostgreSqlModule` +* 预配置以下功能: + * 持久化存储 + * Webhooks存储 + * 工作流设置存储 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaEntityFrameworkCorePostgreSqlModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## 配置项 + +```json +{ + "Elsa": { + "Persistence": true, // 启用持久化存储 + "Webhooks": true, // 启用Webhooks存储 + "WorkflowSettings": true // 启用工作流设置存储 + } +} +``` + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/README.EN.md new file mode 100644 index 000000000..25afe1601 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/README.EN.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer + +SqlServer database provider module for Elsa workflow + +## Features + +* Provides SqlServer database support for Elsa workflow +* Depends on `AbpElsaEntityFrameworkCoreModule` and `AbpEntityFrameworkCoreSqlServerModule` +* Pre-configures the following features: + * Persistence storage + * Webhooks storage + * Workflow settings storage + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaEntityFrameworkCoreSqlServerModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## Configuration Options + +```json +{ + "Elsa": { + "Persistence": true, // Enable persistence storage + "Webhooks": true, // Enable webhooks storage + "WorkflowSettings": true // Enable workflow settings storage + } +} +``` + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/README.md new file mode 100644 index 000000000..20b0077aa --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/README.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer + +Elsa工作流的SqlServer数据库提供程序模块 + +## 功能 + +* 提供Elsa工作流的SqlServer数据库支持 +* 依赖于 `AbpElsaEntityFrameworkCoreModule` 和 `AbpEntityFrameworkCoreSqlServerModule` +* 预配置以下功能: + * 持久化存储 + * Webhooks存储 + * 工作流设置存储 + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaEntityFrameworkCoreSqlServerModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## 配置项 + +```json +{ + "Elsa": { + "Persistence": true, // 启用持久化存储 + "Webhooks": true, // 启用Webhooks存储 + "WorkflowSettings": true // 启用工作流设置存储 + } +} +``` + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..f61e021bc --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/README.EN.md @@ -0,0 +1,29 @@ +# LINGYUN.Abp.Elsa.EntityFrameworkCore + +EntityFrameworkCore integration module for Elsa workflow + +## Features + +* Provides EntityFrameworkCore integration for Elsa workflow +* Depends on `AbpElsaModule` and `AbpEntityFrameworkCoreModule` + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaEntityFrameworkCoreModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## Database Providers + +This module is database provider agnostic. You need to choose one of the following modules based on your actual database: + +* [SqlServer](../LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/README.md) +* [PostgreSql](../LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/README.md) +* [MySql](../LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/README.md) + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/README.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/README.md new file mode 100644 index 000000000..1834a586f --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/README.md @@ -0,0 +1,29 @@ +# LINGYUN.Abp.Elsa.EntityFrameworkCore + +Elsa工作流的EntityFrameworkCore集成模块 + +## 功能 + +* 提供Elsa工作流的EntityFrameworkCore集成 +* 依赖于 `AbpElsaModule` 和 `AbpEntityFrameworkCoreModule` + +## 配置使用 + +```csharp +[DependsOn( + typeof(AbpElsaEntityFrameworkCoreModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +## 数据库提供程序 + +本模块是数据库提供程序无关的基础模块,你需要根据实际使用的数据库选择以下对应的模块: + +* [SqlServer](../LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer/README.md) +* [PostgreSql](../LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql/README.md) +* [MySql](../LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/README.md) + +[English](./README.EN.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/README.EN.md new file mode 100644 index 000000000..f90d32fb6 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/README.EN.md @@ -0,0 +1,68 @@ +# LINGYUN.Abp.Elsa.Notifications + +Workflow notification integration. When a workflow is triggered, it publishes corresponding event notifications. + +## Available States + +* Faulted: Workflow execution encountered an error +* Cancelled: Workflow was cancelled +* Completed: Workflow execution completed +* Suspended: Workflow is suspended + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaNotificationsModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +```csharp +// Define notifications +public class DemoNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + var demoGroup = context.AddGroup("Group"); + + // Due to the diversity of notifications, template messages are used to transmit data + demoGroup.AddNotification("Faulted") + .WithTemplate(template => { }); + demoGroup.AddNotification("Cancelled") + .WithTemplate(template => { }); + demoGroup.AddNotification("Suspended") + .WithTemplate(template => { }); + demoGroup.AddNotification("Completed") + .WithTemplate(template => { }); + } +} +``` + +```csharp +// Define workflow +public class DemoWorkflow : IWorkflow +{ + public void Build(IWorkflowBuilder builder) + { + builder + .WithFaultedNotification("Faulted") + .WithCancelledNotification("Cancelled") + .WithSuspendedNotification("Suspended") + .WithCompletedNotification("Completed") + .SetVariable("demo", context => + { + // Can pass custom parameters, which will be written as transient variables into the published notification data + context.WithNotificationData("demo", "demo"); + // Custom tenant ID for publishing notifications + context.WithNotificationTenantId(Guid.NewGuid()); + }) + .WriteLine("Start a workflow.") + .WriteLine("Workflow finished."); + } +} +``` + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/README.EN.md new file mode 100644 index 000000000..737f67583 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/README.EN.md @@ -0,0 +1,28 @@ +# LINGYUN.Abp.Elsa.Server + +Integration of Elsa.Server.Api, handling default Elsa endpoints. + +## Features + +* Integrates Elsa server API endpoints with ABP framework +* Provides SignalR support +* Configures API versioning +* Includes automapper profiles for data mapping +* Registers necessary services: + * `ConnectionConverter` + * `ActivityBlueprintConverter` + * `WorkflowBlueprintMapper` + * `EndpointContentSerializerSettingsProvider` + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaServerModule) + )] +public class YouProjectModule : AbpModule +{ +} +``` + +[中文文档](./README.md) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/README.EN.md b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/README.EN.md new file mode 100644 index 000000000..56b902e0e --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/README.EN.md @@ -0,0 +1,30 @@ +# LINGYUN.Abp.Elsa + +ABP Framework integration for [elsa-core](https://github.com/elsa-workflows/elsa-core) workflow engine. + +## Features + +* Provides default **AbpActivity** with multi-tenancy integration +* Defines **AbpTenantAccessor** for multi-tenancy integration +* Defines **AbpElsaIdGenerator** that generates workflow identifiers through the **IGuidGenerator** interface +* Defines **abp** related JavaScript extensions + +## Configuration and Usage + +```csharp +[DependsOn( + typeof(AbpElsaModule) + )] +public class YouProjectModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(elsa => + { + // Custom elsa related configuration + }); + } +} +``` + +[中文文档](./README.md) diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..5ea1d98ff --- /dev/null +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/README.EN.md @@ -0,0 +1,69 @@ +# LINGYUN.Abp.FeatureManagement.Application.Contracts + +Feature management application service contract module that defines interfaces, DTOs, and permissions required for feature management. + +## Features + +* Feature Definition Management Interfaces + * IFeatureDefinitionAppService + * Support CRUD operations for feature definitions +* Feature Group Definition Management Interfaces + * IFeatureGroupDefinitionAppService + * Support CRUD operations for feature group definitions +* Complete DTO Definitions + * FeatureDefinitionDto + * FeatureGroupDefinitionDto + * Create, Update, and Query DTOs +* Permission Definitions + * Feature definition management permissions + * Feature group definition management permissions + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpFeatureManagementDomainSharedModule), + typeof(VoloAbpFeatureManagementApplicationContractsModule))] +public class AbpFeatureManagementApplicationContractsModule : AbpModule +{ +} +``` + +## Permission Constants + +```csharp +public static class FeatureManagementPermissionNames +{ + public const string GroupName = "FeatureManagement"; + + public static class GroupDefinition + { + public const string Default = GroupName + ".GroupDefinitions"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + } + + public static class Definition + { + public const string Default = GroupName + ".Definitions"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + } +} +``` + +## Error Codes + +* Error:100001 - Feature definition already exists +* Error:100002 - Feature group definition already exists +* Error:100003 - Cannot delete static feature definition +* Error:100004 - Cannot delete static feature group definition + +## More Information + +* [ABP Feature Management Documentation](https://docs.abp.io/en/abp/latest/Features) +* [ABP Application Services Documentation](https://docs.abp.io/en/abp/latest/Application-Services) + +[简体中文](README.md) diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/README.md b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/README.md new file mode 100644 index 000000000..afee323d0 --- /dev/null +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/README.md @@ -0,0 +1,69 @@ +# LINGYUN.Abp.FeatureManagement.Application.Contracts + +功能管理应用服务契约模块,定义了功能管理所需的接口、DTO和权限。 + +## 功能特性 + +* 功能定义管理接口 + * IFeatureDefinitionAppService + * 支持功能定义的CRUD操作 +* 功能组定义管理接口 + * IFeatureGroupDefinitionAppService + * 支持功能组定义的CRUD操作 +* 完整的DTO定义 + * FeatureDefinitionDto + * FeatureGroupDefinitionDto + * 创建、更新和查询DTO +* 权限定义 + * 功能定义管理权限 + * 功能组定义管理权限 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpFeatureManagementDomainSharedModule), + typeof(VoloAbpFeatureManagementApplicationContractsModule))] +public class AbpFeatureManagementApplicationContractsModule : AbpModule +{ +} +``` + +## 权限常量 + +```csharp +public static class FeatureManagementPermissionNames +{ + public const string GroupName = "FeatureManagement"; + + public static class GroupDefinition + { + public const string Default = GroupName + ".GroupDefinitions"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + } + + public static class Definition + { + public const string Default = GroupName + ".Definitions"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + } +} +``` + +## 错误代码 + +* Error:100001 - 功能定义已存在 +* Error:100002 - 功能组定义已存在 +* Error:100003 - 无法删除静态功能定义 +* Error:100004 - 无法删除静态功能组定义 + +## 更多信息 + +* [ABP功能管理文档](https://docs.abp.io/en/abp/latest/Features) +* [ABP应用服务文档](https://docs.abp.io/en/abp/latest/Application-Services) + +[English](README.EN.md) diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/README.EN.md b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/README.EN.md new file mode 100644 index 000000000..21e710a6d --- /dev/null +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/README.EN.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.FeatureManagement.Application + +Feature management application service module that provides implementation for feature definition management services. + +## Features + +* Feature Definition Management + * Support creating, updating, and deleting feature definitions + * Support feature definition localization + * Support feature definition value type serialization +* Feature Group Definition Management + * Support creating, updating, and deleting feature group definitions + * Support feature group localization +* Support static and dynamic feature definition storage +* Integration with ABP feature management module + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(VoloAbpFeatureManagementApplicationModule))] +public class AbpFeatureManagementApplicationModule : AbpModule +{ +} +``` + +## Permission Definitions + +* FeatureManagement.GroupDefinitions + * FeatureManagement.GroupDefinitions.Create + * FeatureManagement.GroupDefinitions.Update + * FeatureManagement.GroupDefinitions.Delete +* FeatureManagement.Definitions + * FeatureManagement.Definitions.Create + * FeatureManagement.Definitions.Update + * FeatureManagement.Definitions.Delete + +## More Information + +* [ABP Feature Management Documentation](https://docs.abp.io/en/abp/latest/Features) +* [Feature Management Best Practices](https://docs.abp.io/en/abp/latest/Best-Practices/Features) + +[简体中文](README.md) diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/README.md b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/README.md new file mode 100644 index 000000000..676027f64 --- /dev/null +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/README.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.FeatureManagement.Application + +功能管理应用服务模块,提供了功能定义的管理服务实现。 + +## 功能特性 + +* 功能定义管理 + * 支持创建、更新、删除功能定义 + * 支持功能定义的本地化 + * 支持功能定义的值类型序列化 +* 功能组定义管理 + * 支持创建、更新、删除功能组定义 + * 支持功能组的本地化 +* 支持静态和动态功能定义存储 +* 集成ABP功能管理模块 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(VoloAbpFeatureManagementApplicationModule))] +public class AbpFeatureManagementApplicationModule : AbpModule +{ +} +``` + +## 权限定义 + +* FeatureManagement.GroupDefinitions + * FeatureManagement.GroupDefinitions.Create + * FeatureManagement.GroupDefinitions.Update + * FeatureManagement.GroupDefinitions.Delete +* FeatureManagement.Definitions + * FeatureManagement.Definitions.Create + * FeatureManagement.Definitions.Update + * FeatureManagement.Definitions.Delete + +## 更多信息 + +* [ABP功能管理文档](https://docs.abp.io/en/abp/latest/Features) +* [功能管理最佳实践](https://docs.abp.io/en/abp/latest/Best-Practices/Features) + +[English](README.EN.md) diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/README.EN.md b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..1b8e39a9c --- /dev/null +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/README.EN.md @@ -0,0 +1,56 @@ +# LINGYUN.Abp.FeatureManagement.HttpApi + +Feature management HTTP API module that provides REST API interfaces for feature definition management. + +## Features + +* Feature Definition Management API + * Create, update, delete feature definitions + * Query feature definition list +* Feature Group Definition Management API + * Create, update, delete feature group definitions + * Query feature group definition list +* Localization support +* Integration with ABP feature management module + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(VoloAbpFeatureManagementHttpApiModule))] +public class AbpFeatureManagementHttpApiModule : AbpModule +{ +} +``` + +## API Routes + +### Feature Definitions + +* GET /api/feature-management/definitions +* GET /api/feature-management/definitions/{name} +* POST /api/feature-management/definitions +* PUT /api/feature-management/definitions/{name} +* DELETE /api/feature-management/definitions/{name} + +### Feature Group Definitions + +* GET /api/feature-management/group-definitions +* GET /api/feature-management/group-definitions/{name} +* POST /api/feature-management/group-definitions +* PUT /api/feature-management/group-definitions/{name} +* DELETE /api/feature-management/group-definitions/{name} + +## Localization Configuration + +The module uses ABP's localization system with the following resources: +* AbpFeatureManagementResource +* AbpValidationResource + +## More Information + +* [ABP Web API Documentation](https://docs.abp.io/en/abp/latest/API/Auto-API-Controllers) +* [ABP Feature Management Documentation](https://docs.abp.io/en/abp/latest/Features) + +[简体中文](README.md) diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/README.md b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/README.md new file mode 100644 index 000000000..9c8259488 --- /dev/null +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/README.md @@ -0,0 +1,56 @@ +# LINGYUN.Abp.FeatureManagement.HttpApi + +功能管理HTTP API模块,提供了功能定义管理的REST API接口。 + +## 功能特性 + +* 功能定义管理API + * 创建、更新、删除功能定义 + * 查询功能定义列表 +* 功能组定义管理API + * 创建、更新、删除功能组定义 + * 查询功能组定义列表 +* 支持本地化 +* 集成ABP功能管理模块 + +## 模块依赖 + +```csharp +[DependsOn( + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(VoloAbpFeatureManagementHttpApiModule))] +public class AbpFeatureManagementHttpApiModule : AbpModule +{ +} +``` + +## API路由 + +### 功能定义 + +* GET /api/feature-management/definitions +* GET /api/feature-management/definitions/{name} +* POST /api/feature-management/definitions +* PUT /api/feature-management/definitions/{name} +* DELETE /api/feature-management/definitions/{name} + +### 功能组定义 + +* GET /api/feature-management/group-definitions +* GET /api/feature-management/group-definitions/{name} +* POST /api/feature-management/group-definitions +* PUT /api/feature-management/group-definitions/{name} +* DELETE /api/feature-management/group-definitions/{name} + +## 本地化配置 + +模块使用ABP的本地化系统,主要使用以下资源: +* AbpFeatureManagementResource +* AbpValidationResource + +## 更多信息 + +* [ABP Web API文档](https://docs.abp.io/en/abp/latest/API/Auto-API-Controllers) +* [ABP功能管理文档](https://docs.abp.io/en/abp/latest/Features) + +[English](README.EN.md) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/README.EN.md new file mode 100644 index 000000000..632449f0c --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/README.EN.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.Identity.Application.Contracts + +Identity authentication application service contracts module, providing interface definitions for identity authentication-related application services. + +## Features + +* Extends Volo.Abp.Identity.AbpIdentityApplicationContractsModule module +* Provides interface definitions for identity authentication-related application services +* Provides DTO object definitions for identity authentication +* Integrates ABP authorization module + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpAuthorizationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Service Interfaces + +* IIdentityUserAppService - User management service interface +* IIdentityRoleAppService - Role management service interface +* IIdentityClaimTypeAppService - Claim type management service interface +* IIdentitySecurityLogAppService - Security log service interface +* IIdentitySettingsAppService - Identity settings service interface +* IProfileAppService - User profile service interface + +## DTO Objects + +* IdentityUserDto - User DTO +* IdentityRoleDto - Role DTO +* IdentityClaimTypeDto - Claim type DTO +* IdentitySecurityLogDto - Security log DTO +* GetIdentityUsersInput - Get user list input DTO +* GetIdentityRolesInput - Get role list input DTO +* IdentityUserCreateDto - Create user DTO +* IdentityUserUpdateDto - Update user DTO +* IdentityRoleCreateDto - Create role DTO +* IdentityRoleUpdateDto - Update role DTO + +## Basic Usage + +1. Implement user management service interface +```csharp +public class YourIdentityUserAppService : IIdentityUserAppService +{ + public async Task GetAsync(Guid id) + { + // Implement logic to get user + } + + public async Task> GetListAsync(GetIdentityUsersInput input) + { + // Implement logic to get user list + } +} +``` + +2. Implement role management service interface +```csharp +public class YourIdentityRoleAppService : IIdentityRoleAppService +{ + public async Task GetAsync(Guid id) + { + // Implement logic to get role + } + + public async Task> GetListAsync(GetIdentityRolesInput input) + { + // Implement logic to get role list + } +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/README.md new file mode 100644 index 000000000..9c5df7b46 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/README.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.Identity.Application.Contracts + +身份认证应用服务契约模块,提供身份认证相关的应用服务接口定义。 + +## 功能特性 + +* 扩展Volo.Abp.Identity.AbpIdentityApplicationContractsModule模块 +* 提供身份认证相关的应用服务接口定义 +* 提供身份认证相关的DTO对象定义 +* 集成ABP授权模块 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpAuthorizationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 服务接口 + +* IIdentityUserAppService - 用户管理服务接口 +* IIdentityRoleAppService - 角色管理服务接口 +* IIdentityClaimTypeAppService - 声明类型管理服务接口 +* IIdentitySecurityLogAppService - 安全日志服务接口 +* IIdentitySettingsAppService - 身份认证设置服务接口 +* IProfileAppService - 用户配置文件服务接口 + +## DTO对象 + +* IdentityUserDto - 用户DTO +* IdentityRoleDto - 角色DTO +* IdentityClaimTypeDto - 声明类型DTO +* IdentitySecurityLogDto - 安全日志DTO +* GetIdentityUsersInput - 获取用户列表输入DTO +* GetIdentityRolesInput - 获取角色列表输入DTO +* IdentityUserCreateDto - 创建用户DTO +* IdentityUserUpdateDto - 更新用户DTO +* IdentityRoleCreateDto - 创建角色DTO +* IdentityRoleUpdateDto - 更新角色DTO + +## 基本用法 + +1. 实现用户管理服务接口 +```csharp +public class YourIdentityUserAppService : IIdentityUserAppService +{ + public async Task GetAsync(Guid id) + { + // 实现获取用户的逻辑 + } + + public async Task> GetListAsync(GetIdentityUsersInput input) + { + // 实现获取用户列表的逻辑 + } +} +``` + +2. 实现角色管理服务接口 +```csharp +public class YourIdentityRoleAppService : IIdentityRoleAppService +{ + public async Task GetAsync(Guid id) + { + // 实现获取角色的逻辑 + } + + public async Task> GetListAsync(GetIdentityRolesInput input) + { + // 实现获取角色列表的逻辑 + } +} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/README.EN.md new file mode 100644 index 000000000..c773bf889 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/README.EN.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.Identity.Application + +Identity authentication application service module, providing implementation of identity authentication-related application services. + +## Features + +* Extends Volo.Abp.Identity.AbpIdentityApplicationModule module +* Provides implementation of identity authentication-related application services +* Integrates AutoMapper object mapping +* Supports user avatar URL extension property + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityApplicationModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpIdentityDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Application Services + +* IdentityUserAppService - User management service +* IdentityRoleAppService - Role management service +* IdentityClaimTypeAppService - Claim type management service +* IdentitySecurityLogAppService - Security log service +* IdentitySettingsAppService - Identity settings service +* ProfileAppService - User profile service + +## Object Mapping + +The module uses AutoMapper for object mapping, main mappings include: + +* IdentityUser -> IdentityUserDto +* IdentityRole -> IdentityRoleDto +* IdentityClaimType -> IdentityClaimTypeDto +* IdentitySecurityLog -> IdentitySecurityLogDto + +## Basic Usage + +1. Using user management service +```csharp +public class YourService +{ + private readonly IIdentityUserAppService _userAppService; + + public YourService(IIdentityUserAppService userAppService) + { + _userAppService = userAppService; + } + + public async Task GetUserAsync(Guid id) + { + return await _userAppService.GetAsync(id); + } +} +``` + +2. Using role management service +```csharp +public class YourService +{ + private readonly IIdentityRoleAppService _roleAppService; + + public YourService(IIdentityRoleAppService roleAppService) + { + _roleAppService = roleAppService; + } + + public async Task GetRoleAsync(Guid id) + { + return await _roleAppService.GetAsync(id); + } +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/README.md new file mode 100644 index 000000000..7dff1f810 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/README.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.Identity.Application + +身份认证应用服务模块,提供身份认证相关的应用服务实现。 + +## 功能特性 + +* 扩展Volo.Abp.Identity.AbpIdentityApplicationModule模块 +* 提供身份认证相关的应用服务实现 +* 集成AutoMapper对象映射 +* 支持用户头像URL扩展属性 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityApplicationModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpIdentityDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 应用服务 + +* IdentityUserAppService - 用户管理服务 +* IdentityRoleAppService - 角色管理服务 +* IdentityClaimTypeAppService - 声明类型管理服务 +* IdentitySecurityLogAppService - 安全日志服务 +* IdentitySettingsAppService - 身份认证设置服务 +* ProfileAppService - 用户配置文件服务 + +## 对象映射 + +模块使用AutoMapper进行对象映射,主要映射包括: + +* IdentityUser -> IdentityUserDto +* IdentityRole -> IdentityRoleDto +* IdentityClaimType -> IdentityClaimTypeDto +* IdentitySecurityLog -> IdentitySecurityLogDto + +## 基本用法 + +1. 使用用户管理服务 +```csharp +public class YourService +{ + private readonly IIdentityUserAppService _userAppService; + + public YourService(IIdentityUserAppService userAppService) + { + _userAppService = userAppService; + } + + public async Task GetUserAsync(Guid id) + { + return await _userAppService.GetAsync(id); + } +} +``` + +2. 使用角色管理服务 +```csharp +public class YourService +{ + private readonly IIdentityRoleAppService _roleAppService; + + public YourService(IIdentityRoleAppService roleAppService) + { + _roleAppService = roleAppService; + } + + public async Task GetRoleAsync(Guid id) + { + return await _roleAppService.GetAsync(id); + } +} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.EN.md new file mode 100644 index 000000000..244f671ab --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.EN.md @@ -0,0 +1,67 @@ +# LINGYUN.Abp.Identity.AspNetCore.Session + +User session login extension module, mainly handling login/logout events provided by *AspNetCore.Identity* to manage sessions. + +Due to module responsibility separation principle, please do not confuse with *LINGYUN.Abp.Identity.Session.AspNetCore* module. + +## Configuration Usage + +```csharp +[DependsOn(typeof(AbpIdentityAspNetCoreSessionModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Features + +* Extends AbpIdentityAspNetCoreModule module +* Provides session management functionality in AspNetCore environment +* Custom authentication service implementation +* Integrates with AspNetCore.Identity login/logout events + +## Service Implementation + +* AbpIdentitySessionAuthenticationService - Custom authentication service + * Handles user login/logout events + * Manages user session state + * Integrates with Identity session system + +## Basic Usage + +1. Configure authentication service +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddTransient(); +} +``` + +2. Use authentication service +```csharp +public class YourService +{ + private readonly IAuthenticationService _authenticationService; + + public YourService(IAuthenticationService authenticationService) + { + _authenticationService = authenticationService; + } + + public async Task SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties) + { + await _authenticationService.SignInAsync(context, scheme, principal, properties); + } + + public async Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) + { + await _authenticationService.SignOutAsync(context, scheme, properties); + } +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) +* [ASP.NET Core Identity Documentation](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.md index 3fed616a4..580848c65 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.md +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.md @@ -13,3 +13,55 @@ public class YouProjectModule : AbpModule // other } ``` + +## 功能特性 + +* 扩展AbpIdentityAspNetCoreModule模块 +* 提供AspNetCore环境下的会话管理功能 +* 自定义身份认证服务实现 +* 集成AspNetCore.Identity的登录/登出事件 + +## 服务实现 + +* AbpIdentitySessionAuthenticationService - 自定义身份认证服务 + * 处理用户登录/登出事件 + * 管理用户会话状态 + * 与Identity会话系统集成 + +## 基本用法 + +1. 配置身份认证服务 +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddTransient(); +} +``` + +2. 使用身份认证服务 +```csharp +public class YourService +{ + private readonly IAuthenticationService _authenticationService; + + public YourService(IAuthenticationService authenticationService) + { + _authenticationService = authenticationService; + } + + public async Task SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties) + { + await _authenticationService.SignInAsync(context, scheme, principal, properties); + } + + public async Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) + { + await _authenticationService.SignOutAsync(context, scheme, properties); + } +} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) +* [ASP.NET Core Identity文档](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/README.EN.md new file mode 100644 index 000000000..73d7c2f2f --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/README.EN.md @@ -0,0 +1,55 @@ +# LINGYUN.Abp.Identity.Domain.Shared + +Identity authentication domain shared module, providing basic definitions for identity authentication. + +## Features + +* Provides localization resources for identity authentication +* Provides virtual file system configuration for identity authentication +* Extends Volo.Abp.Identity.AbpIdentityDomainSharedModule module + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpIdentityDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +No additional configuration required. + +## Basic Usage + +1. Reference the module +```csharp +[DependsOn(typeof(AbpIdentityDomainSharedModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Use localization resources +```csharp +public class YourClass +{ + private readonly IStringLocalizer _localizer; + + public YourClass(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public string GetLocalizedString(string key) + { + return _localizer[key]; + } +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/README.md new file mode 100644 index 000000000..5b987cffc --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/README.md @@ -0,0 +1,55 @@ +# LINGYUN.Abp.Identity.Domain.Shared + +身份认证领域共享模块,提供身份认证相关的基础定义。 + +## 功能特性 + +* 提供身份认证相关的本地化资源 +* 提供身份认证相关的虚拟文件系统配置 +* 扩展Volo.Abp.Identity.AbpIdentityDomainSharedModule模块 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpIdentityDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +无需额外配置。 + +## 基本用法 + +1. 引用模块 +```csharp +[DependsOn(typeof(AbpIdentityDomainSharedModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 使用本地化资源 +```csharp +public class YourClass +{ + private readonly IStringLocalizer _localizer; + + public YourClass(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public string GetLocalizedString(string key) + { + return _localizer[key]; + } +} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/README.EN.md new file mode 100644 index 000000000..29dc28463 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/README.EN.md @@ -0,0 +1,81 @@ +# LINGYUN.Abp.Identity.Domain + +Identity authentication domain module, providing core functionality implementation for identity authentication. + +## Features + +* Extends Volo.Abp.Identity.AbpIdentityDomainModule module +* Provides identity session management functionality +* Provides identity session cleanup functionality +* Supports distributed events + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityDomainModule), + typeof(Volo.Abp.Identity.AbpIdentityDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +### IdentitySessionCleanupOptions + +```json +{ + "Identity": { + "Session": { + "Cleanup": { + "IsEnabled": false, // Enable session cleanup, default: false + "CleanupPeriod": 3600000, // Cleanup interval (milliseconds), default: 1 hour + "InactiveTimeSpan": "30.00:00:00" // Inactive session retention period, default: 30 days + } + } + } +} +``` + +### IdentitySessionSignInOptions + +```json +{ + "Identity": { + "Session": { + "SignIn": { + "AuthenticationSchemes": ["Identity.Application"], // Authentication schemes for processing + "SignInSessionEnabled": false, // Enable SignInManager login session, default: false + "SignOutSessionEnabled": false // Enable SignInManager logout session, default: false + } + } + } +} +``` + +## Basic Usage + +1. Configure identity session management +```csharp +Configure(options => +{ + options.SignInSessionEnabled = true; // Enable login session + options.SignOutSessionEnabled = true; // Enable logout session +}); +``` + +2. Configure session cleanup +```csharp +Configure(options => +{ + options.IsCleanupEnabled = true; // Enable session cleanup + options.CleanupPeriod = 3600000; // Set cleanup interval to 1 hour + options.InactiveTimeSpan = TimeSpan.FromDays(7); // Set inactive session retention period to 7 days +}); +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/README.md new file mode 100644 index 000000000..549343d16 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/README.md @@ -0,0 +1,81 @@ +# LINGYUN.Abp.Identity.Domain + +身份认证领域模块,提供身份认证相关的核心功能实现。 + +## 功能特性 + +* 扩展Volo.Abp.Identity.AbpIdentityDomainModule模块 +* 提供身份会话管理功能 +* 提供身份会话清理功能 +* 支持分布式事件 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityDomainModule), + typeof(Volo.Abp.Identity.AbpIdentityDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +### IdentitySessionCleanupOptions + +```json +{ + "Identity": { + "Session": { + "Cleanup": { + "IsEnabled": false, // 是否启用会话清理,默认:false + "CleanupPeriod": 3600000, // 会话清理间隔(毫秒),默认:1小时 + "InactiveTimeSpan": "30.00:00:00" // 不活跃会话保持时长,默认:30天 + } + } + } +} +``` + +### IdentitySessionSignInOptions + +```json +{ + "Identity": { + "Session": { + "SignIn": { + "AuthenticationSchemes": ["Identity.Application"], // 用于处理的身份认证方案 + "SignInSessionEnabled": false, // 是否启用SignInManager登录会话,默认:false + "SignOutSessionEnabled": false // 是否启用SignInManager登出会话,默认:false + } + } + } +} +``` + +## 基本用法 + +1. 配置身份会话管理 +```csharp +Configure(options => +{ + options.SignInSessionEnabled = true; // 启用登录会话 + options.SignOutSessionEnabled = true; // 启用登出会话 +}); +``` + +2. 配置会话清理 +```csharp +Configure(options => +{ + options.IsCleanupEnabled = true; // 启用会话清理 + options.CleanupPeriod = 3600000; // 设置清理间隔为1小时 + options.InactiveTimeSpan = TimeSpan.FromDays(7); // 设置不活跃会话保持时间为7天 +}); +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..b347a0fcc --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/README.EN.md @@ -0,0 +1,90 @@ +# LINGYUN.Abp.Identity.EntityFrameworkCore + +Identity authentication EntityFrameworkCore module, providing data access implementation for identity authentication. + +## Features + +* Extends Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule module +* Provides EF Core repository implementations for identity authentication +* Supports database mapping for user avatar URL extension property +* Provides EF Core repository implementation for organization units +* Provides EF Core repository implementation for session management + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityDomainModule), + typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Repository Implementations + +* EfCoreIdentityUserRepository - User repository implementation +* EfCoreIdentityRoleRepository - Role repository implementation +* EfCoreIdentitySessionRepository - Session repository implementation +* EfCoreOrganizationUnitRepository - Organization unit repository implementation + +## Basic Usage + +1. Configure DbContext +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddAbpDbContext(options => + { + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + }); +} +``` + +2. Use repositories +```csharp +public class YourService +{ + private readonly IRepository _userRepository; + private readonly IRepository _roleRepository; + + public YourService( + IRepository userRepository, + IRepository roleRepository) + { + _userRepository = userRepository; + _roleRepository = roleRepository; + } + + public async Task GetUserAsync(Guid id) + { + return await _userRepository.GetAsync(id); + } + + public async Task GetRoleAsync(Guid id) + { + return await _roleRepository.GetAsync(id); + } +} +``` + +## Database Migrations + +1. Add migration +```bash +dotnet ef migrations add Added_Identity_Tables +``` + +2. Update database +```bash +dotnet ef database update +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) +* [EF Core Documentation](https://docs.microsoft.com/en-us/ef/core/) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/README.md new file mode 100644 index 000000000..cf11b2f17 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/README.md @@ -0,0 +1,90 @@ +# LINGYUN.Abp.Identity.EntityFrameworkCore + +身份认证EntityFrameworkCore模块,提供身份认证相关的数据访问实现。 + +## 功能特性 + +* 扩展Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule模块 +* 提供身份认证相关的EF Core仓储实现 +* 支持用户头像URL扩展属性的数据库映射 +* 提供组织单元的EF Core仓储实现 +* 提供会话管理的EF Core仓储实现 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityDomainModule), + typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 仓储实现 + +* EfCoreIdentityUserRepository - 用户仓储实现 +* EfCoreIdentityRoleRepository - 角色仓储实现 +* EfCoreIdentitySessionRepository - 会话仓储实现 +* EfCoreOrganizationUnitRepository - 组织单元仓储实现 + +## 基本用法 + +1. 配置DbContext +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddAbpDbContext(options => + { + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + }); +} +``` + +2. 使用仓储 +```csharp +public class YourService +{ + private readonly IRepository _userRepository; + private readonly IRepository _roleRepository; + + public YourService( + IRepository userRepository, + IRepository roleRepository) + { + _userRepository = userRepository; + _roleRepository = roleRepository; + } + + public async Task GetUserAsync(Guid id) + { + return await _userRepository.GetAsync(id); + } + + public async Task GetRoleAsync(Guid id) + { + return await _roleRepository.GetAsync(id); + } +} +``` + +## 数据库迁移 + +1. 添加迁移 +```bash +dotnet ef migrations add Added_Identity_Tables +``` + +2. 更新数据库 +```bash +dotnet ef database update +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) +* [EF Core文档](https://docs.microsoft.com/en-us/ef/core/) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/README.EN.md new file mode 100644 index 000000000..652a57bad --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/README.EN.md @@ -0,0 +1,90 @@ +# LINGYUN.Abp.Identity.HttpApi.Client + +Identity authentication HTTP API client module, providing HTTP API client proxies for identity authentication. + +## Features + +* Extends Volo.Abp.Identity.AbpIdentityHttpApiClientModule module +* Provides HTTP API client proxies for identity authentication +* Automatically registers HTTP client proxy services + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpIdentityApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "RemoteServices": { + "Identity": { + "BaseUrl": "http://localhost:44388/" + } + } +} +``` + +## Client Proxies + +* IIdentityUserAppService - User management client proxy +* IIdentityRoleAppService - Role management client proxy +* IIdentityClaimTypeAppService - Claim type management client proxy +* IIdentitySecurityLogAppService - Security log client proxy +* IIdentitySettingsAppService - Identity settings client proxy +* IProfileAppService - User profile client proxy + +## Basic Usage + +1. Configure remote services +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.RemoteServices.Default = + new RemoteServiceConfiguration(configuration["RemoteServices:Identity:BaseUrl"]); + }); +} +``` + +2. Use client proxies +```csharp +public class YourService +{ + private readonly IIdentityUserAppService _userAppService; + private readonly IIdentityRoleAppService _roleAppService; + + public YourService( + IIdentityUserAppService userAppService, + IIdentityRoleAppService roleAppService) + { + _userAppService = userAppService; + _roleAppService = roleAppService; + } + + public async Task GetUserAsync(Guid id) + { + return await _userAppService.GetAsync(id); + } + + public async Task GetRoleAsync(Guid id) + { + return await _roleAppService.GetAsync(id); + } +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) +* [ABP HTTP API Client Proxies Documentation](https://docs.abp.io/en/abp/latest/API/HTTP-Client-Proxies) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/README.md new file mode 100644 index 000000000..143713199 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/README.md @@ -0,0 +1,90 @@ +# LINGYUN.Abp.Identity.HttpApi.Client + +身份认证HTTP API客户端模块,提供身份认证相关的HTTP API客户端代理。 + +## 功能特性 + +* 扩展Volo.Abp.Identity.AbpIdentityHttpApiClientModule模块 +* 提供身份认证相关的HTTP API客户端代理 +* 自动注册HTTP客户端代理服务 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpIdentityApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "RemoteServices": { + "Identity": { + "BaseUrl": "http://localhost:44388/" + } + } +} +``` + +## 客户端代理 + +* IIdentityUserAppService - 用户管理客户端代理 +* IIdentityRoleAppService - 角色管理客户端代理 +* IIdentityClaimTypeAppService - 声明类型管理客户端代理 +* IIdentitySecurityLogAppService - 安全日志客户端代理 +* IIdentitySettingsAppService - 身份认证设置客户端代理 +* IProfileAppService - 用户配置文件客户端代理 + +## 基本用法 + +1. 配置远程服务 +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.RemoteServices.Default = + new RemoteServiceConfiguration(configuration["RemoteServices:Identity:BaseUrl"]); + }); +} +``` + +2. 使用客户端代理 +```csharp +public class YourService +{ + private readonly IIdentityUserAppService _userAppService; + private readonly IIdentityRoleAppService _roleAppService; + + public YourService( + IIdentityUserAppService userAppService, + IIdentityRoleAppService roleAppService) + { + _userAppService = userAppService; + _roleAppService = roleAppService; + } + + public async Task GetUserAsync(Guid id) + { + return await _userAppService.GetAsync(id); + } + + public async Task GetRoleAsync(Guid id) + { + return await _roleAppService.GetAsync(id); + } +} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) +* [ABP HTTP API客户端代理文档](https://docs.abp.io/en/abp/latest/API/HTTP-Client-Proxies) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/README.EN.md new file mode 100644 index 000000000..d53b0434b --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/README.EN.md @@ -0,0 +1,85 @@ +# LINGYUN.Abp.Identity.HttpApi + +Identity authentication HTTP API module, providing HTTP API interfaces for identity authentication. + +## Features + +* Extends Volo.Abp.Identity.AbpIdentityHttpApiModule module +* Provides HTTP API interfaces for identity authentication +* Supports MVC data annotations with localization resources +* Automatically registers MVC application parts + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityHttpApiModule), + typeof(AbpIdentityApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Controllers + +* IdentityUserController - User management API +* IdentityRoleController - Role management API +* IdentityClaimTypeController - Claim type management API +* IdentitySecurityLogController - Security log API +* IdentitySettingsController - Identity settings API +* ProfileController - User profile API + +## API Routes + +* `/api/identity/users` - User management API routes +* `/api/identity/roles` - Role management API routes +* `/api/identity/claim-types` - Claim type management API routes +* `/api/identity/security-logs` - Security log API routes +* `/api/identity/settings` - Identity settings API routes +* `/api/identity/my-profile` - User profile API routes + +## Basic Usage + +1. Configure localization +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(options => + { + options.AddAssemblyResource(typeof(IdentityResource), typeof(AbpIdentityApplicationContractsModule).Assembly); + }); +} +``` + +2. Use APIs +```csharp +// Get user list +GET /api/identity/users + +// Get specific user +GET /api/identity/users/{id} + +// Create user +POST /api/identity/users +{ + "userName": "admin", + "email": "admin@abp.io", + "password": "1q2w3E*" +} + +// Update user +PUT /api/identity/users/{id} +{ + "userName": "admin", + "email": "admin@abp.io" +} + +// Delete user +DELETE /api/identity/users/{id} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) +* [ABP HTTP API Documentation](https://docs.abp.io/en/abp/latest/API/HTTP-API) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/README.md new file mode 100644 index 000000000..ba27690be --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/README.md @@ -0,0 +1,85 @@ +# LINGYUN.Abp.Identity.HttpApi + +身份认证HTTP API模块,提供身份认证相关的HTTP API接口。 + +## 功能特性 + +* 扩展Volo.Abp.Identity.AbpIdentityHttpApiModule模块 +* 提供身份认证相关的HTTP API接口 +* 支持本地化资源的MVC数据注解 +* 自动注册MVC应用程序部件 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityHttpApiModule), + typeof(AbpIdentityApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API控制器 + +* IdentityUserController - 用户管理API +* IdentityRoleController - 角色管理API +* IdentityClaimTypeController - 声明类型管理API +* IdentitySecurityLogController - 安全日志API +* IdentitySettingsController - 身份认证设置API +* ProfileController - 用户配置文件API + +## API路由 + +* `/api/identity/users` - 用户管理API路由 +* `/api/identity/roles` - 角色管理API路由 +* `/api/identity/claim-types` - 声明类型管理API路由 +* `/api/identity/security-logs` - 安全日志API路由 +* `/api/identity/settings` - 身份认证设置API路由 +* `/api/identity/my-profile` - 用户配置文件API路由 + +## 基本用法 + +1. 配置本地化 +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(options => + { + options.AddAssemblyResource(typeof(IdentityResource), typeof(AbpIdentityApplicationContractsModule).Assembly); + }); +} +``` + +2. 使用API +```csharp +// 获取用户列表 +GET /api/identity/users + +// 获取指定用户 +GET /api/identity/users/{id} + +// 创建用户 +POST /api/identity/users +{ + "userName": "admin", + "email": "admin@abp.io", + "password": "1q2w3E*" +} + +// 更新用户 +PUT /api/identity/users/{id} +{ + "userName": "admin", + "email": "admin@abp.io" +} + +// 删除用户 +DELETE /api/identity/users/{id} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) +* [ABP HTTP API文档](https://docs.abp.io/en/abp/latest/API/HTTP-API) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/README.EN.md new file mode 100644 index 000000000..c83ee957e --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/README.EN.md @@ -0,0 +1,78 @@ +# LINGYUN.Abp.Identity.Notifications + +Identity authentication notification module, providing notification functionality related to identity authentication. + +## Features + +* Extends AbpNotificationsModule module +* Provides notification definitions related to identity authentication +* Supports session expiration notifications +* Provides identity session revocation event handling + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpNotificationsModule), + typeof(AbpDddDomainSharedModule), + typeof(AbpIdentityDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Notification Definitions + +### Session Notifications + +* `AbpIdentity.Session.Expiration` - Session expiration notification + * Sent when a user's session expires + * Notifies the user that their session has expired and they need to log in again + +## Event Handling + +### IdentitySessionRevokeEventHandler + +Handles identity session revocation events. When a session is revoked: +* Sends session expiration notification to relevant users +* Notifies users they need to log in again + +## Basic Usage + +1. Subscribe to session expiration notifications +```csharp +public class YourNotificationHandler : INotificationHandler +{ + public async Task HandleNotificationAsync(SessionExpirationNotification notification) + { + // Handle session expiration notification + } +} +``` + +2. Send session expiration notification +```csharp +public class YourService +{ + private readonly INotificationSender _notificationSender; + + public YourService(INotificationSender notificationSender) + { + _notificationSender = notificationSender; + } + + public async Task SendSessionExpirationNotificationAsync(Guid userId) + { + await _notificationSender.SendAsync( + IdentityNotificationNames.Session.ExpirationSession, + new NotificationData(), + userIds: new[] { userId }); + } +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) +* [ABP Notification System Documentation](https://docs.abp.io/en/abp/latest/Notification-System) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/README.md new file mode 100644 index 000000000..0e690acb3 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/README.md @@ -0,0 +1,78 @@ +# LINGYUN.Abp.Identity.Notifications + +身份认证通知模块,提供身份认证相关的通知功能。 + +## 功能特性 + +* 扩展AbpNotificationsModule模块 +* 提供身份认证相关的通知定义 +* 支持会话过期通知 +* 提供身份会话撤销事件处理 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpNotificationsModule), + typeof(AbpDddDomainSharedModule), + typeof(AbpIdentityDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 通知定义 + +### 会话通知 + +* `AbpIdentity.Session.Expiration` - 会话过期通知 + * 当用户会话过期时发送此通知 + * 通知用户其会话已经过期,需要重新登录 + +## 事件处理 + +### IdentitySessionRevokeEventHandler + +处理身份会话撤销事件,当会话被撤销时: +* 发送会话过期通知给相关用户 +* 通知用户需要重新登录 + +## 基本用法 + +1. 订阅会话过期通知 +```csharp +public class YourNotificationHandler : INotificationHandler +{ + public async Task HandleNotificationAsync(SessionExpirationNotification notification) + { + // 处理会话过期通知 + } +} +``` + +2. 发送会话过期通知 +```csharp +public class YourService +{ + private readonly INotificationSender _notificationSender; + + public YourService(INotificationSender notificationSender) + { + _notificationSender = notificationSender; + } + + public async Task SendSessionExpirationNotificationAsync(Guid userId) + { + await _notificationSender.SendAsync( + IdentityNotificationNames.Session.ExpirationSession, + new NotificationData(), + userIds: new[] { userId }); + } +} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) +* [ABP通知系统文档](https://docs.abp.io/en/abp/latest/Notification-System) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/README.EN.md new file mode 100644 index 000000000..9f0ff52b0 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/README.EN.md @@ -0,0 +1,84 @@ +# LINGYUN.Abp.Identity.OrganizaztionUnits + +Identity authentication organization units module, providing integration functionality between the identity authentication system and organization units. + +## Features + +* Extends AbpIdentityDomainModule module +* Integrates AbpAuthorizationOrganizationUnitsModule module +* Supports dynamic addition of organization unit claims +* Provides organization unit-related identity authentication functionality + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityDomainModule), + typeof(AbpAuthorizationOrganizationUnitsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +### AbpClaimsPrincipalFactoryOptions + +```json +{ + "Abp": { + "Security": { + "Claims": { + "DynamicClaims": { + "OrganizationUnit": true // Enable organization unit dynamic claims + } + } + } + } +} +``` + +## Claim Types + +* `AbpOrganizationUnitClaimTypes.OrganizationUnit` - Organization unit claim type + * Used to identify the organization unit a user belongs to + * Automatically added to claims during user authentication + +## Basic Usage + +1. Configure organization unit claims +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.DynamicClaims.Add(AbpOrganizationUnitClaimTypes.OrganizationUnit); + }); +} +``` + +2. Get user's organization unit claims +```csharp +public class YourService +{ + private readonly ICurrentUser _currentUser; + + public YourService(ICurrentUser currentUser) + { + _currentUser = currentUser; + } + + public string[] GetUserOrganizationUnits() + { + return _currentUser.FindClaims(AbpOrganizationUnitClaimTypes.OrganizationUnit) + .Select(c => c.Value) + .ToArray(); + } +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) +* [ABP Organization Units Documentation](https://docs.abp.io/en/abp/latest/Organization-Units) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/README.md new file mode 100644 index 000000000..dcb284529 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/README.md @@ -0,0 +1,84 @@ +# LINGYUN.Abp.Identity.OrganizaztionUnits + +身份认证组织单元模块,提供身份认证系统与组织单元的集成功能。 + +## 功能特性 + +* 扩展AbpIdentityDomainModule模块 +* 集成AbpAuthorizationOrganizationUnitsModule模块 +* 支持组织单元声明动态添加 +* 提供组织单元相关的身份认证功能 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityDomainModule), + typeof(AbpAuthorizationOrganizationUnitsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +### AbpClaimsPrincipalFactoryOptions + +```json +{ + "Abp": { + "Security": { + "Claims": { + "DynamicClaims": { + "OrganizationUnit": true // 启用组织单元动态声明 + } + } + } + } +} +``` + +## 声明类型 + +* `AbpOrganizationUnitClaimTypes.OrganizationUnit` - 组织单元声明类型 + * 用于标识用户所属的组织单元 + * 在用户身份验证时自动添加到声明中 + +## 基本用法 + +1. 配置组织单元声明 +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.DynamicClaims.Add(AbpOrganizationUnitClaimTypes.OrganizationUnit); + }); +} +``` + +2. 获取用户的组织单元声明 +```csharp +public class YourService +{ + private readonly ICurrentUser _currentUser; + + public YourService(ICurrentUser currentUser) + { + _currentUser = currentUser; + } + + public string[] GetUserOrganizationUnits() + { + return _currentUser.FindClaims(AbpOrganizationUnitClaimTypes.OrganizationUnit) + .Select(c => c.Value) + .ToArray(); + } +} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) +* [ABP组织单元文档](https://docs.abp.io/en/abp/latest/Organization-Units) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.EN.md new file mode 100644 index 000000000..4c5ccd8af --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.EN.md @@ -0,0 +1,97 @@ +# LINGYUN.Abp.Identity.Session.AspNetCore + +Identity service user session extension module. + +## Interface Description + +### AbpSessionMiddleware extracts *sessionId* from user token in the request pipeline as a global session identifier, which can be used to log out sessions +> Note: When anonymous users access, the request *CorrelationId* is used as the identifier; + When *CorrelationId* does not exist, use random *Guid.NewGuid()*. + +### HttpContextDeviceInfoProvider extracts device identification from request parameters + +> Due to module responsibility separation principle, please do not confuse with *LINGYUN.Abp.Identity.AspNetCore.Session* module + +### HttpContextDeviceInfoProvider is used to handle session IP address location parsing + +> IsParseIpLocation will parse the geographical location of session IP when enabled +> IgnoreProvinces are provinces that need to be ignored when parsing geographical locations, usually China's municipalities +> LocationParser customizes the geographical location data that needs to be processed + +## Features + +* Provides session management functionality in AspNetCore environment +* Supports extracting device identification information from requests +* Supports IP geolocation parsing +* Depends on AbpAspNetCoreModule, AbpIP2RegionModule, and AbpIdentitySessionModule + +## Configuration Options + +### AbpIdentitySessionAspNetCoreOptions + +```json +{ + "Identity": { + "Session": { + "AspNetCore": { + "IsParseIpLocation": false, // Whether to parse IP geographic information, default: false + "IgnoreProvinces": [ // Provinces to ignore, default includes China's municipalities + "Beijing", + "Shanghai", + "Tianjin", + "Chongqing" + ] + } + } + } +} +``` + +## Basic Usage + +1. Configure IP geolocation parsing +```csharp +Configure(options => +{ + options.IsParseIpLocation = true; // Enable IP geolocation parsing + options.IgnoreProvinces.Add("Hong Kong"); // Add provinces to ignore + options.LocationParser = (locationInfo) => + { + // Custom geolocation parsing logic + return $"{locationInfo.Country}{locationInfo.Province}{locationInfo.City}"; + }; +}); +``` + +2. Use device information provider +```csharp +public class YourService +{ + private readonly IDeviceInfoProvider _deviceInfoProvider; + + public YourService(IDeviceInfoProvider deviceInfoProvider) + { + _deviceInfoProvider = deviceInfoProvider; + } + + public async Task GetDeviceInfoAsync() + { + return await _deviceInfoProvider.GetDeviceInfoAsync(); + } +} +``` + +## Configuration Usage + +```csharp +[DependsOn(typeof(AbpIdentitySessionAspNetCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) +* [ABP AspNetCore Documentation](https://docs.abp.io/en/abp/latest/AspNetCore) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.md index 65d16a42d..b5393fddf 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.md +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.md @@ -19,6 +19,69 @@ > IgnoreProvinces 解析地理位置时需要忽略的省份,通常情况下中国的直辖市需要 > LocationParser 自定义需要处理的地理位置数据 +## 功能特性 + +* 提供AspNetCore环境下的会话管理功能 +* 支持从请求中提取设备标识信息 +* 支持IP地理位置解析功能 +* 依赖AbpAspNetCoreModule、AbpIP2RegionModule和AbpIdentitySessionModule模块 + +## 配置项 + +### AbpIdentitySessionAspNetCoreOptions + +```json +{ + "Identity": { + "Session": { + "AspNetCore": { + "IsParseIpLocation": false, // 是否解析IP地理信息,默认:false + "IgnoreProvinces": [ // 不做处理的省份,默认包含中国直辖市 + "北京", + "上海", + "天津", + "重庆" + ] + } + } + } +} +``` + +## 基本用法 + +1. 配置IP地理位置解析 +```csharp +Configure(options => +{ + options.IsParseIpLocation = true; // 启用IP地理位置解析 + options.IgnoreProvinces.Add("香港"); // 添加需要忽略的省份 + options.LocationParser = (locationInfo) => + { + // 自定义地理位置解析逻辑 + return $"{locationInfo.Country}{locationInfo.Province}{locationInfo.City}"; + }; +}); +``` + +2. 使用设备信息提供者 +```csharp +public class YourService +{ + private readonly IDeviceInfoProvider _deviceInfoProvider; + + public YourService(IDeviceInfoProvider deviceInfoProvider) + { + _deviceInfoProvider = deviceInfoProvider; + } + + public async Task GetDeviceInfoAsync() + { + return await _deviceInfoProvider.GetDeviceInfoAsync(); + } +} +``` + ## 配置使用 ```csharp @@ -28,3 +91,8 @@ public class YouProjectModule : AbpModule // other } ``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) +* [ABP AspNetCore文档](https://docs.abp.io/en/abp/latest/AspNetCore) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.EN.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.EN.md new file mode 100644 index 000000000..dc7d2353a --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.EN.md @@ -0,0 +1,48 @@ +# LINGYUN.Abp.Identity.Session + +User session foundation module, providing related common interfaces. + +## Features + +* Provides basic interfaces for user session management +* Provides session cache and persistence synchronization mechanism +* Supports session access time tracking +* Depends on AbpCachingModule + +## Configuration Usage + +```csharp +[DependsOn(typeof(AbpIdentitySessionModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // Set session cache and persistence refresh interval to 10 minutes + options.KeepAccessTimeSpan = TimeSpan.FromMinutes(10); + }); + } +} +``` + +## Configuration Options + +### IdentitySessionCheckOptions + +```json +{ + "Identity": { + "Session": { + "Check": { + "KeepAccessTimeSpan": "00:01:00", // Access retention duration (cache session refresh interval), default: 1 minute + "SessionSyncTimeSpan": "00:10:00" // Session sync interval (sync from cache to persistence), default: 10 minutes + } + } + } +} +``` + +## More Information + +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.md index 23afda358..814403b96 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.md +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.md @@ -3,6 +3,13 @@ 用户会话基础模块,提供相关的通用接口 +## 功能特性 + +* 提供用户会话管理的基础接口 +* 提供会话缓存与持久化同步机制 +* 支持会话访问时间追踪 +* 依赖AbpCachingModule模块 + ## 配置使用 ```csharp @@ -19,3 +26,24 @@ public class YouProjectModule : AbpModule } } ``` + +## 配置项 + +### IdentitySessionCheckOptions + +```json +{ + "Identity": { + "Session": { + "Check": { + "KeepAccessTimeSpan": "00:01:00", // 保持访问时长(刷新缓存会话间隔),默认:1分钟 + "SessionSyncTimeSpan": "00:10:00" // 会话同步间隔(从缓存同步到持久化),默认:10分钟 + } + } + } +} +``` + +## 更多信息 + +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Identity) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/README.EN.md new file mode 100644 index 000000000..d27af794a --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/README.EN.md @@ -0,0 +1,79 @@ +# LINGYUN.Abp.IdentityServer.Application.Contracts + +IdentityServer application service contracts module, defining application service interfaces and DTOs for IdentityServer4 resource management functionality. + +## Features + +* Permission Definitions + * Client Permissions + * Default Permission - `AbpIdentityServer.Clients` + * Create Permission - `AbpIdentityServer.Clients.Create` + * Update Permission - `AbpIdentityServer.Clients.Update` + * Delete Permission - `AbpIdentityServer.Clients.Delete` + * Clone Permission - `AbpIdentityServer.Clients.Clone` + * Manage Permissions - `AbpIdentityServer.Clients.ManagePermissions` + * Manage Claims - `AbpIdentityServer.Clients.ManageClaims` + * Manage Secrets - `AbpIdentityServer.Clients.ManageSecrets` + * Manage Properties - `AbpIdentityServer.Clients.ManageProperties` + + * API Resource Permissions + * Default Permission - `AbpIdentityServer.ApiResources` + * Create Permission - `AbpIdentityServer.ApiResources.Create` + * Update Permission - `AbpIdentityServer.ApiResources.Update` + * Delete Permission - `AbpIdentityServer.ApiResources.Delete` + * Manage Claims - `AbpIdentityServer.ApiResources.ManageClaims` + * Manage Secrets - `AbpIdentityServer.ApiResources.ManageSecrets` + * Manage Scopes - `AbpIdentityServer.ApiResources.ManageScopes` + * Manage Properties - `AbpIdentityServer.ApiResources.ManageProperties` + + * API Scope Permissions + * Default Permission - `AbpIdentityServer.ApiScopes` + * Create Permission - `AbpIdentityServer.ApiScopes.Create` + * Update Permission - `AbpIdentityServer.ApiScopes.Update` + * Delete Permission - `AbpIdentityServer.ApiScopes.Delete` + * Manage Claims - `AbpIdentityServer.ApiScopes.ManageClaims` + * Manage Properties - `AbpIdentityServer.ApiScopes.ManageProperties` + + * Identity Resource Permissions + * Default Permission - `AbpIdentityServer.IdentityResources` + * Create Permission - `AbpIdentityServer.IdentityResources.Create` + * Update Permission - `AbpIdentityServer.IdentityResources.Update` + * Delete Permission - `AbpIdentityServer.IdentityResources.Delete` + * Manage Claims - `AbpIdentityServer.IdentityResources.ManageClaims` + * Manage Properties - `AbpIdentityServer.IdentityResources.ManageProperties` + + * Grant Permissions + * Default Permission - `AbpIdentityServer.Grants` + * Delete Permission - `AbpIdentityServer.Grants.Delete` + +* Localization Resources + * Support for multi-language localization + * Built-in Chinese and English resources + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityServerApplicationContractsModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Required Modules + +* `AbpAuthorizationModule` - ABP Authorization Module +* `AbpDddApplicationContractsModule` - ABP DDD Application Contracts Module +* `AbpIdentityServerDomainSharedModule` - IdentityServer Domain Shared Module + +## Configuration and Usage + +The module provides application service interface definitions and data transfer objects required for IdentityServer4 resource management. All permissions are by default only available to the host tenant. + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP Authorization Documentation](https://docs.abp.io/en/abp/latest/Authorization) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/README.md new file mode 100644 index 000000000..32b633125 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/README.md @@ -0,0 +1,79 @@ +# LINGYUN.Abp.IdentityServer.Application.Contracts + +IdentityServer应用服务契约模块,定义IdentityServer4资源管理相关功能的应用服务接口和DTO。 + +## 功能特性 + +* 权限定义 + * 客户端权限 + * 默认权限 - `AbpIdentityServer.Clients` + * 创建权限 - `AbpIdentityServer.Clients.Create` + * 更新权限 - `AbpIdentityServer.Clients.Update` + * 删除权限 - `AbpIdentityServer.Clients.Delete` + * 克隆权限 - `AbpIdentityServer.Clients.Clone` + * 管理权限 - `AbpIdentityServer.Clients.ManagePermissions` + * 管理声明 - `AbpIdentityServer.Clients.ManageClaims` + * 管理密钥 - `AbpIdentityServer.Clients.ManageSecrets` + * 管理属性 - `AbpIdentityServer.Clients.ManageProperties` + + * API资源权限 + * 默认权限 - `AbpIdentityServer.ApiResources` + * 创建权限 - `AbpIdentityServer.ApiResources.Create` + * 更新权限 - `AbpIdentityServer.ApiResources.Update` + * 删除权限 - `AbpIdentityServer.ApiResources.Delete` + * 管理声明 - `AbpIdentityServer.ApiResources.ManageClaims` + * 管理密钥 - `AbpIdentityServer.ApiResources.ManageSecrets` + * 管理作用域 - `AbpIdentityServer.ApiResources.ManageScopes` + * 管理属性 - `AbpIdentityServer.ApiResources.ManageProperties` + + * API作用域权限 + * 默认权限 - `AbpIdentityServer.ApiScopes` + * 创建权限 - `AbpIdentityServer.ApiScopes.Create` + * 更新权限 - `AbpIdentityServer.ApiScopes.Update` + * 删除权限 - `AbpIdentityServer.ApiScopes.Delete` + * 管理声明 - `AbpIdentityServer.ApiScopes.ManageClaims` + * 管理属性 - `AbpIdentityServer.ApiScopes.ManageProperties` + + * 身份资源权限 + * 默认权限 - `AbpIdentityServer.IdentityResources` + * 创建权限 - `AbpIdentityServer.IdentityResources.Create` + * 更新权限 - `AbpIdentityServer.IdentityResources.Update` + * 删除权限 - `AbpIdentityServer.IdentityResources.Delete` + * 管理声明 - `AbpIdentityServer.IdentityResources.ManageClaims` + * 管理属性 - `AbpIdentityServer.IdentityResources.ManageProperties` + + * 授权许可权限 + * 默认权限 - `AbpIdentityServer.Grants` + * 删除权限 - `AbpIdentityServer.Grants.Delete` + +* 本地化资源 + * 支持多语言本地化 + * 内置中英文资源 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerApplicationContractsModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `AbpAuthorizationModule` - ABP授权模块 +* `AbpDddApplicationContractsModule` - ABP DDD应用服务契约模块 +* `AbpIdentityServerDomainSharedModule` - IdentityServer领域共享模块 + +## 配置使用 + +模块提供了IdentityServer4资源管理所需的应用服务接口定义和数据传输对象。所有权限默认只对宿主租户开放。 + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP授权文档](https://docs.abp.io/en/abp/latest/Authorization) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/README.EN.md new file mode 100644 index 000000000..409eb2486 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/README.EN.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.IdentityServer.Application + +IdentityServer application service module, providing application layer implementation for IdentityServer4 resource management functionality. + +## Features + +* Client Management Services + * Client Secret Management + * Client Scope Management + * Client Grant Type Management + * Client CORS Origin Management + * Client Redirect URI Management + * Client Post-Logout Redirect URI Management + * Client Identity Provider Restriction Management + * Client Claim Management + * Client Property Management + +* API Resource Management Services + * API Resource Property Management + * API Resource Secret Management + * API Resource Scope Management + * API Resource Claim Management + +* API Scope Management Services + * API Scope Claim Management + * API Scope Property Management + +* Identity Resource Management Services + * Identity Resource Claim Management + * Identity Resource Property Management + +* Persisted Grant Management Services + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityServerApplicationModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Required Modules + +* `AbpIdentityServerApplicationContractsModule` - IdentityServer Application Contracts Module +* `AbpIdentityServerDomainModule` - IdentityServer Domain Module +* `AbpDddApplicationModule` - ABP DDD Application Base Module +* `AbpAutoMapperModule` - ABP AutoMapper Object Mapping Module + +## Configuration and Usage + +The module implements CRUD operations for IdentityServer4 resources, primarily used for managing IdentityServer4 configuration resources. + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP Authorization Documentation](https://docs.abp.io/en/abp/latest/Authorization) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/README.md new file mode 100644 index 000000000..bd18a03e9 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/README.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.IdentityServer.Application + +IdentityServer应用服务模块,提供IdentityServer4资源管理相关功能的应用层实现。 + +## 功能特性 + +* 客户端管理服务 + * 客户端密钥管理 + * 客户端作用域管理 + * 客户端授权类型管理 + * 客户端跨域来源管理 + * 客户端重定向URI管理 + * 客户端登出重定向URI管理 + * 客户端身份提供程序限制管理 + * 客户端声明管理 + * 客户端属性管理 + +* API资源管理服务 + * API资源属性管理 + * API资源密钥管理 + * API资源作用域管理 + * API资源声明管理 + +* API作用域管理服务 + * API作用域声明管理 + * API作用域属性管理 + +* 身份资源管理服务 + * 身份资源声明管理 + * 身份资源属性管理 + +* 持久授权管理服务 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerApplicationModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `AbpIdentityServerApplicationContractsModule` - IdentityServer应用服务契约模块 +* `AbpIdentityServerDomainModule` - IdentityServer领域模块 +* `AbpDddApplicationModule` - ABP DDD应用服务基础模块 +* `AbpAutoMapperModule` - ABP AutoMapper对象映射模块 + +## 配置使用 + +模块实现了IdentityServer4资源的CRUD操作,主要用于管理IdentityServer4的配置资源。 + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP授权文档](https://docs.abp.io/en/abp/latest/Authorization) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/README.EN.md new file mode 100644 index 000000000..e8d273956 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/README.EN.md @@ -0,0 +1,69 @@ +# LINGYUN.Abp.IdentityServer.Domain + +IdentityServer domain module, extending the domain layer functionality of IdentityServer4. + +## Features + +* Event Service Extensions + * Custom Event Service Implementation - `AbpEventService` + * Configurable Event Handlers - `IAbpIdentityServerEventServiceHandler` + * Default Event Handler - `AbpIdentityServerEventServiceHandler` + * Support for Failure Event Logging + * Support for Information Event Logging + * Support for Success Event Logging + * Support for Error Event Logging + * Event Handler Registration Mechanism + * Configure Event Handlers through `AbpIdentityServerEventOptions` + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityServerDomainModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Required Modules + +* `Volo.Abp.IdentityServer.AbpIdentityServerDomainModule` - ABP IdentityServer Domain Module + +## Configuration and Usage + +### Event Handler Configuration + +```csharp +Configure(options => +{ + // Add custom event handler + options.EventServiceHandlers.Add(); +}); +``` + +### Event Handler Implementation + +```csharp +public class YourEventServiceHandler : IAbpIdentityServerEventServiceHandler +{ + public virtual bool CanRaiseEventType(EventTypes evtType) + { + // Implement event type validation logic + return true; + } + + public virtual Task RaiseAsync(Event evt) + { + // Implement event handling logic + return Task.CompletedTask; + } +} +``` + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP IdentityServer Documentation](https://docs.abp.io/en/abp/latest/Modules/IdentityServer) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/README.md new file mode 100644 index 000000000..cb3c7f0d1 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/README.md @@ -0,0 +1,69 @@ +# LINGYUN.Abp.IdentityServer.Domain + +IdentityServer领域模块,扩展IdentityServer4的领域层功能。 + +## 功能特性 + +* 事件服务扩展 + * 自定义事件服务实现 - `AbpEventService` + * 可配置的事件处理程序 - `IAbpIdentityServerEventServiceHandler` + * 默认事件处理程序 - `AbpIdentityServerEventServiceHandler` + * 支持失败事件记录 + * 支持信息事件记录 + * 支持成功事件记录 + * 支持错误事件记录 + * 事件处理程序注册机制 + * 通过`AbpIdentityServerEventOptions`配置事件处理程序 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerDomainModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `Volo.Abp.IdentityServer.AbpIdentityServerDomainModule` - ABP IdentityServer领域模块 + +## 配置使用 + +### 事件处理程序配置 + +```csharp +Configure(options => +{ + // 添加自定义事件处理程序 + options.EventServiceHandlers.Add(); +}); +``` + +### 事件处理程序实现 + +```csharp +public class YourEventServiceHandler : IAbpIdentityServerEventServiceHandler +{ + public virtual bool CanRaiseEventType(EventTypes evtType) + { + // 实现事件类型判断逻辑 + return true; + } + + public virtual Task RaiseAsync(Event evt) + { + // 实现事件处理逻辑 + return Task.CompletedTask; + } +} +``` + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP IdentityServer文档](https://docs.abp.io/en/abp/latest/Modules/IdentityServer) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..1ceed889c --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/README.EN.md @@ -0,0 +1,71 @@ +# LINGYUN.Abp.IdentityServer.EntityFrameworkCore + +IdentityServer EntityFrameworkCore module, providing Entity Framework Core implementation for IdentityServer4. + +## Features + +* Repository Implementations + * API Resource Repository - `EfCoreApiResourceRepository` + * Get API Resource Names List + * Inherits from ABP Framework's API Resource Repository Base Class + + * Identity Resource Repository - `EfCoreIdentityResourceRepository` + * Inherits from ABP Framework's Identity Resource Repository Base Class + + * Persistent Grant Repository - `EfCorePersistentGrantRepository` + * Inherits from ABP Framework's Persistent Grant Repository Base Class + +* Database Context + * Uses ABP Framework's `IIdentityServerDbContext` + * Supports Multi-tenant Data Isolation + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityServerEntityFrameworkCoreModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Required Modules + +* `LINGYUN.Abp.IdentityServer.AbpIdentityServerDomainModule` - IdentityServer Domain Module +* `Volo.Abp.IdentityServer.EntityFrameworkCore.AbpIdentityServerEntityFrameworkCoreModule` - ABP IdentityServer EntityFrameworkCore Module + +## Configuration and Usage + +### Configure Database Context + +```csharp +public class YourDbContext : AbpDbContext, IIdentityServerDbContext +{ + public DbSet ApiResources { get; set; } + public DbSet ApiScopes { get; set; } + public DbSet IdentityResources { get; set; } + public DbSet Clients { get; set; } + public DbSet PersistedGrants { get; set; } + public DbSet DeviceFlowCodes { get; set; } + + public YourDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureIdentityServer(); + } +} +``` + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP EntityFrameworkCore Documentation](https://docs.abp.io/en/abp/latest/Entity-Framework-Core) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/README.md new file mode 100644 index 000000000..fa2ac0600 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/README.md @@ -0,0 +1,71 @@ +# LINGYUN.Abp.IdentityServer.EntityFrameworkCore + +IdentityServer EntityFrameworkCore模块,提供IdentityServer4的Entity Framework Core实现。 + +## 功能特性 + +* 仓储实现 + * API资源仓储 - `EfCoreApiResourceRepository` + * 获取API资源名称列表 + * 继承自ABP框架的API资源仓储基类 + + * 身份资源仓储 - `EfCoreIdentityResourceRepository` + * 继承自ABP框架的身份资源仓储基类 + + * 持久授权仓储 - `EfCorePersistentGrantRepository` + * 继承自ABP框架的持久授权仓储基类 + +* 数据库上下文 + * 使用ABP框架的`IIdentityServerDbContext` + * 支持多租户数据隔离 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerEntityFrameworkCoreModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `LINGYUN.Abp.IdentityServer.AbpIdentityServerDomainModule` - IdentityServer领域模块 +* `Volo.Abp.IdentityServer.EntityFrameworkCore.AbpIdentityServerEntityFrameworkCoreModule` - ABP IdentityServer EntityFrameworkCore模块 + +## 配置使用 + +### 配置数据库上下文 + +```csharp +public class YourDbContext : AbpDbContext, IIdentityServerDbContext +{ + public DbSet ApiResources { get; set; } + public DbSet ApiScopes { get; set; } + public DbSet IdentityResources { get; set; } + public DbSet Clients { get; set; } + public DbSet PersistedGrants { get; set; } + public DbSet DeviceFlowCodes { get; set; } + + public YourDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureIdentityServer(); + } +} +``` + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP EntityFrameworkCore文档](https://docs.abp.io/en/abp/latest/Entity-Framework-Core) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/README.EN.md new file mode 100644 index 000000000..5037f6665 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/README.EN.md @@ -0,0 +1,69 @@ +# LINGYUN.Abp.IdentityServer.HttpApi + +IdentityServer HTTP API module, providing HTTP API interfaces for IdentityServer4 resource management. + +## Features + +* API Controllers + * API Scope Controller - `ApiScopeController` + * Create API Scope - POST `/api/identity-server/api-scopes` + * Delete API Scope - DELETE `/api/identity-server/api-scopes/{id}` + * Get API Scope - GET `/api/identity-server/api-scopes/{id}` + * Get API Scope List - GET `/api/identity-server/api-scopes` + * Update API Scope - PUT `/api/identity-server/api-scopes/{id}` + + * API Resource Controller - `ApiResourceController` + * Provides CRUD operation interfaces for API resources + * Route prefix: `/api/identity-server/api-resources` + +* Localization Support + * Inherits ABP UI resource localization configuration + * Supports multiple languages + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityServerHttpApiModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Required Modules + +* `AbpIdentityServerApplicationContractsModule` - IdentityServer Application Contracts Module +* `AbpAspNetCoreMvcModule` - ABP ASP.NET Core MVC Module + +## Configuration and Usage + +### Configure Remote Service Name + +```csharp +[RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] +[Area("identity-server")] +[Route("api/identity-server/[controller]")] +public class YourController : AbpControllerBase +{ + // ... +} +``` + +### Add Localization Resource + +```csharp +Configure(options => +{ + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); +}); +``` + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP ASP.NET Core MVC Documentation](https://docs.abp.io/en/abp/latest/AspNetCore-MVC) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/README.md new file mode 100644 index 000000000..4be6e73b0 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/README.md @@ -0,0 +1,69 @@ +# LINGYUN.Abp.IdentityServer.HttpApi + +IdentityServer HTTP API模块,提供IdentityServer4资源管理的HTTP API接口。 + +## 功能特性 + +* API控制器 + * API作用域控制器 - `ApiScopeController` + * 创建API作用域 - POST `/api/identity-server/api-scopes` + * 删除API作用域 - DELETE `/api/identity-server/api-scopes/{id}` + * 获取API作用域 - GET `/api/identity-server/api-scopes/{id}` + * 获取API作用域列表 - GET `/api/identity-server/api-scopes` + * 更新API作用域 - PUT `/api/identity-server/api-scopes/{id}` + + * API资源控制器 - `ApiResourceController` + * 提供API资源的CRUD操作接口 + * 路由前缀:`/api/identity-server/api-resources` + +* 本地化支持 + * 继承ABP UI资源的本地化配置 + * 支持多语言 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerHttpApiModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `AbpIdentityServerApplicationContractsModule` - IdentityServer应用服务契约模块 +* `AbpAspNetCoreMvcModule` - ABP ASP.NET Core MVC模块 + +## 配置使用 + +### 配置远程服务名称 + +```csharp +[RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] +[Area("identity-server")] +[Route("api/identity-server/[controller]")] +public class YourController : AbpControllerBase +{ + // ... +} +``` + +### 添加本地化资源 + +```csharp +Configure(options => +{ + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); +}); +``` + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP ASP.NET Core MVC文档](https://docs.abp.io/en/abp/latest/AspNetCore-MVC) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/README.EN.md new file mode 100644 index 000000000..11dd48657 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/README.EN.md @@ -0,0 +1,75 @@ +# LINGYUN.Abp.IdentityServer.LinkUser + +IdentityServer user linking module, providing support for user linking extension grant type. + +## Features + +* Extension Grant Validator + * `LinkUserGrantValidator` - User Linking Grant Validator + * Grant Type: `link_user` + * Supports access token validation + * Supports user linking relationship validation + * Supports multi-tenant scenarios + * Supports custom claims extension + +* Localization Support + * Built-in Chinese and English resources + * Support for extending other languages + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpIdentityServerLinkUserModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Required Modules + +* `AbpIdentityServerDomainModule` - ABP IdentityServer Domain Module + +## Configuration and Usage + +### Authorization Request Parameters + +* `grant_type` - Must be `link_user` +* `access_token` - Current user's access token +* `LinkUserId` - Target user ID to link +* `LinkTenantId` - Target user's tenant ID (optional) + +### Authorization Request Example + +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=link_user& +access_token=current_user_access_token& +LinkUserId=target_user_id& +LinkTenantId=target_tenant_id +``` + +### Custom Claims Extension + +```csharp +public class CustomLinkUserGrantValidator : LinkUserGrantValidator +{ + protected override Task AddCustomClaimsAsync(List customClaims, IdentityUser user, ExtensionGrantValidationContext context) + { + // Add custom claims + customClaims.Add(new Claim("custom_claim", "custom_value")); + + return base.AddCustomClaimsAsync(customClaims, user, context); + } +} +``` + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP Authentication Documentation](https://docs.abp.io/en/abp/latest/Authentication) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/README.md new file mode 100644 index 000000000..0d087b6e5 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/README.md @@ -0,0 +1,75 @@ +# LINGYUN.Abp.IdentityServer.LinkUser + +IdentityServer用户关联模块,提供用户关联的扩展授权类型支持。 + +## 功能特性 + +* 扩展授权验证器 + * `LinkUserGrantValidator` - 用户关联授权验证器 + * 授权类型:`link_user` + * 支持验证访问令牌 + * 支持验证用户关联关系 + * 支持多租户场景 + * 支持自定义声明扩展 + +* 本地化支持 + * 内置中英文资源 + * 支持扩展其他语言 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerLinkUserModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `AbpIdentityServerDomainModule` - ABP IdentityServer领域模块 + +## 配置使用 + +### 授权请求参数 + +* `grant_type` - 必须为 `link_user` +* `access_token` - 当前用户的访问令牌 +* `LinkUserId` - 要关联的用户ID +* `LinkTenantId` - 要关联的用户所属租户ID(可选) + +### 授权请求示例 + +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=link_user& +access_token=current_user_access_token& +LinkUserId=target_user_id& +LinkTenantId=target_tenant_id +``` + +### 自定义声明扩展 + +```csharp +public class CustomLinkUserGrantValidator : LinkUserGrantValidator +{ + protected override Task AddCustomClaimsAsync(List customClaims, IdentityUser user, ExtensionGrantValidationContext context) + { + // 添加自定义声明 + customClaims.Add(new Claim("custom_claim", "custom_value")); + + return base.AddCustomClaimsAsync(customClaims, user, context); + } +} +``` + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP身份认证文档](https://docs.abp.io/en/abp/latest/Authentication) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/README.EN.md new file mode 100644 index 000000000..945847c83 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/README.EN.md @@ -0,0 +1,94 @@ +# LINGYUN.Abp.IdentityServer.Portal + +IdentityServer portal authentication module that provides enterprise portal authentication functionality. + +## Features + +* Portal Authentication + * `PortalGrantValidator` - Portal Grant Validator + * Supports enterprise portal login + * Supports multi-tenant authentication + * Automatic tenant switching + * Enterprise information validation + * User password validation + * Security log recording + +* Authentication Flow + 1. User initiates login request using portal + 2. Check if enterprise identifier (EnterpriseId) is provided + * Without EnterpriseId: Returns list of enterprises with tenant information + * With EnterpriseId: Retrieves associated tenant information and switches to specified tenant + 3. Performs login validation using password method + 4. Returns token upon successful login + +## Module Reference + +```csharp +[DependsOn( + typeof(AbpIdentityServerPortalModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Dependencies + +* `AbpIdentityServerDomainModule` - ABP IdentityServer Domain Module +* `AbpAspNetCoreMultiTenancyModule` - ABP Multi-tenancy Module +* `PlatformDomainModule` - Platform Domain Module + +## Configuration and Usage + +### Configure Portal Authentication + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + builder.AddExtensionGrantValidator(); + }); +} +``` + +### Authentication Request Parameters + +* `grant_type`: "portal" (required) +* `enterpriseId`: Enterprise identifier (optional) +* `username`: Username (required) +* `password`: Password (required) +* `scope`: Request scope (optional) + +### Authentication Response + +* When enterpriseId is not provided: +```json +{ + "error": "invalid_grant", + "enterprises": [ + { + "id": "enterprise_id", + "name": "enterprise_name", + "code": "enterprise_code" + } + ] +} +``` + +* On successful authentication: +```json +{ + "access_token": "access_token", + "expires_in": expiration_time, + "token_type": "Bearer", + "refresh_token": "refresh_token" +} +``` + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP Multi-tenancy Documentation](https://docs.abp.io/en/abp/latest/Multi-Tenancy) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/README.md new file mode 100644 index 000000000..93cc44d64 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/README.md @@ -0,0 +1,94 @@ +# LINGYUN.Abp.IdentityServer.Portal + +IdentityServer门户认证模块,提供企业门户的认证功能。 + +## 功能特性 + +* 门户认证 + * `PortalGrantValidator` - 门户授权验证器 + * 支持企业门户登录 + * 支持多租户认证 + * 自动切换租户 + * 企业信息验证 + * 用户密码验证 + * 安全日志记录 + +* 认证流程 + 1. 用户使用portal发起登录请求 + 2. 检查是否携带企业标识字段(EnterpriseId) + * 未携带EnterpriseId: 返回关联了租户信息的企业列表 + * 携带EnterpriseId: 检索关联租户信息并切换到指定租户 + 3. 使用password方式进行登录验证 + 4. 登录成功返回token + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerPortalModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `AbpIdentityServerDomainModule` - ABP IdentityServer领域模块 +* `AbpAspNetCoreMultiTenancyModule` - ABP多租户模块 +* `PlatformDomainModule` - 平台领域模块 + +## 配置使用 + +### 配置门户认证 + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + builder.AddExtensionGrantValidator(); + }); +} +``` + +### 认证请求参数 + +* `grant_type`: "portal" (必填) +* `enterpriseId`: 企业标识 (可选) +* `username`: 用户名 (必填) +* `password`: 密码 (必填) +* `scope`: 请求范围 (可选) + +### 认证响应 + +* 未提供enterpriseId时: +```json +{ + "error": "invalid_grant", + "enterprises": [ + { + "id": "企业标识", + "name": "企业名称", + "code": "企业编码" + } + ] +} +``` + +* 认证成功: +```json +{ + "access_token": "访问令牌", + "expires_in": 有效期, + "token_type": "Bearer", + "refresh_token": "刷新令牌" +} +``` + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP多租户文档](https://docs.abp.io/en/abp/latest/Multi-Tenancy) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.EN.md new file mode 100644 index 000000000..b8f528fb7 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.EN.md @@ -0,0 +1,77 @@ +# LINGYUN.Abp.IdentityServer.Session + +IdentityServer session management module that provides user session management and validation functionality. + +## Features + +* Session Validation + * `AbpIdentitySessionUserInfoRequestValidator` - User Info Request Validator + * Validates user session status + * Validates access token validity + * Validates user active status + * Supports OpenID Connect standard + +* Session Event Handling + * `AbpIdentitySessionEventServiceHandler` - Session Event Handler + * Handles user login success events + * Saves session information + * Supports multi-tenancy + * Records client identifier + * Handles user logout success events + * Revokes session + * Handles token revocation success events + * Revokes session + +* Configuration Options + * Session Claims Configuration + * Add SessionId claim + * Session Login Configuration + * Disable explicit session saving + * Enable explicit session logout + +## Module Reference + +```csharp +[DependsOn( + typeof(AbpIdentityServerSessionModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Dependencies + +* `AbpIdentityServerDomainModule` - ABP IdentityServer Domain Module +* `AbpIdentityDomainModule` - ABP Identity Domain Module +* `AbpIdentitySessionModule` - ABP Identity Session Module + +## Configuration and Usage + +### Configure Session Options + +```csharp +Configure(options => +{ + // UserLoginSuccessEvent is published by IdentityServer, no need for explicit session saving + options.SignInSessionEnabled = false; + // UserLoginSuccessEvent is published by user, requires explicit session logout + options.SignOutSessionEnabled = true; +}); +``` + +### Configure Claims Options + +```csharp +Configure(options => +{ + options.RequestedClaims.Add(AbpClaimTypes.SessionId); +}); +``` + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Modules/Identity) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.md index d03497843..15eef870c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.md +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.md @@ -1,17 +1,77 @@ # LINGYUN.Abp.IdentityServer.Session -IdentityServer集成模块用户会话扩展,通过IdentityServer暴露的事件接口处理用户会话 +IdentityServer会话管理模块,提供用户会话管理和验证功能。 -## 参考实现 +## 功能特性 -* [Session Management](https://github.com/abpio/abp-commercial-docs/blob/dev/en/modules/identity/session-management.md#identitysessioncleanupoptions) +* 会话验证 + * `AbpIdentitySessionUserInfoRequestValidator` - 用户信息请求验证器 + * 验证用户会话状态 + * 验证访问令牌有效性 + * 验证用户活动状态 + * 支持OpenID Connect标准 -## 配置使用 +* 会话事件处理 + * `AbpIdentitySessionEventServiceHandler` - 会话事件处理器 + * 处理用户登录成功事件 + * 保存会话信息 + * 支持多租户 + * 记录客户端标识 + * 处理用户登出成功事件 + * 撤销会话 + * 处理令牌撤销成功事件 + * 撤销会话 + +* 配置选项 + * 会话声明配置 + * 添加SessionId声明 + * 会话登录配置 + * 禁用显式保存会话 + * 启用显式注销会话 + +## 模块引用 ```csharp -[DependsOn(typeof(AbpIdentityServerSessionModule))] -public class YouProjectModule : AbpModule +[DependsOn( + typeof(AbpIdentityServerSessionModule) +)] +public class YourModule : AbpModule { - // other + // ... } ``` + +## 依赖模块 + +* `AbpIdentityServerDomainModule` - ABP IdentityServer领域模块 +* `AbpIdentityDomainModule` - ABP Identity领域模块 +* `AbpIdentitySessionModule` - ABP Identity会话模块 + +## 配置使用 + +### 配置会话选项 + +```csharp +Configure(options => +{ + // UserLoginSuccessEvent由IdentityServer发布, 无需显式保存会话 + options.SignInSessionEnabled = false; + // UserLoginSuccessEvent由用户发布, 需要显式注销会话 + options.SignOutSessionEnabled = true; +}); +``` + +### 配置声明选项 + +```csharp +Configure(options => +{ + options.RequestedClaims.Add(AbpClaimTypes.SessionId); +}); +``` + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP Identity文档](https://docs.abp.io/en/abp/latest/Modules/Identity) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/README.EN.md new file mode 100644 index 000000000..d2ffed85b --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/README.EN.md @@ -0,0 +1,92 @@ +# LINGYUN.Abp.IdentityServer.SmsValidator + +IdentityServer SMS verification module that provides authentication functionality based on phone numbers and SMS verification codes. + +## Features + +* SMS Verification + * `SmsTokenGrantValidator` - SMS Token Grant Validator + * Phone number validation + * SMS verification code validation + * Brute force protection + * User lockout check + * Security log recording + * Event notifications + +* Authentication Flow + 1. User initiates login request with phone number and SMS verification code + 2. Validates phone number and verification code + 3. Checks user status (whether locked) + 4. Generates access token upon successful validation + 5. Records security logs and events + +## Module Reference + +```csharp +[DependsOn( + typeof(AbpIdentityServerSmsValidatorModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Dependencies + +* `AbpIdentityServerDomainModule` - ABP IdentityServer Domain Module + +## Configuration and Usage + +### Configure SMS Validation + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + builder.AddExtensionGrantValidator(); + }); +} +``` + +### Authentication Request Parameters + +* `grant_type`: "phone_verify" (required) +* `phone_number`: Phone number (required) +* `phone_verify_code`: SMS verification code (required) +* `scope`: Request scope (optional) + +### Authentication Response + +* On successful authentication: +```json +{ + "access_token": "access_token", + "expires_in": expiration_time, + "token_type": "Bearer", + "refresh_token": "refresh_token" +} +``` + +* On authentication failure: +```json +{ + "error": "invalid_grant", + "error_description": "error description" +} +``` + +### Error Types + +* `invalid_grant`: Grant validation failed + * Phone number not registered + * Invalid verification code + * User locked out + * Missing parameters + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [ABP Identity Documentation](https://docs.abp.io/en/abp/latest/Modules/Identity) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/README.md new file mode 100644 index 000000000..e8c684b9b --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/README.md @@ -0,0 +1,92 @@ +# LINGYUN.Abp.IdentityServer.SmsValidator + +IdentityServer短信验证模块,提供基于手机号和短信验证码的身份认证功能。 + +## 功能特性 + +* 短信验证 + * `SmsTokenGrantValidator` - 短信验证授权器 + * 支持手机号验证 + * 支持短信验证码验证 + * 防暴力破解保护 + * 用户锁定检查 + * 安全日志记录 + * 事件通知 + +* 认证流程 + 1. 用户使用手机号和短信验证码发起登录请求 + 2. 验证手机号和验证码的有效性 + 3. 验证用户状态(是否被锁定) + 4. 验证通过后生成访问令牌 + 5. 记录安全日志和事件 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerSmsValidatorModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `AbpIdentityServerDomainModule` - ABP IdentityServer领域模块 + +## 配置使用 + +### 配置短信验证 + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + builder.AddExtensionGrantValidator(); + }); +} +``` + +### 认证请求参数 + +* `grant_type`: "phone_verify" (必填) +* `phone_number`: 手机号 (必填) +* `phone_verify_code`: 短信验证码 (必填) +* `scope`: 请求范围 (可选) + +### 认证响应 + +* 认证成功: +```json +{ + "access_token": "访问令牌", + "expires_in": 有效期, + "token_type": "Bearer", + "refresh_token": "刷新令牌" +} +``` + +* 认证失败: +```json +{ + "error": "invalid_grant", + "error_description": "错误描述" +} +``` + +### 错误类型 + +* `invalid_grant`: 授权验证失败 + * 手机号未注册 + * 验证码无效 + * 用户被锁定 + * 参数缺失 + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [ABP Identity文档](https://docs.abp.io/en/abp/latest/Modules/Identity) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/README.EN.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/README.EN.md new file mode 100644 index 000000000..a1c052b36 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/README.EN.md @@ -0,0 +1,106 @@ +# LINGYUN.Abp.IdentityServer.WeChat.Work + +IdentityServer WeChat Work authentication module that provides identity authentication functionality based on WeChat Work. + +## Features + +* WeChat Work Authentication + * `WeChatWorkGrantValidator` - WeChat Work Grant Validator + * WeChat Work login support + * Multi-tenant support + * Automatic user registration + * Security log recording + * Event notifications + * Localization support + +* Authentication Flow + 1. User initiates login request through WeChat Work + 2. Validates AgentId and Code + 3. Retrieves WeChat Work user information + 4. Verifies user registration status + * Direct login for registered users + * Automatic registration based on configuration for unregistered users + 5. Generates access token + 6. Records security logs and events + +## Module Reference + +```csharp +[DependsOn( + typeof(AbpIdentityServerWeChatWorkModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## Dependencies + +* `AbpIdentityServerDomainModule` - ABP IdentityServer Domain Module +* `AbpWeChatWorkModule` - ABP WeChat Work Module + +## Configuration and Usage + +### Configure WeChat Work Authentication + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + builder.AddExtensionGrantValidator(); + }); +} +``` + +### Authentication Request Parameters + +* `grant_type`: "wechat_work" (required) +* `agent_id`: WeChat Work application ID (required) +* `code`: WeChat Work authorization code (required) +* `scope`: Request scope (optional) + +### Authentication Response + +* On successful authentication: +```json +{ + "access_token": "access_token", + "expires_in": expiration_time, + "token_type": "Bearer", + "refresh_token": "refresh_token" +} +``` + +* On authentication failure: +```json +{ + "error": "invalid_grant", + "error_description": "error description" +} +``` + +### Configuration Options + +* Quick Login +```csharp +Configure(options => +{ + // Enable quick login for unregistered users + options.SetDefault(WeChatWorkSettingNames.EnabledQuickLogin, true); +}); +``` + +### Error Types + +* `invalid_grant`: Grant validation failed + * Invalid AgentId or Code + * User not registered and quick login not enabled + * WeChat Work API call failed + +Related Documentation: +* [IdentityServer4 Documentation](https://identityserver4.readthedocs.io/) +* [WeChat Work API Documentation](https://work.weixin.qq.com/api/doc) + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/README.md index 67be60641..07f034066 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/README.md +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/README.md @@ -1,25 +1,106 @@ # LINGYUN.Abp.IdentityServer.WeChat.Work -企业微信扩展登录集成 +IdentityServer企业微信认证模块,提供基于企业微信的身份认证功能。 +## 功能特性 + +* 企业微信认证 + * `WeChatWorkGrantValidator` - 企业微信授权验证器 + * 支持企业微信登录 + * 支持多租户 + * 自动用户注册 + * 安全日志记录 + * 事件通知 + * 本地化支持 + +* 认证流程 + 1. 用户通过企业微信发起登录请求 + 2. 验证AgentId和Code的有效性 + 3. 获取企业微信用户信息 + 4. 验证用户注册状态 + * 已注册用户直接登录 + * 未注册用户根据配置自动注册 + 5. 生成访问令牌 + 6. 记录安全日志和事件 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpIdentityServerWeChatWorkModule) +)] +public class YourModule : AbpModule +{ + // ... +} +``` + +## 依赖模块 + +* `AbpIdentityServerDomainModule` - ABP IdentityServer领域模块 +* `AbpWeChatWorkModule` - ABP企业微信模块 ## 配置使用 +### 配置企业微信认证 + ```csharp -[DependsOn(typeof(AbpIdentityServerWeChatWorkModule))] -public class YouProjectModule : AbpModule +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + builder.AddExtensionGrantValidator(); + }); +} +``` + +### 认证请求参数 + +* `grant_type`: "wechat_work" (必填) +* `agent_id`: 企业微信应用ID (必填) +* `code`: 企业微信授权码 (必填) +* `scope`: 请求范围 (可选) + +### 认证响应 + +* 认证成功: +```json +{ + "access_token": "访问令牌", + "expires_in": 有效期, + "token_type": "Bearer", + "refresh_token": "刷新令牌" +} +``` + +* 认证失败: +```json { - // other + "error": "invalid_grant", + "error_description": "错误描述" } ``` -```shell +### 配置选项 -curl -X POST "http://127.0.0.1:44385/connect/token" \ ---header 'Content-Type: application/x-www-form-urlencoded' \ ---data-urlencode 'grant_type=wx-work' \ ---data-urlencode 'client_id=你的客户端标识' \ ---data-urlencode 'client_secret=你的客户端密钥' \ ---data-urlencode 'agent_id=你的企业微信应用标识' \ ---data-urlencode 'code=用户扫描登录二维码后重定向页面携带的code标识, 换取用户信息的关键' \ +* 快速登录 +```csharp +Configure(options => +{ + // 启用未注册用户快速登录 + options.SetDefault(WeChatWorkSettingNames.EnabledQuickLogin, true); +}); ``` + +### 错误类型 + +* `invalid_grant`: 授权验证失败 + * AgentId或Code无效 + * 用户未注册且未启用快速登录 + * 企业微信API调用失败 + +相关文档: +* [IdentityServer4文档](https://identityserver4.readthedocs.io/) +* [企业微信开发文档](https://work.weixin.qq.com/api/doc) + +[查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..cdb780aec --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.LocalizationManagement.Application.Contracts + +The application service layer contract module for localization management, defining application service interfaces, DTO objects, and permission definitions. + +## Features + +* Defines language management application service interfaces +* Defines resource management application service interfaces +* Defines text management application service interfaces +* Defines permissions and authorization +* Provides DTO object definitions + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpLocalizationManagementApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Permission Definitions + +* LocalizationManagement.Resource - Authorizes access to resources +* LocalizationManagement.Resource.Create - Authorizes resource creation +* LocalizationManagement.Resource.Update - Authorizes resource modification +* LocalizationManagement.Resource.Delete - Authorizes resource deletion +* LocalizationManagement.Language - Authorizes access to languages +* LocalizationManagement.Language.Create - Authorizes language creation +* LocalizationManagement.Language.Update - Authorizes language modification +* LocalizationManagement.Language.Delete - Authorizes language deletion +* LocalizationManagement.Text - Authorizes access to texts +* LocalizationManagement.Text.Create - Authorizes text creation +* LocalizationManagement.Text.Update - Authorizes text modification +* LocalizationManagement.Text.Delete - Authorizes text deletion + +## Application Service Interfaces + +* `ILanguageAppService`: Language management application service interface +* `IResourceAppService`: Resource management application service interface +* `ITextAppService`: Text management application service interface + +## More Information + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/README.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/README.md new file mode 100644 index 000000000..58caaa5b8 --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/README.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.LocalizationManagement.Application.Contracts + +本地化管理应用服务层契约模块,定义了本地化管理的应用服务接口、DTO对象和权限定义。 + +## 功能特性 + +* 定义语言管理应用服务接口 +* 定义资源管理应用服务接口 +* 定义文本管理应用服务接口 +* 定义权限和授权 +* 提供DTO对象定义 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpLocalizationManagementApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 权限定义 + +* LocalizationManagement.Resource - 授权对象是否允许访问资源 +* LocalizationManagement.Resource.Create - 授权对象是否允许创建资源 +* LocalizationManagement.Resource.Update - 授权对象是否允许修改资源 +* LocalizationManagement.Resource.Delete - 授权对象是否允许删除资源 +* LocalizationManagement.Language - 授权对象是否允许访问语言 +* LocalizationManagement.Language.Create - 授权对象是否允许创建语言 +* LocalizationManagement.Language.Update - 授权对象是否允许修改语言 +* LocalizationManagement.Language.Delete - 授权对象是否允许删除语言 +* LocalizationManagement.Text - 授权对象是否允许访问文档 +* LocalizationManagement.Text.Create - 授权对象是否允许创建文档 +* LocalizationManagement.Text.Update - 授权对象是否允许修改文档 +* LocalizationManagement.Text.Delete - 授权对象是否允许删除文档 + +## 应用服务接口 + +* `ILanguageAppService`: 语言管理应用服务接口 +* `IResourceAppService`: 资源管理应用服务接口 +* `ITextAppService`: 文本管理应用服务接口 + +## 更多信息 + +* [English documentation](./README.EN.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/README.EN.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/README.EN.md new file mode 100644 index 000000000..cf75b8d1a --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/README.EN.md @@ -0,0 +1,52 @@ +# LINGYUN.Abp.LocalizationManagement.Application + +The application service layer implementation module for localization management, providing application service implementations for localization resource management. + +## Features + +* Implements language management application services +* Implements resource management application services +* Implements text management application services +* Supports AutoMapper object mapping +* Provides standardized CRUD operations + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpLocalizationManagementApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Application Services + +* `LanguageAppService`: Language management application service + - Create language + - Update language + - Delete language + - Get language list + - Get language details + +* `ResourceAppService`: Resource management application service + - Create resource + - Update resource + - Delete resource + - Get resource list + - Get resource details + +* `TextAppService`: Text management application service + - Create text + - Update text + - Delete text + - Get text list + - Get text details + +## Permissions + +All application services follow the permission requirements defined by the module. See the permission definitions in the Domain.Shared module for details. + +## More Information + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/README.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/README.md new file mode 100644 index 000000000..1dc220be0 --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/README.md @@ -0,0 +1,52 @@ +# LINGYUN.Abp.LocalizationManagement.Application + +本地化管理应用服务层实现模块,提供本地化资源管理的应用服务实现。 + +## 功能特性 + +* 实现语言管理应用服务 +* 实现资源管理应用服务 +* 实现文本管理应用服务 +* 支持AutoMapper对象映射 +* 提供标准化的CRUD操作 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpLocalizationManagementApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 应用服务 + +* `LanguageAppService`: 语言管理应用服务 + - 创建语言 + - 更新语言 + - 删除语言 + - 获取语言列表 + - 获取语言详情 + +* `ResourceAppService`: 资源管理应用服务 + - 创建资源 + - 更新资源 + - 删除资源 + - 获取资源列表 + - 获取资源详情 + +* `TextAppService`: 文本管理应用服务 + - 创建文本 + - 更新文本 + - 删除文本 + - 获取文本列表 + - 获取文本详情 + +## 权限 + +所有应用服务都遵循模块定义的权限要求,详见Domain.Shared模块的权限定义。 + +## 更多信息 + +* [English documentation](./README.EN.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/README.EN.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/README.EN.md new file mode 100644 index 000000000..20b2d659e --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/README.EN.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.LocalizationManagement.Domain.Shared + +The shared domain layer module for localization management, defining error codes, localization resources, constants, and other shared content. + +## Features + +* Defines constants related to localization management +* Defines localization error codes +* Provides localization resource files +* Supports multilingual error messages + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpLocalizationManagementDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Error Codes + +* Localization:001100 - Language {CultureName} already exists +* Localization:001400 - Language name {CultureName} not found or built-in language operation not allowed +* Localization:002100 - Resource {Name} already exists +* Localization:002400 - Resource name {Name} not found or built-in resource operation not allowed + +## Localization Resources + +The module defines the following localization resources: + +* DisplayName:Enable - Enable +* DisplayName:CreationTime - Creation Time +* DisplayName:LastModificationTime - Modification Time +* DisplayName:SaveAndNext - Save & Next +* Permissions:LocalizationManagement - Localization Management +* Permissions:Language - Language Management +* Permissions:Resource - Resource Management +* Permissions:Text - Text Management +* etc... + +## More Information + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/README.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/README.md new file mode 100644 index 000000000..6b24202cb --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/README.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.LocalizationManagement.Domain.Shared + +本地化管理领域层共享模块,定义了错误代码、本地化资源、常量等共享内容。 + +## 功能特性 + +* 定义本地化管理相关的常量 +* 定义本地化错误代码 +* 提供本地化资源文件 +* 支持多语言错误消息 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpLocalizationManagementDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 错误代码 + +* Localization:001100 - 语言 {CultureName} 已经存在 +* Localization:001400 - 语言名称 {CultureName} 不存在或内置语言不允许操作 +* Localization:002100 - 资源 {Name} 已经存在 +* Localization:002400 - 资源名称 {Name} 不存在或内置资源不允许操作 + +## 本地化资源 + +模块定义了以下本地化资源: + +* DisplayName:Enable - 启用 +* DisplayName:CreationTime - 创建时间 +* DisplayName:LastModificationTime - 修改时间 +* DisplayName:SaveAndNext - 保存并下一步 +* Permissions:LocalizationManagement - 本地化管理 +* Permissions:Language - 语言管理 +* Permissions:Resource - 资源管理 +* Permissions:Text - 文档管理 +* 等... + +## 更多信息 + +* [English documentation](./README.EN.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/README.EN.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/README.EN.md new file mode 100644 index 000000000..faa86406b --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/README.EN.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.LocalizationManagement.Domain + +The domain layer module for localization management, implementing dynamic localization resource storage and management functionality. + +## Features + +* Implements `ILocalizationStore` interface for localization resource storage and retrieval +* Supports language management (CRUD operations) +* Supports resource management (CRUD operations) +* Supports text management (CRUD operations) +* Supports in-memory caching of localization resources +* Supports distributed cache synchronization + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpLocalizationManagementDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "LocalizationManagement": { + "LocalizationCacheStampTimeOut": "00:02:00", // Localization cache timestamp timeout, default 2 minutes + "LocalizationCacheStampExpiration": "00:30:00" // Localization cache expiration time, default 30 minutes + } +} +``` + +## Domain Services + +* `LanguageManager`: Language management service, providing language creation, update, deletion, etc. +* `ResourceManager`: Resource management service, providing resource creation, update, deletion, etc. +* `TextManager`: Text management service, providing text creation, update, deletion, etc. +* `LocalizationStore`: Localization storage service, implementing the `ILocalizationStore` interface +* `LocalizationStoreInMemoryCache`: In-memory cache service for localization resources + +## More Information + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/README.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/README.md new file mode 100644 index 000000000..7c9b0cd0a --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/README.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.LocalizationManagement.Domain + +本地化管理领域层模块,实现了动态本地化资源存储和管理功能。 + +## 功能特性 + +* 实现 `ILocalizationStore` 接口,提供本地化资源的存储和检索功能 +* 支持语言管理(增删改查) +* 支持资源管理(增删改查) +* 支持文本管理(增删改查) +* 支持本地化资源的内存缓存 +* 支持分布式缓存同步 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpLocalizationManagementDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "LocalizationManagement": { + "LocalizationCacheStampTimeOut": "00:02:00", // 本地化缓存时间戳超时时间,默认2分钟 + "LocalizationCacheStampExpiration": "00:30:00" // 本地化缓存过期时间,默认30分钟 + } +} +``` + +## 领域服务 + +* `LanguageManager`: 语言管理服务,提供语言的创建、更新、删除等功能 +* `ResourceManager`: 资源管理服务,提供资源的创建、更新、删除等功能 +* `TextManager`: 文本管理服务,提供文本的创建、更新、删除等功能 +* `LocalizationStore`: 本地化存储服务,实现了 `ILocalizationStore` 接口 +* `LocalizationStoreInMemoryCache`: 本地化资源内存缓存服务 + +## 更多信息 + +* [English documentation](./README.EN.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..65a06c3e8 --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/README.EN.md @@ -0,0 +1,62 @@ +# LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore + +Entity Framework Core integration implementation for the localization management module, providing data access and persistence functionality. + +## Features + +* Implements database mapping for localization management +* Supports custom table prefix and schema +* Provides EF Core implementation of repository interfaces +* Supports database operations for languages, resources, and texts + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpLocalizationManagementEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddAbpDbContext(options => + { + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + }); + + Configure(options => + { + options.UseMySQL(); // or other databases + }); +} +``` + +Database table configuration options: +```csharp +public class LocalizationModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions +{ + public LocalizationModelBuilderConfigurationOptions( + string tablePrefix = "", + string schema = null) + : base(tablePrefix, schema) + { + } +} +``` + +## Database Tables + +* Languages - Language table +* Resources - Resource table +* Texts - Text table + +## More Information + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/README.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/README.md new file mode 100644 index 000000000..adbedcac9 --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/README.md @@ -0,0 +1,62 @@ +# LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore + +本地化管理模块的Entity Framework Core集成实现,提供数据访问和持久化功能。 + +## 功能特性 + +* 实现本地化管理的数据库映射 +* 支持自定义表前缀和Schema +* 提供仓储接口的EF Core实现 +* 支持语言、资源、文本的数据库操作 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpLocalizationManagementEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + context.Services.AddAbpDbContext(options => + { + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + }); + + Configure(options => + { + options.UseMySQL(); // 或其他数据库 + }); +} +``` + +数据库表配置选项: +```csharp +public class LocalizationModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions +{ + public LocalizationModelBuilderConfigurationOptions( + string tablePrefix = "", + string schema = null) + : base(tablePrefix, schema) + { + } +} +``` + +## 数据库表 + +* Languages - 语言表 +* Resources - 资源表 +* Texts - 文本表 + +## 更多信息 + +* [English documentation](./README.EN.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/README.EN.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..90e54b7ed --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/README.EN.md @@ -0,0 +1,56 @@ +# LINGYUN.Abp.LocalizationManagement.HttpApi + +The HTTP API module for localization management, providing RESTful API interfaces. + +## Features + +* Provides HTTP API interfaces for localization management +* Supports REST operations for languages, resources, and texts +* Integrates ABP dynamic API functionality +* Supports API version control +* Supports Swagger documentation generation + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpLocalizationManagementHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Controllers + +* `LanguageController`: Language management API controller +* `ResourceController`: Resource management API controller +* `TextController`: Text management API controller + +## Configuration + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(options => + { + options.AddAssemblyResource( + typeof(LocalizationManagementResource), + typeof(AbpLocalizationManagementApplicationContractsModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpLocalizationManagementApplicationContractsModule).Assembly); + }); +} +``` + +## API Routes + +* `/api/localization-management/languages` - Language management related APIs +* `/api/localization-management/resources` - Resource management related APIs +* `/api/localization-management/texts` - Text management related APIs + +## More Information + +* [中文文档](./README.md) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/README.md b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/README.md new file mode 100644 index 000000000..a03eab365 --- /dev/null +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/README.md @@ -0,0 +1,56 @@ +# LINGYUN.Abp.LocalizationManagement.HttpApi + +本地化管理HTTP API模块,提供RESTful风格的API接口。 + +## 功能特性 + +* 提供本地化管理的HTTP API接口 +* 支持语言、资源、文本的REST操作 +* 集成ABP动态API功能 +* 支持API版本控制 +* 支持Swagger文档生成 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpLocalizationManagementHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API控制器 + +* `LanguageController`: 语言管理API控制器 +* `ResourceController`: 资源管理API控制器 +* `TextController`: 文本管理API控制器 + +## 配置项 + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(options => + { + options.AddAssemblyResource( + typeof(LocalizationManagementResource), + typeof(AbpLocalizationManagementApplicationContractsModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpLocalizationManagementApplicationContractsModule).Assembly); + }); +} +``` + +## API路由 + +* `/api/localization-management/languages` - 语言管理相关API +* `/api/localization-management/resources` - 资源管理相关API +* `/api/localization-management/texts` - 文本管理相关API + +## 更多信息 + +* [English documentation](./README.EN.md) diff --git a/aspnet-core/modules/localization-management/README.EN.md b/aspnet-core/modules/localization-management/README.EN.md new file mode 100644 index 000000000..1fa97b518 --- /dev/null +++ b/aspnet-core/modules/localization-management/README.EN.md @@ -0,0 +1,103 @@ +# Localization Management + +Localization document management module. Due to long project paths not being supported in Windows systems, the project directory uses the abbreviation 'lt'. + +## Features + +* Support dynamic management of localization resources +* Support language management (CRUD operations) +* Support resource management (CRUD operations) +* Support text management (CRUD operations) +* Support in-memory caching of localization resources +* Support distributed cache synchronization +* Provide standard RESTful API interfaces +* Seamless integration with ABP framework + +## Module Description + +### Basic Modules + +* [LINGYUN.Abp.Localization.Persistence](../localization/LINGYUN.Abp.Localization.Persistence) - Localization persistence module, implements IStaticLocalizationSaver interface to persist local static resources to storage facilities +* [LINGYUN.Abp.LocalizationManagement.Domain.Shared](./LINGYUN.Abp.LocalizationManagement.Domain.Shared) - Domain layer shared module, defines error codes, localization, and module settings +* [LINGYUN.Abp.LocalizationManagement.Domain](./LINGYUN.Abp.LocalizationManagement.Domain) - Domain layer module, implements ILocalizationStore interface +* [LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore](./LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore) - Data access layer module, integrates EFCore +* [LINGYUN.Abp.LocalizationManagement.Application.Contracts](./LINGYUN.Abp.LocalizationManagement.Application.Contracts) - Application service layer shared module, defines external interfaces, permissions, and functionality restriction policies for managing localization objects +* [LINGYUN.Abp.LocalizationManagement.Application](./LINGYUN.Abp.LocalizationManagement.Application) - Application service layer implementation, implements localization object management interfaces +* [LINGYUN.Abp.LocalizationManagement.HttpApi](./LINGYUN.Abp.LocalizationManagement.HttpApi) - RestApi implementation, implements independent external RestApi interfaces + +### Advanced Modules + +No advanced modules at present. + +### Permission Definitions + +* LocalizationManagement.Resource - Authorizes access to resources +* LocalizationManagement.Resource.Create - Authorizes resource creation +* LocalizationManagement.Resource.Update - Authorizes resource modification +* LocalizationManagement.Resource.Delete - Authorizes resource deletion +* LocalizationManagement.Language - Authorizes access to languages +* LocalizationManagement.Language.Create - Authorizes language creation +* LocalizationManagement.Language.Update - Authorizes language modification +* LocalizationManagement.Language.Delete - Authorizes language deletion +* LocalizationManagement.Text - Authorizes access to texts +* LocalizationManagement.Text.Create - Authorizes text creation +* LocalizationManagement.Text.Update - Authorizes text modification +* LocalizationManagement.Text.Delete - Authorizes text deletion + +### Configuration + +```json +{ + "LocalizationManagement": { + "LocalizationCacheStampTimeOut": "00:02:00", // Localization cache timestamp timeout, default 2 minutes + "LocalizationCacheStampExpiration": "00:30:00" // Localization cache expiration time, default 30 minutes + } +} +``` + +### Database Tables + +The module uses the following database tables to store localization data: + +* Languages - Language table +* Resources - Resource table +* Texts - Text table + +Table prefix and schema can be configured through `LocalizationModelBuilderConfigurationOptions`: + +```csharp +public class LocalizationModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions +{ + public LocalizationModelBuilderConfigurationOptions( + string tablePrefix = "", + string schema = null) + : base(tablePrefix, schema) + { + } +} +``` + +### API Endpoints + +The module provides the following REST API endpoints: + +* `/api/localization-management/languages` - Language management related APIs +* `/api/localization-management/resources` - Resource management related APIs +* `/api/localization-management/texts` - Text management related APIs + +## Error Codes + +* Localization:001100 - Language {CultureName} already exists +* Localization:001400 - Language name {CultureName} not found or built-in language operation not allowed +* Localization:002100 - Resource {Name} already exists +* Localization:002400 - Resource name {Name} not found or built-in resource operation not allowed + +## More Information + +* [中文文档](./README.md) + +## Change Log + +### 2024.12 +* Improved module documentation +* Added English documentation support diff --git a/aspnet-core/modules/localization-management/README.md b/aspnet-core/modules/localization-management/README.md index e51a19138..7b0a44809 100644 --- a/aspnet-core/modules/localization-management/README.md +++ b/aspnet-core/modules/localization-management/README.md @@ -2,6 +2,17 @@ 本地化文档管理模块,因项目路径太长Windows系统不支持,项目目录取简称 lt +## 功能特性 + +* 支持动态管理本地化资源 +* 支持多语言管理(增删改查) +* 支持资源管理(增删改查) +* 支持文本管理(增删改查) +* 支持本地化资源的内存缓存 +* 支持分布式缓存同步 +* 提供标准的RESTful API接口 +* 支持与ABP框架无缝集成 + ## 模块说明 ### 基础模块 @@ -16,6 +27,8 @@ ### 高阶模块 +暂无高阶模块。 + ### 权限定义 * LocalizationManagement.Resource 授权对象是否允许访问资源 @@ -28,12 +41,63 @@ * LocalizationManagement.Language.Delete 授权对象是否允许删除语言 * LocalizationManagement.Text 授权对象是否允许访问文档 * LocalizationManagement.Text.Create 授权对象是否允许创建文档 -* LocalizationManagement.Text.Update 授权对象是否允许删除Oss对象 -* LocalizationManagement.Text.Delete 授权对象是否允许下载Oss对象 - -### 功能定义 +* LocalizationManagement.Text.Update 授权对象是否允许修改文档 +* LocalizationManagement.Text.Delete 授权对象是否允许删除文档 ### 配置定义 +```json +{ + "LocalizationManagement": { + "LocalizationCacheStampTimeOut": "00:02:00", // 本地化缓存时间戳超时时间,默认2分钟 + "LocalizationCacheStampExpiration": "00:30:00" // 本地化缓存过期时间,默认30分钟 + } +} +``` + +### 数据库表 + +本模块使用以下数据库表存储本地化数据: + +* Languages - 语言表 +* Resources - 资源表 +* Texts - 文本表 + +可通过 `LocalizationModelBuilderConfigurationOptions` 配置表前缀和Schema: + +```csharp +public class LocalizationModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions +{ + public LocalizationModelBuilderConfigurationOptions( + string tablePrefix = "", + string schema = null) + : base(tablePrefix, schema) + { + } +} +``` + +### API接口 + +本模块提供以下REST API接口: + +* `/api/localization-management/languages` - 语言管理相关API +* `/api/localization-management/resources` - 资源管理相关API +* `/api/localization-management/texts` - 文本管理相关API + +## 错误代码 + +* Localization:001100 - 语言 {CultureName} 已经存在 +* Localization:001400 - 语言名称 {CultureName} 不存在或内置语言不允许操作 +* Localization:002100 - 资源 {Name} 已经存在 +* Localization:002400 - 资源名称 {Name} 不存在或内置资源不允许操作 + +## 更多信息 + +* [English documentation](./README.EN.md) + ## 更新日志 +### 2024.12 +* 完善模块文档 +* 添加英文文档支持 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/README.EN.md new file mode 100644 index 000000000..52e4c8f14 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/README.EN.md @@ -0,0 +1,103 @@ +# LINGYUN.Abp.OpenIddict.Application.Contracts + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Application.Contracts%2FLINGYUN.Abp.OpenIddict.Application.Contracts.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Application.Contracts.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Application.Contracts) + +## Introduction + +`LINGYUN.Abp.OpenIddict.Application.Contracts` is the contract layer for OpenIddict application services, defining the interfaces, DTOs, and permissions required for OpenIddict management. + +[简体中文](./README.md) + +## Features + +* Define OpenIddict Application Service Interfaces + * IOpenIddictApplicationAppService + * IOpenIddictAuthorizationAppService + * IOpenIddictTokenAppService + * IOpenIddictScopeAppService + +* Provide Standardized DTOs + * OpenIddictApplicationDto + * OpenIddictAuthorizationDto + * OpenIddictTokenDto + * OpenIddictScopeDto + * And corresponding Create and Update DTOs + +* Permission Definitions + * OpenIddict.Applications + * OpenIddict.Authorizations + * OpenIddict.Tokens + * OpenIddict.Scopes + +* Multilingual Support + * Built-in Chinese and English localization resources + * Support for custom language extensions + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Application.Contracts +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictApplicationContractsModule))]` to your module class. + +2. Inject and use the corresponding application service interfaces: + +```csharp +public class YourService +{ + private readonly IOpenIddictApplicationAppService _applicationAppService; + + public YourService(IOpenIddictApplicationAppService applicationAppService) + { + _applicationAppService = applicationAppService; + } + + public async Task DoSomethingAsync() + { + var applications = await _applicationAppService.GetListAsync( + new OpenIddictApplicationGetListInput()); + // ... + } +} +``` + +## Permissions + +The module defines the following permissions: + +* OpenIddict.Applications + * OpenIddict.Applications.Create + * OpenIddict.Applications.Update + * OpenIddict.Applications.Delete + * OpenIddict.Applications.ManagePermissions + * OpenIddict.Applications.ManageSecret +* OpenIddict.Authorizations + * OpenIddict.Authorizations.Delete +* OpenIddict.Scopes + * OpenIddict.Scopes.Create + * OpenIddict.Scopes.Update + * OpenIddict.Scopes.Delete +* OpenIddict.Tokens + * OpenIddict.Tokens.Delete + +## Localization + +The module supports multiple languages with built-in support for: + +* English (en) +* Simplified Chinese (zh-Hans) + +You can extend new languages as follows: + +```csharp +Configure(options => +{ + options.Resources + .Get() + .AddVirtualJson("/YourPath/Localization/Resources"); +}); +``` diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/README.md new file mode 100644 index 000000000..cc2818580 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/README.md @@ -0,0 +1,103 @@ +# LINGYUN.Abp.OpenIddict.Application.Contracts + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Application.Contracts%2FLINGYUN.Abp.OpenIddict.Application.Contracts.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Application.Contracts.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Application.Contracts) + +## 简介 + +`LINGYUN.Abp.OpenIddict.Application.Contracts` 是 OpenIddict 应用服务的契约层,定义了 OpenIddict 管理所需的接口、DTO和权限。 + +[English](./README.EN.md) + +## 功能特性 + +* 定义 OpenIddict 应用服务接口 + * IOpenIddictApplicationAppService + * IOpenIddictAuthorizationAppService + * IOpenIddictTokenAppService + * IOpenIddictScopeAppService + +* 提供标准化的 DTO 对象 + * OpenIddictApplicationDto + * OpenIddictAuthorizationDto + * OpenIddictTokenDto + * OpenIddictScopeDto + * 以及相应的创建和更新 DTO + +* 权限定义 + * OpenIddict.Applications + * OpenIddict.Authorizations + * OpenIddict.Tokens + * OpenIddict.Scopes + +* 多语言支持 + * 内置中文和英文本地化资源 + * 支持自定义语言扩展 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Application.Contracts +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictApplicationContractsModule))]` 到你的模块类。 + +2. 注入并使用相应的应用服务接口: + +```csharp +public class YourService +{ + private readonly IOpenIddictApplicationAppService _applicationAppService; + + public YourService(IOpenIddictApplicationAppService applicationAppService) + { + _applicationAppService = applicationAppService; + } + + public async Task DoSomethingAsync() + { + var applications = await _applicationAppService.GetListAsync( + new OpenIddictApplicationGetListInput()); + // ... + } +} +``` + +## 权限 + +模块定义了以下权限: + +* OpenIddict.Applications + * OpenIddict.Applications.Create + * OpenIddict.Applications.Update + * OpenIddict.Applications.Delete + * OpenIddict.Applications.ManagePermissions + * OpenIddict.Applications.ManageSecret +* OpenIddict.Authorizations + * OpenIddict.Authorizations.Delete +* OpenIddict.Scopes + * OpenIddict.Scopes.Create + * OpenIddict.Scopes.Update + * OpenIddict.Scopes.Delete +* OpenIddict.Tokens + * OpenIddict.Tokens.Delete + +## 本地化 + +模块支持多语言,内置了以下语言: + +* 英文 (en) +* 简体中文 (zh-Hans) + +可以通过以下方式扩展新的语言: + +```csharp +Configure(options => +{ + options.Resources + .Get() + .AddVirtualJson("/YourPath/Localization/Resources"); +}); +``` diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/README.EN.md new file mode 100644 index 000000000..b6ccafd1a --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/README.EN.md @@ -0,0 +1,65 @@ +# LINGYUN.Abp.OpenIddict.Application + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Application%2FLINGYUN.Abp.OpenIddict.Application.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Application.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Application) + +## Introduction + +`LINGYUN.Abp.OpenIddict.Application` is an application service layer implementation based on ABP OpenIddict, providing management functionality for OpenIddict clients, authorizations, tokens, and scopes. + +[简体中文](./README.md) + +## Features + +* OpenIddict Client Application Management + * Create, update, and delete client applications + * Manage client basic information (client ID, secret, name, etc.) + * Configure grant types, response types, scopes, and redirect URIs + * Support custom configuration of client properties and requirements + +* OpenIddict Authorization Management + * Query and delete authorization records + * Filter authorizations by client ID, creation time, status, etc. + +* OpenIddict Token Management + * Query and delete tokens + * Filter tokens by client ID, creation time, expiration time, status, etc. + +* OpenIddict Scope Management + * Create, update, and delete scopes + * Manage scope basic information (name, description, display name, etc.) + * Support multilingual display names and descriptions + * Configure resources associated with scopes + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Application +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictApplicationModule))]` to your module class. + +2. Configure permissions: + +The module predefines the following permissions: + +* OpenIddict.Applications: Client application management + * OpenIddict.Applications.Create: Create clients + * OpenIddict.Applications.Update: Update clients + * OpenIddict.Applications.Delete: Delete clients +* OpenIddict.Authorizations: Authorization management + * OpenIddict.Authorizations.Delete: Delete authorizations +* OpenIddict.Scopes: Scope management + * OpenIddict.Scopes.Create: Create scopes + * OpenIddict.Scopes.Update: Update scopes + * OpenIddict.Scopes.Delete: Delete scopes +* OpenIddict.Tokens: Token management + * OpenIddict.Tokens.Delete: Delete tokens + +## Notes + +* Client application ClientId cannot be modified after creation +* Deleting a client application will also delete related authorizations and tokens +* Scope names cannot be modified after creation diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/README.md new file mode 100644 index 000000000..caa43eb87 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/README.md @@ -0,0 +1,65 @@ +# LINGYUN.Abp.OpenIddict.Application + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Application%2FLINGYUN.Abp.OpenIddict.Application.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Application.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Application) + +## 简介 + +`LINGYUN.Abp.OpenIddict.Application` 是基于 ABP OpenIddict 的应用服务层实现,提供了对 OpenIddict 客户端、授权、令牌和作用域的管理功能。 + +[English](./README.EN.md) + +## 功能特性 + +* OpenIddict 客户端应用程序管理 + * 创建、更新、删除客户端应用程序 + * 管理客户端基本信息(客户端ID、密钥、名称等) + * 配置授权类型、响应类型、作用域和重定向URI + * 支持客户端属性和要求的自定义配置 + +* OpenIddict 授权管理 + * 查询和删除授权记录 + * 按客户端ID、创建时间、状态等条件筛选授权 + +* OpenIddict 令牌管理 + * 查询和删除令牌 + * 按客户端ID、创建时间、过期时间、状态等条件筛选令牌 + +* OpenIddict 作用域管理 + * 创建、更新、删除作用域 + * 管理作用域基本信息(名称、描述、显示名称等) + * 支持多语言显示名称和描述 + * 配置作用域关联的资源 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Application +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictApplicationModule))]` 到你的模块类。 + +2. 配置权限: + +模块预定义了以下权限: + +* OpenIddict.Applications: 客户端应用管理 + * OpenIddict.Applications.Create: 创建客户端 + * OpenIddict.Applications.Update: 更新客户端 + * OpenIddict.Applications.Delete: 删除客户端 +* OpenIddict.Authorizations: 授权管理 + * OpenIddict.Authorizations.Delete: 删除授权 +* OpenIddict.Scopes: 作用域管理 + * OpenIddict.Scopes.Create: 创建作用域 + * OpenIddict.Scopes.Update: 更新作用域 + * OpenIddict.Scopes.Delete: 删除作用域 +* OpenIddict.Tokens: 令牌管理 + * OpenIddict.Tokens.Delete: 删除令牌 + +## 注意事项 + +* 客户端应用程序的 ClientId 在创建后不能修改 +* 删除客户端应用程序会同时删除相关的授权和令牌 +* 作用域名称在创建后不能修改 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/README.EN.md new file mode 100644 index 000000000..6c3619f3a --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/README.EN.md @@ -0,0 +1,76 @@ +# LINGYUN.Abp.OpenIddict.AspNetCore.Session + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.AspNetCore.Session%2FLINGYUN.Abp.OpenIddict.AspNetCore.Session.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.AspNetCore.Session.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.AspNetCore.Session) + +## Introduction + +`LINGYUN.Abp.OpenIddict.AspNetCore.Session` is a session management extension module for OpenIddict, providing functionality for user session persistence, validation, and revocation. + +[简体中文](./README.md) + +## Features + +* User Session Management + * Automatic session persistence on login + * Automatic session termination on logout + * Automatic session termination on token revocation + * UserInfo endpoint session validation + +* Multi-tenancy Support + * Session management supports multi-tenant scenarios + * Tenant-isolated session storage + +* Configurable Session Persistence + * Support for configuring grant types that require session persistence + * Default support for password grant type + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.AspNetCore.Session +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictAspNetCoreSessionModule))]` to your module class. + +2. Configure session options: + +```csharp +Configure(options => +{ + options.SignInSessionEnabled = true; // Enable login session + options.SignOutSessionEnabled = true; // Enable logout session +}); + +Configure(options => +{ + // Configure grant types that require session persistence + options.PersistentSessionGrantTypes.Add(GrantTypes.Password); + options.PersistentSessionGrantTypes.Add("custom_grant_type"); +}); +``` + +## Workflow + +1. User Login + * When a user successfully logs in through configured grant types + * System automatically creates and persists session information + +2. Session Validation + * When user accesses the UserInfo endpoint + * System automatically validates if the session is valid + * Returns appropriate error if session has expired or is invalid + +3. Session Termination + * Automatically terminates session on user logout + * Automatically terminates related sessions on token revocation + * Supports session management for multiple concurrent logins + +## Notes + +* Session persistence only applies to configured grant types +* Session validation automatically switches tenant context in multi-tenant environments +* Token revocation will terminate related user sessions +* UserInfo endpoint session validation is mandatory, invalid sessions will result in request rejection diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/README.md new file mode 100644 index 000000000..93f8f6743 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/README.md @@ -0,0 +1,76 @@ +# LINGYUN.Abp.OpenIddict.AspNetCore.Session + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.AspNetCore.Session%2FLINGYUN.Abp.OpenIddict.AspNetCore.Session.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.AspNetCore.Session.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.AspNetCore.Session) + +## 简介 + +`LINGYUN.Abp.OpenIddict.AspNetCore.Session` 是 OpenIddict 的会话管理扩展模块,提供了用户会话的持久化、验证和撤销功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 用户会话管理 + * 登录时自动持久化会话 + * 登出时自动终止会话 + * 令牌撤销时自动终止会话 + * UserInfo 端点会话验证 + +* 多租户支持 + * 会话管理支持多租户场景 + * 租户隔离的会话存储 + +* 可配置的会话持久化 + * 支持配置需要持久化会话的授权类型 + * 默认支持密码授权类型 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.AspNetCore.Session +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictAspNetCoreSessionModule))]` 到你的模块类。 + +2. 配置会话选项: + +```csharp +Configure(options => +{ + options.SignInSessionEnabled = true; // 启用登录会话 + options.SignOutSessionEnabled = true; // 启用登出会话 +}); + +Configure(options => +{ + // 配置需要持久化会话的授权类型 + options.PersistentSessionGrantTypes.Add(GrantTypes.Password); + options.PersistentSessionGrantTypes.Add("custom_grant_type"); +}); +``` + +## 工作流程 + +1. 用户登录 + * 当用户通过配置的授权类型登录成功时 + * 系统自动创建并持久化会话信息 + +2. 会话验证 + * 当用户访问 UserInfo 端点时 + * 系统自动验证会话是否有效 + * 如果会话已过期或无效,返回相应的错误 + +3. 会话终止 + * 用户主动登出时自动终止会话 + * 令牌撤销时自动终止相关会话 + * 支持多终端同时登录的会话管理 + +## 注意事项 + +* 会话持久化仅对配置的授权类型生效 +* 会话验证在多租户环境中会自动切换租户上下文 +* 令牌撤销会同时终止相关的用户会话 +* UserInfo 端点的会话验证是强制的,无效会话将导致请求被拒绝 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/README.EN.md new file mode 100644 index 000000000..e65ba5bb1 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/README.EN.md @@ -0,0 +1,74 @@ +# LINGYUN.Abp.OpenIddict.AspNetCore + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.AspNetCore%2FLINGYUN.Abp.OpenIddict.AspNetCore.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.AspNetCore.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.AspNetCore) + +## Introduction + +`LINGYUN.Abp.OpenIddict.AspNetCore` is an ASP.NET Core integration module based on ABP OpenIddict, providing user information extensions and avatar URL claim support. + +[简体中文](./README.md) + +## Features + +* Extended UserInfo Endpoint + * Support for returning user avatar URL + * Extended standard OpenID Connect claims + * Multi-tenancy support + +* Avatar URL Claims Contributor + * Automatically add user avatar URL claim + * Integration with identity system + +* OpenIddict Server Configuration + * Pre-configured avatar URL claim support + * Inherits from Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.AspNetCore +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictAspNetCoreModule))]` to your module class. + +2. The UserInfo endpoint will automatically be extended to include the following claims: + * sub (User ID) + * tenant_id (Tenant ID, if multi-tenancy is enabled) + * preferred_username (Username) + * family_name (Surname) + * given_name (Name) + * picture (Avatar URL) + * email + * email_verified + * phone_number + * phone_number_verified + * role + +3. The avatar URL claim will be automatically added to the user's identity claims. + +## Configuration + +By default, the module is pre-configured with the required settings. If you need to customize the configuration, you can modify it in the module's `PreConfigureServices` method: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // Custom configuration + builder.RegisterClaims(new[] { "your_custom_claim" }); + }); +} +``` + +## Notes + +* The avatar URL claim type is `IdentityConsts.ClaimType.Avatar.Name` +* The UserInfo endpoint requires corresponding scope permissions to return information: + * profile: Basic information and avatar + * email: Email-related information + * phone: Phone number-related information + * roles: User role information diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/README.md new file mode 100644 index 000000000..3a5a0eafc --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/README.md @@ -0,0 +1,74 @@ +# LINGYUN.Abp.OpenIddict.AspNetCore + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.AspNetCore%2FLINGYUN.Abp.OpenIddict.AspNetCore.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.AspNetCore.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.AspNetCore) + +## 简介 + +`LINGYUN.Abp.OpenIddict.AspNetCore` 是基于 ABP OpenIddict 的 ASP.NET Core 集成模块,提供了用户信息扩展和头像URL声明支持。 + +[English](./README.EN.md) + +## 功能特性 + +* 扩展用户信息端点 + * 支持返回用户头像URL + * 扩展标准 OpenID Connect 声明 + * 支持多租户 + +* 头像URL声明贡献者 + * 自动添加用户头像URL声明 + * 与身份系统集成 + +* OpenIddict 服务器配置 + * 预配置头像URL声明支持 + * 继承自 Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.AspNetCore +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictAspNetCoreModule))]` 到你的模块类。 + +2. 用户信息端点将自动扩展以包含以下声明: + * sub (用户ID) + * tenant_id (租户ID,如果启用了多租户) + * preferred_username (用户名) + * family_name (姓氏) + * given_name (名字) + * picture (头像URL) + * email + * email_verified + * phone_number + * phone_number_verified + * role + +3. 头像URL声明会自动添加到用户的身份声明中。 + +## 配置 + +默认情况下,模块已预配置了所需的设置。如果需要自定义配置,可以在模块的 `PreConfigureServices` 方法中修改: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // 自定义配置 + builder.RegisterClaims(new[] { "your_custom_claim" }); + }); +} +``` + +## 注意事项 + +* 头像URL声明的类型为 `IdentityConsts.ClaimType.Avatar.Name` +* 用户信息端点需要相应的作用域权限才能返回信息: + * profile: 基本信息和头像 + * email: 电子邮件相关信息 + * phone: 电话号码相关信息 + * roles: 用户角色信息 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/README.EN.md new file mode 100644 index 000000000..1f04bce97 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/README.EN.md @@ -0,0 +1,89 @@ +# LINGYUN.Abp.OpenIddict.Dapr.Client + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Dapr.Client%2FLINGYUN.Abp.OpenIddict.Dapr.Client.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Dapr.Client.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Dapr.Client) + +## Introduction + +`LINGYUN.Abp.OpenIddict.Dapr.Client` is a Dapr-based OpenIddict client module that provides functionality to call OpenIddict remote services using the Dapr service invocation building block. + +[简体中文](./README.md) + +## Features + +* Dapr Service Invocation Integration + * Automatic registration of Dapr client proxies for OpenIddict application contracts + * Support accessing OpenIddict remote services via Dapr service invocation + * Support service-to-service communication in distributed systems + +* Remote Service Support + * Support all services defined in OpenIddict application contracts + * Support application management + * Support authorization management + * Support scope management + * Support token management + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Dapr.Client +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictDaprClientModule))]` to your module class. + +2. Configure Dapr service invocation: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.ApplicationServices.Configure(config => + { + // Configure the AppId for OpenIddict service + config.AppId = "openiddict-service"; + }); + }); +} +``` + +3. Usage example: + +```csharp +public class MyService +{ + private readonly IOpenIddictApplicationAppService _applicationAppService; + + public MyService(IOpenIddictApplicationAppService applicationAppService) + { + _applicationAppService = applicationAppService; + } + + public async Task DoSomethingAsync() + { + // Access OpenIddict application service via Dapr service invocation + var applications = await _applicationAppService.GetListAsync( + new GetApplicationsInput()); + } +} +``` + +## Configuration + +* AppId + * Application identifier for the OpenIddict service + * Must match the app ID in Dapr component configuration + +* RemoteServiceName + * Name of the OpenIddict remote service + * Default value is "OpenIddict" + +## Notes + +* Ensure Dapr Sidecar is properly configured and running +* Ensure OpenIddict service is registered in Dapr +* Recommended to configure service-to-service authentication in production +* Recommended to configure retry policies for service invocation +* Recommended to configure service discovery mechanism diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/README.md new file mode 100644 index 000000000..e3ca85d93 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/README.md @@ -0,0 +1,89 @@ +# LINGYUN.Abp.OpenIddict.Dapr.Client + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Dapr.Client%2FLINGYUN.Abp.OpenIddict.Dapr.Client.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Dapr.Client.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Dapr.Client) + +## 介绍 + +`LINGYUN.Abp.OpenIddict.Dapr.Client` 是一个基于 Dapr 的 OpenIddict 客户端模块,提供了使用 Dapr 服务调用构建块来调用 OpenIddict 远程服务的功能。 + +[English](./README.EN.md) + +## 功能 + +* Dapr 服务调用集成 + * 自动注册 OpenIddict 应用程序契约的 Dapr 客户端代理 + * 支持通过 Dapr 服务调用访问 OpenIddict 远程服务 + * 支持分布式系统中的服务间通信 + +* 远程服务支持 + * 支持所有 OpenIddict 应用程序契约定义的服务 + * 支持应用程序管理 + * 支持授权管理 + * 支持作用域管理 + * 支持令牌管理 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Dapr.Client +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictDaprClientModule))]` 到你的模块类。 + +2. 配置 Dapr 服务调用: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.ApplicationServices.Configure(config => + { + // 配置 OpenIddict 服务的 AppId + config.AppId = "openiddict-service"; + }); + }); +} +``` + +3. 使用示例: + +```csharp +public class MyService +{ + private readonly IOpenIddictApplicationAppService _applicationAppService; + + public MyService(IOpenIddictApplicationAppService applicationAppService) + { + _applicationAppService = applicationAppService; + } + + public async Task DoSomethingAsync() + { + // 通过 Dapr 服务调用访问 OpenIddict 应用程序服务 + var applications = await _applicationAppService.GetListAsync( + new GetApplicationsInput()); + } +} +``` + +## 配置 + +* AppId + * OpenIddict 服务的应用程序标识符 + * 必须与 Dapr 组件配置中的应用 ID 匹配 + +* RemoteServiceName + * OpenIddict 远程服务的名称 + * 默认值为 "OpenIddict" + +## 注意事项 + +* 确保 Dapr Sidecar 已正确配置和运行 +* 确保 OpenIddict 服务已在 Dapr 中注册 +* 建议在生产环境中配置服务间的身份认证 +* 建议配置服务调用的重试策略 +* 建议配置服务发现机制 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/README.EN.md new file mode 100644 index 000000000..e731875d5 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/README.EN.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.OpenIddict.HttpApi.Client + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.HttpApi.Client%2FLINGYUN.Abp.OpenIddict.HttpApi.Client.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.HttpApi.Client.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.HttpApi.Client) + +## Introduction + +`LINGYUN.Abp.OpenIddict.HttpApi.Client` is the HTTP API client module for OpenIddict, providing client proxies for remote OpenIddict HTTP API calls. + +[简体中文](./README.md) + +## Features + +* HTTP API Client Proxies + * Automatic HTTP client proxy generation + * Support for remote service calls + * Integration with ABP dynamic HTTP client proxies + +* Remote Service Configuration + * Support for configuring remote service URLs + * Support for configuring authentication methods + * Support for configuring request headers + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.HttpApi.Client +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictHttpApiClientModule))]` to your module class. + +2. Configure remote services: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.RemoteServices.Default = new RemoteServiceConfiguration + { + BaseUrl = configuration["RemoteServices:Default:BaseUrl"] + }; + }); +} +``` + +3. Usage example: + +```csharp +// Inject client proxy +private readonly IOpenIddictApplicationAppService _applicationService; + +public YourService(IOpenIddictApplicationAppService applicationService) +{ + _applicationService = applicationService; +} + +// Call remote service +var input = new OpenIddictApplicationCreateDto +{ + ClientId = "your-client-id", + DisplayName = "Your App", + // ... other properties +}; +var result = await _applicationService.CreateAsync(input); +``` + +## Configuration + +* RemoteServices + * Default:BaseUrl - Default remote service URL + * OpenIddict:BaseUrl - OpenIddict remote service URL + +## Notes + +* Correct remote service URLs need to be configured +* If remote services require authentication, corresponding authentication information needs to be configured +* HTTPS is recommended in production environments +* Client proxies automatically handle authentication token transmission diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/README.md new file mode 100644 index 000000000..7df1ab36c --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/README.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.OpenIddict.HttpApi.Client + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.HttpApi.Client%2FLINGYUN.Abp.OpenIddict.HttpApi.Client.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.HttpApi.Client.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.HttpApi.Client) + +## 简介 + +`LINGYUN.Abp.OpenIddict.HttpApi.Client` 是 OpenIddict 的 HTTP API 客户端模块,提供了远程调用 OpenIddict HTTP API 的客户端代理。 + +[English](./README.EN.md) + +## 功能特性 + +* HTTP API 客户端代理 + * 自动生成 HTTP 客户端代理 + * 支持远程服务调用 + * 集成 ABP 动态 HTTP 客户端代理 + +* 远程服务配置 + * 支持配置远程服务地址 + * 支持配置认证方式 + * 支持配置请求头 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.HttpApi.Client +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictHttpApiClientModule))]` 到你的模块类。 + +2. 配置远程服务: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.RemoteServices.Default = new RemoteServiceConfiguration + { + BaseUrl = configuration["RemoteServices:Default:BaseUrl"] + }; + }); +} +``` + +3. 使用示例: + +```csharp +// 注入客户端代理 +private readonly IOpenIddictApplicationAppService _applicationService; + +public YourService(IOpenIddictApplicationAppService applicationService) +{ + _applicationService = applicationService; +} + +// 调用远程服务 +var input = new OpenIddictApplicationCreateDto +{ + ClientId = "your-client-id", + DisplayName = "Your App", + // ... 其他属性 +}; +var result = await _applicationService.CreateAsync(input); +``` + +## 配置项 + +* RemoteServices + * Default:BaseUrl - 默认远程服务地址 + * OpenIddict:BaseUrl - OpenIddict 远程服务地址 + +## 注意事项 + +* 需要配置正确的远程服务地址 +* 如果远程服务需要认证,需要配置相应的认证信息 +* 建议在生产环境中使用 HTTPS +* 客户端代理会自动处理认证令牌的传递 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/README.EN.md new file mode 100644 index 000000000..f9d673ea9 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/README.EN.md @@ -0,0 +1,117 @@ +# LINGYUN.Abp.OpenIddict.HttpApi + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.HttpApi%2FLINGYUN.Abp.OpenIddict.HttpApi.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.HttpApi.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.HttpApi) + +## Introduction + +`LINGYUN.Abp.OpenIddict.HttpApi` is the HTTP API module for OpenIddict, providing RESTful API interfaces for OpenIddict-related functionality. + +[简体中文](./README.md) + +## Features + +* OpenIddict Application Management + * Create, update, delete applications + * Query application list + * Get application details + +* OpenIddict Authorization Management + * Query authorization list + * Get authorization details + * Delete authorization records + +* OpenIddict Token Management + * Query token list + * Get token details + * Delete token records + +* OpenIddict Scope Management + * Create, update, delete scopes + * Query scope list + * Get scope details + +* Localization Support + * Integrated with ABP localization framework + * Support for custom localization resources + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.HttpApi +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictHttpApiModule))]` to your module class. + +2. Configure permissions: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.ValueProviders.Add(); + }); +} +``` + +3. API usage example: + +```csharp +// Inject service +private readonly IOpenIddictApplicationAppService _applicationService; + +public YourService(IOpenIddictApplicationAppService applicationService) +{ + _applicationService = applicationService; +} + +// Create application +var input = new OpenIddictApplicationCreateDto +{ + ClientId = "your-client-id", + DisplayName = "Your App", + // ... other properties +}; +var result = await _applicationService.CreateAsync(input); + +// Query application list +var query = new OpenIddictApplicationGetListInput +{ + MaxResultCount = 10, + SkipCount = 0, + Filter = "search-term" +}; +var list = await _applicationService.GetListAsync(query); +``` + +## Permissions + +* OpenIddict.Applications + * OpenIddict.Applications.Create + * OpenIddict.Applications.Update + * OpenIddict.Applications.Delete + * OpenIddict.Applications.ManagePermissions + +* OpenIddict.Scopes + * OpenIddict.Scopes.Create + * OpenIddict.Scopes.Update + * OpenIddict.Scopes.Delete + * OpenIddict.Scopes.ManagePermissions + +* OpenIddict.Authorizations + * OpenIddict.Authorizations.Delete + * OpenIddict.Authorizations.ManagePermissions + +* OpenIddict.Tokens + * OpenIddict.Tokens.Delete + * OpenIddict.Tokens.ManagePermissions + +## Notes + +* All API endpoints require corresponding permissions to access +* Deleting an application will also delete related authorizations and tokens +* API endpoints support multi-tenant scenarios +* It is recommended to enable API authentication and authorization in production environments diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/README.md new file mode 100644 index 000000000..05e1c6353 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/README.md @@ -0,0 +1,117 @@ +# LINGYUN.Abp.OpenIddict.HttpApi + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.HttpApi%2FLINGYUN.Abp.OpenIddict.HttpApi.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.HttpApi.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.HttpApi) + +## 简介 + +`LINGYUN.Abp.OpenIddict.HttpApi` 是 OpenIddict 的 HTTP API 模块,提供了 OpenIddict 相关功能的 RESTful API 接口。 + +[English](./README.EN.md) + +## 功能特性 + +* OpenIddict 应用程序管理 + * 创建、更新、删除应用程序 + * 查询应用程序列表 + * 获取应用程序详情 + +* OpenIddict 授权管理 + * 查询授权列表 + * 获取授权详情 + * 删除授权记录 + +* OpenIddict 令牌管理 + * 查询令牌列表 + * 获取令牌详情 + * 删除令牌记录 + +* OpenIddict 作用域管理 + * 创建、更新、删除作用域 + * 查询作用域列表 + * 获取作用域详情 + +* 多语言支持 + * 集成 ABP 本地化框架 + * 支持自定义本地化资源 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.HttpApi +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictHttpApiModule))]` 到你的模块类。 + +2. 配置权限: + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.ValueProviders.Add(); + }); +} +``` + +3. API 接口使用示例: + +```csharp +// 注入服务 +private readonly IOpenIddictApplicationAppService _applicationService; + +public YourService(IOpenIddictApplicationAppService applicationService) +{ + _applicationService = applicationService; +} + +// 创建应用程序 +var input = new OpenIddictApplicationCreateDto +{ + ClientId = "your-client-id", + DisplayName = "Your App", + // ... 其他属性 +}; +var result = await _applicationService.CreateAsync(input); + +// 查询应用程序列表 +var query = new OpenIddictApplicationGetListInput +{ + MaxResultCount = 10, + SkipCount = 0, + Filter = "search-term" +}; +var list = await _applicationService.GetListAsync(query); +``` + +## 权限 + +* OpenIddict.Applications + * OpenIddict.Applications.Create + * OpenIddict.Applications.Update + * OpenIddict.Applications.Delete + * OpenIddict.Applications.ManagePermissions + +* OpenIddict.Scopes + * OpenIddict.Scopes.Create + * OpenIddict.Scopes.Update + * OpenIddict.Scopes.Delete + * OpenIddict.Scopes.ManagePermissions + +* OpenIddict.Authorizations + * OpenIddict.Authorizations.Delete + * OpenIddict.Authorizations.ManagePermissions + +* OpenIddict.Tokens + * OpenIddict.Tokens.Delete + * OpenIddict.Tokens.ManagePermissions + +## 注意事项 + +* 所有 API 接口都需要相应的权限才能访问 +* 删除应用程序会同时删除相关的授权和令牌 +* API 接口支持多租户场景 +* 建议在生产环境中启用 API 认证和授权 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/README.EN.md new file mode 100644 index 000000000..9cd07c579 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/README.EN.md @@ -0,0 +1,88 @@ +# LINGYUN.Abp.OpenIddict.LinkUser + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.LinkUser%2FLINGYUN.Abp.OpenIddict.LinkUser.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.LinkUser.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.LinkUser) + +## Introduction + +`LINGYUN.Abp.OpenIddict.LinkUser` is a user linking extension module for OpenIddict, providing authentication functionality between linked users. + +[简体中文](./README.md) + +## Features + +* User Link Authentication + * Support for user-to-user linking authentication + * Support for cross-tenant user linking + * Support for access token exchange + +* Extension Grant Type + * Add link_user grant type + * Support for custom authorization flow + * Security log recording + +* Localization Support + * Integrated with ABP localization framework + * Support for custom error messages + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.LinkUser +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictLinkUserModule))]` to your module class. + +2. Configure OpenIddict server: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // Allow link_user grant type + builder.AllowLinkUserFlow(); + }); +} +``` + +3. Usage example: + +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=link_user& +access_token=current-user-access-token& +LinkUserId=target-user-id& +LinkTenantId=target-tenant-id& +scope=openid profile +``` + +## Parameters + +* access_token (required) + * Current user's access token + * Used to verify current user's identity + +* LinkUserId (required) + * Target linked user's ID + * Must be a valid GUID format + +* LinkTenantId (optional) + * Tenant ID of the target linked user + * If specified, must be a valid GUID format + +* scope (optional) + * Requested permission scopes + * Defaults include openid profile + +## Notes + +* A valid access token must be provided +* The target user must have a linking relationship with the current user +* Correct tenant ID must be specified for cross-tenant linking +* All operations are recorded in security logs +* HTTPS is recommended in production environments diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/README.md new file mode 100644 index 000000000..0b9cad994 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/README.md @@ -0,0 +1,88 @@ +# LINGYUN.Abp.OpenIddict.LinkUser + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.LinkUser%2FLINGYUN.Abp.OpenIddict.LinkUser.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.LinkUser.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.LinkUser) + +## 简介 + +`LINGYUN.Abp.OpenIddict.LinkUser` 是 OpenIddict 的用户链接扩展模块,提供了用户之间的链接认证功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 用户链接认证 + * 支持用户之间的链接认证 + * 支持跨租户用户链接 + * 支持访问令牌交换 + +* 扩展授权类型 + * 添加 link_user 授权类型 + * 支持自定义授权流程 + * 安全日志记录 + +* 多语言支持 + * 集成 ABP 本地化框架 + * 支持自定义错误消息 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.LinkUser +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictLinkUserModule))]` 到你的模块类。 + +2. 配置 OpenIddict 服务器: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // 允许 link_user 授权类型 + builder.AllowLinkUserFlow(); + }); +} +``` + +3. 使用示例: + +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=link_user& +access_token=current-user-access-token& +LinkUserId=target-user-id& +LinkTenantId=target-tenant-id& +scope=openid profile +``` + +## 参数说明 + +* access_token (必填) + * 当前用户的访问令牌 + * 用于验证当前用户身份 + +* LinkUserId (必填) + * 目标链接用户的ID + * 必须是有效的GUID格式 + +* LinkTenantId (可选) + * 目标链接用户所属的租户ID + * 如果指定,必须是有效的GUID格式 + +* scope (可选) + * 请求的权限范围 + * 默认包含 openid profile + +## 注意事项 + +* 必须提供有效的访问令牌 +* 目标用户必须与当前用户存在链接关系 +* 跨租户链接时需要指定正确的租户ID +* 所有操作都会记录安全日志 +* 建议在生产环境中使用 HTTPS diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/README.EN.md new file mode 100644 index 000000000..1cb496de0 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/README.EN.md @@ -0,0 +1,124 @@ +# LINGYUN.Abp.OpenIddict.Portal + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Portal%2FLINGYUN.Abp.OpenIddict.Portal.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Portal.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Portal) + +## Introduction + +`LINGYUN.Abp.OpenIddict.Portal` is a portal authentication extension module for OpenIddict, providing enterprise portal authentication functionality, including multi-tenant selection, two-factor authentication, password policies, and more. + +[简体中文](./README.md) + +## Features + +* Enterprise Portal Authentication + * Support for enterprise list selection + * Support for multi-tenant authentication + * Support for enterprise logo display + +* Enhanced Password Authentication + * Support for email login + * Support for external login providers + * Support for password policy validation + * Support for forced password change + * Support for periodic password change + +* Two-Factor Authentication + * Support for multiple verification providers + * Support for verification code validation + * Support for authenticator validation + +* Security Logging + * Record login attempts + * Record login failures + * Record password changes + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Portal +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictPortalModule))]` to your module class. + +2. Configure OpenIddict server: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // Allow portal authentication flow + builder.AllowPortalFlow(); + }); +} +``` + +3. Usage example: + +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=portal& +username=admin& +password=1q2w3E*& +enterpriseId=your-enterprise-id& +scope=openid profile +``` + +## Authentication Flow + +1. Enterprise Selection + * User provides enterprise ID (enterpriseId) + * Returns available enterprise list if not provided or invalid + +2. Password Verification + * Support for username or email login + * Password policy validation + * Account status check + +3. Two-Factor Authentication (if enabled) + * Verify two-factor authentication code + * Support for multiple verification providers + +4. Password Change (if required) + * Force password change on first login + * Periodic password change requirement + +## Parameters + +* username (required) + * Username or email address + +* password (required) + * User password + +* enterpriseId (required) + * Enterprise ID, must be a valid GUID format + +* TwoFactorProvider (optional) + * Two-factor authentication provider name + * Only required when two-factor authentication is enabled + +* TwoFactorCode (optional) + * Two-factor authentication code + * Only required when two-factor authentication is enabled + +* ChangePasswordToken (optional) + * Password change token + * Only required when password change is needed + +* NewPassword (optional) + * New password + * Only required when password change is needed + +## Notes + +* Enterprise ID must be a valid GUID format +* Password must comply with system-configured password policy +* Two-factor authentication codes have limited validity +* All authentication operations are recorded in security logs +* HTTPS is recommended in production environments diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/README.md new file mode 100644 index 000000000..b65cdefc7 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/README.md @@ -0,0 +1,124 @@ +# LINGYUN.Abp.OpenIddict.Portal + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Portal%2FLINGYUN.Abp.OpenIddict.Portal.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Portal.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Portal) + +## 简介 + +`LINGYUN.Abp.OpenIddict.Portal` 是 OpenIddict 的门户认证扩展模块,提供了企业门户的认证功能,包括多租户选择、双因素认证、密码策略等特性。 + +[English](./README.EN.md) + +## 功能特性 + +* 企业门户认证 + * 支持企业列表选择 + * 支持多租户认证 + * 支持企业 Logo 显示 + +* 密码认证增强 + * 支持邮箱登录 + * 支持外部登录提供程序 + * 支持密码策略验证 + * 支持强制修改密码 + * 支持定期修改密码 + +* 双因素认证 + * 支持多种验证提供程序 + * 支持验证码验证 + * 支持认证器验证 + +* 安全日志 + * 记录登录尝试 + * 记录登录失败 + * 记录密码修改 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Portal +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictPortalModule))]` 到你的模块类。 + +2. 配置 OpenIddict 服务器: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // 允许门户认证流程 + builder.AllowPortalFlow(); + }); +} +``` + +3. 使用示例: + +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=portal& +username=admin& +password=1q2w3E*& +enterpriseId=your-enterprise-id& +scope=openid profile +``` + +## 认证流程 + +1. 企业选择 + * 用户提供企业ID (enterpriseId) + * 如未提供或无效,返回可选企业列表 + +2. 密码验证 + * 支持用户名或邮箱登录 + * 验证密码策略 + * 检查账户状态 + +3. 双因素认证 (如启用) + * 验证双因素认证码 + * 支持多种验证提供程序 + +4. 密码修改 (如需要) + * 首次登录强制修改密码 + * 定期修改密码要求 + +## 参数说明 + +* username (必填) + * 用户名或邮箱地址 + +* password (必填) + * 用户密码 + +* enterpriseId (必填) + * 企业ID,必须是有效的GUID格式 + +* TwoFactorProvider (可选) + * 双因素认证提供程序名称 + * 仅在启用双因素认证时需要 + +* TwoFactorCode (可选) + * 双因素认证码 + * 仅在启用双因素认证时需要 + +* ChangePasswordToken (可选) + * 修改密码令牌 + * 仅在需要修改密码时需要 + +* NewPassword (可选) + * 新密码 + * 仅在需要修改密码时需要 + +## 注意事项 + +* 企业ID必须是有效的GUID格式 +* 密码必须符合系统配置的密码策略 +* 双因素认证码有效期有限 +* 所有认证操作都会记录安全日志 +* 建议在生产环境中使用 HTTPS diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/README.EN.md new file mode 100644 index 000000000..3f6afa88b --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/README.EN.md @@ -0,0 +1,97 @@ +# LINGYUN.Abp.OpenIddict.Sms + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Sms%2FLINGYUN.Abp.OpenIddict.Sms.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Sms.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Sms) + +## Introduction + +`LINGYUN.Abp.OpenIddict.Sms` is an SMS verification extension module for OpenIddict, providing authentication functionality based on phone numbers and SMS verification codes. + +[简体中文](./README.md) + +## Features + +* SMS Verification Code Authentication + * Support for phone number login + * Support for SMS verification code validation + * Support for multi-tenant authentication + +* User Management Integration + * Support for finding users by phone number + * Support for account lockout policy + * Support for failed attempt counting + +* Security Logging + * Record login attempts + * Record verification code failures + * Record account lockouts + +* Localization Support + * Integrated with ABP localization framework + * Support for custom error messages + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Sms +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictSmsModule))]` to your module class. + +2. Configure OpenIddict server: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // Allow SMS verification code authentication flow + builder.AllowSmsFlow(); + }); +} +``` + +3. Usage example: + +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=sms& +phone_number=13800138000& +phone_verify=123456& +scope=openid profile +``` + +## Parameters + +* phone_number (required) + * Phone number + * Must be a valid phone number format + +* phone_verify (required) + * SMS verification code + * Must be a valid verification code + +* scope (optional) + * Requested permission scopes + * Defaults include openid profile + +## Error Codes + +* invalid_grant + * GrantTypeInvalid - Authorization type not allowed + * PhoneVerifyInvalid - Phone verification code invalid or expired + * PhoneOrTokenCodeNotFound - Phone number or verification code not provided + * PhoneNumberNotRegister - Phone number not registered + +## Notes + +* Phone number must be registered +* Verification codes have limited validity +* Failed verifications increase failure count +* Multiple verification failures may lead to account lockout +* All authentication operations are recorded in security logs +* HTTPS is recommended in production environments diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/README.md new file mode 100644 index 000000000..761407e1b --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/README.md @@ -0,0 +1,97 @@ +# LINGYUN.Abp.OpenIddict.Sms + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.Sms%2FLINGYUN.Abp.OpenIddict.Sms.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.Sms.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.Sms) + +## 简介 + +`LINGYUN.Abp.OpenIddict.Sms` 是 OpenIddict 的短信验证扩展模块,提供了基于手机号码和短信验证码的认证功能。 + +[English](./README.EN.md) + +## 功能特性 + +* 短信验证码认证 + * 支持手机号码登录 + * 支持短信验证码验证 + * 支持多租户认证 + +* 用户管理集成 + * 支持手机号码查找用户 + * 支持账户锁定策略 + * 支持失败尝试计数 + +* 安全日志 + * 记录登录尝试 + * 记录验证码验证失败 + * 记录账户锁定 + +* 多语言支持 + * 集成 ABP 本地化框架 + * 支持自定义错误消息 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.Sms +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictSmsModule))]` 到你的模块类。 + +2. 配置 OpenIddict 服务器: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // 允许短信验证码认证流程 + builder.AllowSmsFlow(); + }); +} +``` + +3. 使用示例: + +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=sms& +phone_number=13800138000& +phone_verify=123456& +scope=openid profile +``` + +## 参数说明 + +* phone_number (必填) + * 手机号码 + * 必须是有效的手机号码格式 + +* phone_verify (必填) + * 短信验证码 + * 必须是有效的验证码 + +* scope (可选) + * 请求的权限范围 + * 默认包含 openid profile + +## 错误码说明 + +* invalid_grant + * GrantTypeInvalid - 不被允许的授权类型 + * PhoneVerifyInvalid - 手机验证码无效或已过期 + * PhoneOrTokenCodeNotFound - 手机号码或验证码未输入 + * PhoneNumberNotRegister - 登录的手机号码未注册 + +## 注意事项 + +* 手机号码必须已经注册 +* 验证码有效期有限 +* 验证失败会增加失败计数 +* 多次验证失败可能导致账户锁定 +* 所有认证操作都会记录安全日志 +* 建议在生产环境中使用 HTTPS diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/README.EN.md new file mode 100644 index 000000000..9a4e6e43f --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/README.EN.md @@ -0,0 +1,99 @@ +# LINGYUN.Abp.OpenIddict.WeChat.Work + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.WeChat.Work%2FLINGYUN.Abp.OpenIddict.WeChat.Work.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.WeChat.Work.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.WeChat.Work) + +## Introduction + +`LINGYUN.Abp.OpenIddict.WeChat.Work` is a WeChat Work (Enterprise WeChat) authentication extension module based on OpenIddict, supporting WeChat Work authentication flow. + +[简体中文](./README.md) + +## Features + +* WeChat Work Authentication + * Support WeChat Work authorization login + * Support automatic new user registration + * Support cross-tenant authentication + * Support security logging + +* User Management Integration + * Support WeChat Work account binding + * Support account lockout policy + * Support failed attempt counting + +* Security Logging + * Record login attempts + * Record authentication failures + * Record account lockouts + +* Localization Support + * Integrated with ABP localization framework + * Support custom error messages + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.WeChat.Work +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictWeChatWorkModule))]` to your module class. + +2. Configure OpenIddict server: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // Allow WeChat Work authentication flow + builder.AllowWeChatWorkFlow(); + }); +} +``` + +3. Usage example: + +WeChat Work Authentication: +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=wechat_work& +agent_id=1000001& +code=021iZ1Ga1TpLOB0dXJIa1Zr6RR1iZ1G7& +scope=openid profile wechat_work +``` + +## Parameters + +* agent_id (required) + * WeChat Work application ID + * Must be a valid WeChat Work application ID + +* code (required) + * WeChat Work authorization code + * Must be a valid WeChat Work authorization code + +* scope (optional) + * Requested permission scopes + * Defaults include openid profile wechat_work + +## Error Codes + +* invalid_grant + * GrantTypeInvalid - Authorization type not allowed + * WeChatTokenInvalid - WeChat Work authentication failed + * AgentIdOrCodeNotFound - Application ID or authorization code empty or not found + * UserIdNotRegister - User WeChat Work account not bound + +## Notes + +* Must configure correct WeChat Work application ID and secret +* Must configure correct WeChat Work enterprise ID +* Authorization codes have limited validity +* Multiple authentication failures may lead to account lockout +* All authentication operations are recorded in security logs +* HTTPS is recommended in production environments diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/README.md new file mode 100644 index 000000000..307f4f293 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/README.md @@ -0,0 +1,99 @@ +# LINGYUN.Abp.OpenIddict.WeChat.Work + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.WeChat.Work%2FLINGYUN.Abp.OpenIddict.WeChat.Work.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.WeChat.Work.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.WeChat.Work) + +## 介绍 + +`LINGYUN.Abp.OpenIddict.WeChat.Work` 是一个基于 OpenIddict 的企业微信认证扩展模块,支持企业微信的认证流程。 + +[English](./README.EN.md) + +## 功能 + +* 企业微信认证 + * 支持企业微信授权登录 + * 支持自动注册新用户 + * 支持跨租户认证 + * 支持安全日志记录 + +* 用户管理集成 + * 支持企业微信账号绑定 + * 支持账号锁定策略 + * 支持失败尝试计数 + +* 安全日志 + * 记录登录尝试 + * 记录认证失败 + * 记录账号锁定 + +* 本地化支持 + * 集成 ABP 本地化框架 + * 支持自定义错误消息 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.WeChat.Work +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictWeChatWorkModule))]` 到你的模块类。 + +2. 配置 OpenIddict 服务器: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // 允许企业微信认证流程 + builder.AllowWeChatWorkFlow(); + }); +} +``` + +3. 使用示例: + +企业微信认证: +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=wechat_work& +agent_id=1000001& +code=021iZ1Ga1TpLOB0dXJIa1Zr6RR1iZ1G7& +scope=openid profile wechat_work +``` + +## 参数 + +* agent_id (必填) + * 企业微信应用ID + * 必须是有效的企业微信应用ID + +* code (必填) + * 企业微信授权码 + * 必须是有效的企业微信授权码 + +* scope (可选) + * 请求的权限范围 + * 默认包含 openid profile wechat_work + +## 错误码 + +* invalid_grant + * GrantTypeInvalid - 不被允许的授权类型 + * WeChatTokenInvalid - 企业微信认证失败 + * AgentIdOrCodeNotFound - 应用ID或授权码为空或不存在 + * UserIdNotRegister - 用户企业微信账号未绑定 + +## 注意事项 + +* 必须配置正确的企业微信应用ID和密钥 +* 必须配置正确的企业微信企业ID +* 授权码有效期有限 +* 多次认证失败可能导致账号锁定 +* 所有认证操作都会记录在安全日志中 +* 生产环境建议使用 HTTPS diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/README.EN.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/README.EN.md new file mode 100644 index 000000000..78bb877c5 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/README.EN.md @@ -0,0 +1,110 @@ +# LINGYUN.Abp.OpenIddict.WeChat + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.WeChat%2FLINGYUN.Abp.OpenIddict.WeChat.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.WeChat.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.WeChat) + +## Introduction + +`LINGYUN.Abp.OpenIddict.WeChat` is a WeChat authentication extension module based on OpenIddict, supporting authentication flows for WeChat Official Platform and WeChat Mini Program. + +[简体中文](./README.md) + +## Features + +* WeChat Official Platform Authentication + * Support Official Account authorization login + * Support automatic new user registration + * Support cross-tenant authentication + * Support security logging + +* WeChat Mini Program Authentication + * Support Mini Program authorization login + * Support automatic new user registration + * Support cross-tenant authentication + * Support security logging + +* User Management Integration + * Support WeChat account binding + * Support account lockout policy + * Support failed attempt counting + +* Security Logging + * Record login attempts + * Record authentication failures + * Record account lockouts + +* Localization Support + * Integrated with ABP localization framework + * Support custom error messages + +## Installation + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.WeChat +``` + +## Usage + +1. Add `[DependsOn(typeof(AbpOpenIddictWeChatModule))]` to your module class. + +2. Configure OpenIddict server: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // Allow WeChat authentication flow + builder.AllowWeChatFlow(); + }); +} +``` + +3. Usage examples: + +WeChat Official Platform Authentication: +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=wechat_official& +code=021iZ1Ga1TpLOB0dXJIa1Zr6RR1iZ1G7& +scope=openid profile wechat +``` + +WeChat Mini Program Authentication: +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=wechat_mini_program& +code=021iZ1Ga1TpLOB0dXJIa1Zr6RR1iZ1G7& +scope=openid profile wechat +``` + +## Parameters + +* code (required) + * WeChat authorization code + * Must be a valid WeChat authorization code + +* scope (optional) + * Requested permission scopes + * Defaults include openid profile wechat + +## Error Codes + +* invalid_grant + * GrantTypeInvalid - Authorization type not allowed + * WeChatTokenInvalid - WeChat authentication failed + * WeChatCodeNotFound - WeChat authorization code empty or not found + * WeChatNotRegister - User WeChat account not bound + +## Notes + +* Must enable corresponding features (Official Platform or Mini Program authorization) +* Must configure correct WeChat application ID and secret +* Authorization codes have limited validity +* Multiple authentication failures may lead to account lockout +* All authentication operations are recorded in security logs +* HTTPS is recommended in production environments diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/README.md b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/README.md new file mode 100644 index 000000000..a15819531 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/README.md @@ -0,0 +1,110 @@ +# LINGYUN.Abp.OpenIddict.WeChat + +[![ABP version](https://img.shields.io/badge/dynamic/xml?style=flat-square&color=yellow&label=abp&query=%2F%2FProject%2FPropertyGroup%2FAbpVersion&url=https%3A%2F%2Fraw.githubusercontent.com%2Fcolinin%2Fabp-next-admin%2Fmaster%2Faspnet-core%2Fmodules%2FopenIddict%2FLINGYUN.Abp.OpenIddict.WeChat%2FLINGYUN.Abp.OpenIddict.WeChat.csproj)](https://abp.io) +[![NuGet](https://img.shields.io/nuget/v/LINGYUN.Abp.OpenIddict.WeChat.svg?style=flat-square)](https://www.nuget.org/packages/LINGYUN.Abp.OpenIddict.WeChat) + +## 介绍 + +`LINGYUN.Abp.OpenIddict.WeChat` 是一个基于 OpenIddict 的微信认证扩展模块,支持微信公众平台和微信小程序的认证流程。 + +[English](./README.EN.md) + +## 功能 + +* 微信公众平台认证 + * 支持公众号授权登录 + * 支持自动注册新用户 + * 支持跨租户认证 + * 支持安全日志记录 + +* 微信小程序认证 + * 支持小程序授权登录 + * 支持自动注册新用户 + * 支持跨租户认证 + * 支持安全日志记录 + +* 用户管理集成 + * 支持微信账号绑定 + * 支持账号锁定策略 + * 支持失败尝试计数 + +* 安全日志 + * 记录登录尝试 + * 记录认证失败 + * 记录账号锁定 + +* 本地化支持 + * 集成 ABP 本地化框架 + * 支持自定义错误消息 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.OpenIddict.WeChat +``` + +## 使用 + +1. 添加 `[DependsOn(typeof(AbpOpenIddictWeChatModule))]` 到你的模块类。 + +2. 配置 OpenIddict 服务器: + +```csharp +public override void PreConfigureServices(ServiceConfigurationContext context) +{ + PreConfigure(builder => + { + // 允许微信认证流程 + builder.AllowWeChatFlow(); + }); +} +``` + +3. 使用示例: + +微信公众平台认证: +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=wechat_official& +code=021iZ1Ga1TpLOB0dXJIa1Zr6RR1iZ1G7& +scope=openid profile wechat +``` + +微信小程序认证: +```http +POST /connect/token +Content-Type: application/x-www-form-urlencoded + +grant_type=wechat_mini_program& +code=021iZ1Ga1TpLOB0dXJIa1Zr6RR1iZ1G7& +scope=openid profile wechat +``` + +## 参数 + +* code (必填) + * 微信授权码 + * 必须是有效的微信授权码 + +* scope (可选) + * 请求的权限范围 + * 默认包含 openid profile wechat + +## 错误码 + +* invalid_grant + * GrantTypeInvalid - 不被允许的授权类型 + * WeChatTokenInvalid - 微信认证失败 + * WeChatCodeNotFound - 微信授权码为空或不存在 + * WeChatNotRegister - 用户微信账号未绑定 + +## 注意事项 + +* 必须启用相应的功能(公众平台或小程序授权) +* 必须配置正确的微信应用 ID 和密钥 +* 授权码有效期有限 +* 多次认证失败可能导致账号锁定 +* 所有认证操作都会记录在安全日志中 +* 生产环境建议使用 HTTPS diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/README.EN.md new file mode 100644 index 000000000..4039e2014 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/README.EN.md @@ -0,0 +1,96 @@ +# LINGYUN.Abp.BlobStoring.OssManagement + +OSS Management implementation of ABP framework's object storage provider **IBlobProvider** + +## Configuration + +Module reference as needed, depends on the OssManagement module, so you need to configure the remote Oss management module's client proxy. + +First, define the **appsettings.json** file: + +```json +{ + "OssManagement": { + "Bucket": "your-bucket-name" + }, + "RemoteServices": { + "AbpOssManagement": { + "BaseUrl": "http://127.0.0.1:30025", + "IdentityClient": "InternalServiceClient", + "UseCurrentAccessToken": false + } + }, + "IdentityClients": { + "InternalServiceClient": { + "Authority": "http://127.0.0.1:44385", + "RequireHttps": false, + "GrantType": "client_credentials", + "Scope": "lingyun-abp-application", + "ClientId": "InternalServiceClient", + "ClientSecret": "1q2w3E*" + } + } +} +``` + +```csharp +[DependsOn(typeof(AbpBlobStoringOssManagementModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var preActions = context.Services.GetPreConfigureActions(); + Configure(options => + { + preActions.Configure(options); + // YouContainer use oss management + options.Containers.Configure((containerConfiguration) => + { + containerConfiguration.UseOssManagement(config => + { + config.Bucket = configuration[OssManagementBlobProviderConfigurationNames.Bucket]; + }); + }); + + // all container use oss management + options.Containers.ConfigureAll((containerName, containerConfiguration) => + { + // use oss management + containerConfiguration.UseOssManagement(config => + { + config.Bucket = configuration[OssManagementBlobProviderConfigurationNames.Bucket]; + }); + }); + }); + } +} +``` + +## Features + +* Implements ABP framework's IBlobProvider interface +* Provides Blob storage implementation based on OssManagement +* Supports container-level configuration +* Supports global configuration +* Supports remote service calls + +## Configuration Items + +* Bucket: Storage bucket name +* RemoteServices.AbpOssManagement: + * BaseUrl: OSS management service base URL + * IdentityClient: Identity client name + * UseCurrentAccessToken: Whether to use current access token +* IdentityClients: Identity client configuration + * Authority: Authentication server address + * RequireHttps: Whether HTTPS is required + * GrantType: Authorization type + * Scope: Authorization scope + * ClientId: Client ID + * ClientSecret: Client secret + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/README.EN.md new file mode 100644 index 000000000..a7282f5e9 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/README.EN.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.OssManagement.Aliyun + +Aliyun OSS container interface implementation + +## Features + +* Implements object storage management based on Aliyun OSS +* Supports basic operations including file upload, download, and deletion +* Supports file sharding upload and breakpoint continuation +* Integrates with Aliyun OSS access control and security mechanisms + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementAliyunModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Details + +Please refer to Aliyun OSS configuration documentation: [Aliyun OSS Configuration](https://help.aliyun.com/document_detail/32009.html) + +Required configuration items: +* AccessKeyId: Aliyun access key ID +* AccessKeySecret: Aliyun access key secret +* Endpoint: Aliyun OSS access domain +* SecurityToken: Optional security token + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/README.md index 56a51290a..824a5d9de 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/README.md +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/README.md @@ -2,6 +2,13 @@ 阿里云oss容器接口 +## 功能 + +* 实现基于阿里云OSS的对象存储管理 +* 支持文件上传、下载、删除等基本操作 +* 支持文件分片上传和断点续传 +* 集成阿里云OSS的访问控制和安全机制 + ## 配置使用 模块按需引用 @@ -13,3 +20,18 @@ public class YouProjectModule : AbpModule // other } ``` + +## 配置说明 + +请参考阿里云OSS的配置说明:[阿里云OSS配置](https://help.aliyun.com/document_detail/32009.html) + +需要配置以下关键信息: +* AccessKeyId:阿里云访问密钥ID +* AccessKeySecret:阿里云访问密钥密码 +* Endpoint:阿里云OSS访问域名 +* SecurityToken:可选的安全令牌 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..cae498e21 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/README.EN.md @@ -0,0 +1,49 @@ +# LINGYUN.Abp.OssManagement.Application.Contracts + +Object Storage Management Application Service Interface Definitions + +## Features + +* Defines application service interfaces for object storage management +* Defines DTO objects for object storage management +* Defines permission management +* Supports management of public files, private files, and shared files + +## Interface Definitions + +### Container Management +* IOssContainerAppService: Container management service interface + * CreateAsync: Create container + * GetAsync: Get container information + * GetListAsync: Get container list + * GetObjectListAsync: Get object list in container + * DeleteAsync: Delete container + +### Object Management +* IOssObjectAppService: Object management service interface + * CreateAsync: Create object + * GetAsync: Get object information + * DeleteAsync: Delete object + * DownloadAsync: Download object + +### File Management +* IFileAppService: Base file service interface +* IPublicFileAppService: Public file service interface +* IPrivateFileAppService: Private file service interface +* IShareFileAppService: Shared file service interface +* IStaticFilesAppService: Static file service interface + +## Permission Definitions + +* AbpOssManagement.Container: Container management permissions + * Create: Create container + * Delete: Delete container +* AbpOssManagement.OssObject: Object management permissions + * Create: Create object + * Delete: Delete object + * Download: Download object + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/README.md new file mode 100644 index 000000000..a29aa385f --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/README.md @@ -0,0 +1,49 @@ +# LINGYUN.Abp.OssManagement.Application.Contracts + +对象存储管理应用服务接口定义 + +## 功能 + +* 定义对象存储管理的应用服务接口 +* 定义对象存储管理的DTO对象 +* 定义权限管理 +* 支持公共文件、私有文件和共享文件的管理 + +## 接口定义 + +### 容器管理 +* IOssContainerAppService:容器管理服务接口 + * CreateAsync:创建容器 + * GetAsync:获取容器信息 + * GetListAsync:获取容器列表 + * GetObjectListAsync:获取容器中的对象列表 + * DeleteAsync:删除容器 + +### 对象管理 +* IOssObjectAppService:对象管理服务接口 + * CreateAsync:创建对象 + * GetAsync:获取对象信息 + * DeleteAsync:删除对象 + * DownloadAsync:下载对象 + +### 文件管理 +* IFileAppService:基础文件服务接口 +* IPublicFileAppService:公共文件服务接口 +* IPrivateFileAppService:私有文件服务接口 +* IShareFileAppService:共享文件服务接口 +* IStaticFilesAppService:静态文件服务接口 + +## 权限定义 + +* AbpOssManagement.Container:容器管理权限 + * Create:创建容器 + * Delete:删除容器 +* AbpOssManagement.OssObject:对象管理权限 + * Create:创建对象 + * Delete:删除对象 + * Download:下载对象 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/README.EN.md new file mode 100644 index 000000000..6c9031688 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/README.EN.md @@ -0,0 +1,47 @@ +# LINGYUN.Abp.OssManagement.Application + +Object Storage Management Application Service Implementation + +## Features + +* Implements application service interfaces for object storage management +* Provides concrete implementations for container management, object management, and file management +* Supports file upload, download, and sharing functionality +* Implements permission validation and access control + +## Service Implementations + +### Base Services +* FileAppServiceBase: File service base class, implements IFileAppService interface +* OssManagementApplicationServiceBase: OSS management application service base class + +### Container Management +* OssContainerAppService: Implements IOssContainerAppService interface + * Provides container creation, query, and deletion functionality + * Supports paginated container list queries + * Supports object list queries within containers + +### Object Management +* OssObjectAppService: Implements IOssObjectAppService interface + * Provides object upload, download, and deletion functionality + * Supports object metadata management + * Supports object access control + +### File Management +* PublicFileAppService: Implements IPublicFileAppService interface, handles public files +* PrivateFileAppService: Implements IPrivateFileAppService interface, handles private files +* ShareFileAppService: Implements IShareFileAppService interface, handles shared files +* StaticFilesAppService: Implements IStaticFilesAppService interface, handles static files + +## Features + +* Supports file sharding upload +* Supports breakpoint continuation +* Supports file access control +* Supports file metadata management +* Supports file sharing and expiration management + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/README.md new file mode 100644 index 000000000..1c4fcf898 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/README.md @@ -0,0 +1,47 @@ +# LINGYUN.Abp.OssManagement.Application + +对象存储管理应用服务实现 + +## 功能 + +* 实现对象存储管理的应用服务接口 +* 提供容器管理、对象管理和文件管理的具体实现 +* 支持文件上传、下载和共享功能 +* 实现权限验证和访问控制 + +## 服务实现 + +### 基础服务 +* FileAppServiceBase:文件服务基类,实现IFileAppService接口 +* OssManagementApplicationServiceBase:OSS管理应用服务基类 + +### 容器管理 +* OssContainerAppService:实现IOssContainerAppService接口 + * 提供容器的创建、查询和删除功能 + * 支持容器列表分页查询 + * 支持容器内对象列表查询 + +### 对象管理 +* OssObjectAppService:实现IOssObjectAppService接口 + * 提供对象的上传、下载和删除功能 + * 支持对象元数据管理 + * 支持对象访问权限控制 + +### 文件管理 +* PublicFileAppService:实现IPublicFileAppService接口,处理公共文件 +* PrivateFileAppService:实现IPrivateFileAppService接口,处理私有文件 +* ShareFileAppService:实现IShareFileAppService接口,处理共享文件 +* StaticFilesAppService:实现IStaticFilesAppService接口,处理静态文件 + +## 特性 + +* 支持文件分片上传 +* 支持断点续传 +* 支持文件访问权限控制 +* 支持文件元数据管理 +* 支持文件共享和过期管理 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/README.EN.md new file mode 100644 index 000000000..8db682650 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.OssManagement.Domain.Shared + +Object Storage Management Module Shared Domain Layer + +## Features + +* Defines basic types and constants for object storage management +* Defines error codes +* Defines features +* Defines settings +* Provides localization resources + +## Error Codes + +* ContainerDeleteWithStatic: Attempt to delete static container +* ContainerDeleteWithNotEmpty: Attempt to delete non-empty container +* ContainerAlreadyExists: Container already exists +* ContainerNotFound: Container not found +* ObjectDeleteWithNotEmpty: Attempt to delete non-empty object +* ObjectAlreadyExists: Object already exists +* ObjectNotFound: Object not found +* OssNameHasTooLong: OSS name too long + +## Features + +* PublicAccess: Public access +* OssObject.Enable: Enable object storage +* OssObject.AllowSharedFile: Allow file sharing +* OssObject.DownloadFile: Allow file download +* OssObject.DownloadLimit: Download limit +* OssObject.DownloadInterval: Download interval +* OssObject.UploadFile: Allow file upload +* OssObject.UploadLimit: Upload limit +* OssObject.UploadInterval: Upload interval +* OssObject.MaxUploadFileCount: Maximum upload file count + +## Settings + +* DownloadPackageSize: Download package size +* FileLimitLength: File size limit, default: 100 +* AllowFileExtensions: Allowed file extensions, default: dll,zip,rar,txt,log,xml,config,json,jpeg,jpg,png,bmp,ico,xlsx,xltx,xls,xlt,docs,dots,doc,dot,pptx,potx,ppt,pot,chm + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/README.md new file mode 100644 index 000000000..1eea189c9 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/README.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.OssManagement.Domain.Shared + +对象存储管理模块共享领域层 + +## 功能 + +* 定义对象存储管理的基础类型和常量 +* 定义错误代码 +* 定义功能特性 +* 定义设置项 +* 提供本地化资源 + +## 错误代码 + +* ContainerDeleteWithStatic:尝试删除静态容器 +* ContainerDeleteWithNotEmpty:尝试删除非空容器 +* ContainerAlreadyExists:容器已存在 +* ContainerNotFound:容器不存在 +* ObjectDeleteWithNotEmpty:尝试删除非空对象 +* ObjectAlreadyExists:对象已存在 +* ObjectNotFound:对象不存在 +* OssNameHasTooLong:OSS名称过长 + +## 功能特性 + +* PublicAccess:公共访问 +* OssObject.Enable:启用对象存储 +* OssObject.AllowSharedFile:允许文件共享 +* OssObject.DownloadFile:允许文件下载 +* OssObject.DownloadLimit:下载限制 +* OssObject.DownloadInterval:下载间隔 +* OssObject.UploadFile:允许文件上传 +* OssObject.UploadLimit:上传限制 +* OssObject.UploadInterval:上传间隔 +* OssObject.MaxUploadFileCount:最大上传文件数 + +## 设置项 + +* DownloadPackageSize:下载包大小 +* FileLimitLength:文件大小限制,默认:100 +* AllowFileExtensions:允许的文件扩展名,默认:dll,zip,rar,txt,log,xml,config,json,jpeg,jpg,png,bmp,ico,xlsx,xltx,xls,xlt,docs,dots,doc,dot,pptx,potx,ppt,pot,chm + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/README.EN.md new file mode 100644 index 000000000..1b936eb98 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/README.EN.md @@ -0,0 +1,28 @@ +# LINGYUN.Abp.OssManagement.Domain + +Object Storage Management Module Domain Layer. + +## Features + +* Provides core domain models and business logic for object storage management +* Defines basic operation interfaces for object storage containers and objects +* Provides core logic for file processing and validation +* Supports file sharding upload and breakpoint continuation +* Supports extension of multiple storage providers + +## Configuration + +### AbpOssManagementOptions + +* StaticBuckets: List of static containers that cannot be deleted +* IsCleanupEnabled: Whether to enable cleanup functionality, default: true +* CleanupPeriod: Cleanup period, default: 3,600,000 ms +* DisableTempPruning: Whether to disable cache directory cleanup job, default: false +* MaximumTempSize: Number of items to clean per batch, default: 100 +* MinimumTempLifeSpan: Minimum cache object lifespan, default: 30 minutes +* Processers: List of file stream processors + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/README.md new file mode 100644 index 000000000..6a102fc4c --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/README.md @@ -0,0 +1,28 @@ +# LINGYUN.Abp.OssManagement.Domain + +对象存储管理模块领域层。 + +## 功能 + +* 提供对象存储管理的核心领域模型和业务逻辑 +* 定义对象存储容器和对象的基本操作接口 +* 提供文件处理和验证的核心逻辑 +* 支持文件分片上传和断点续传 +* 支持多种存储提供程序的扩展 + +## 配置项 + +### AbpOssManagementOptions + +* StaticBuckets: 静态容器列表,这些容器不允许被删除 +* IsCleanupEnabled: 是否启用清理功能,默认:true +* CleanupPeriod: 清理周期,默认:3,600,000 ms +* DisableTempPruning: 是否禁用缓存目录清除作业,默认:false +* MaximumTempSize: 每批次清理数量,默认:100 +* MinimumTempLifeSpan: 最小缓存对象寿命,默认:30分钟 +* Processers: 文件流处理器列表 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/README.EN.md new file mode 100644 index 000000000..7947eeaa2 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/README.EN.md @@ -0,0 +1,53 @@ +# LINGYUN.Abp.OssManagement.FileSystem.ImageSharp + +ImageSharp image processing implementation for local file system + +## Features + +* Implements image processing for local file system based on ImageSharp +* Supports image format conversion +* Supports image resizing and cropping +* Supports watermark addition +* Supports image quality adjustment +* Supports image metadata processing + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementFileSystemImageSharpModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Image Processing Features + +Supports the following image processing operations: +* resize: Adjust image size +* crop: Crop image +* rotate: Rotate image +* watermark: Add watermark +* format: Convert image format +* quality: Adjust image quality + +## Usage Example + +Image processing parameters are passed through URL query string: + +``` +http://your-domain/api/oss-management/objects/my-image.jpg?process=image/resize,w_100,h_100/watermark,text_Hello +``` + +## Notes + +* Requires installation of ImageSharp related NuGet packages +* Recommended to configure appropriate image processing limits to prevent resource abuse +* Recommended to enable image caching for better performance + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/README.md new file mode 100644 index 000000000..775161b68 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/README.md @@ -0,0 +1,53 @@ +# LINGYUN.Abp.OssManagement.FileSystem.ImageSharp + +本地文件系统的ImageSharp图像处理实现 + +## 功能 + +* 基于ImageSharp实现本地文件系统的图像处理 +* 支持图像格式转换 +* 支持图像缩放和裁剪 +* 支持图像水印添加 +* 支持图像质量调整 +* 支持图像元数据处理 + +## 配置使用 + +模块按需引用: + +```csharp +[DependsOn(typeof(AbpOssManagementFileSystemImageSharpModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 图像处理功能 + +支持以下图像处理操作: +* resize:调整图像大小 +* crop:裁剪图像 +* rotate:旋转图像 +* watermark:添加水印 +* format:转换图像格式 +* quality:调整图像质量 + +## 使用示例 + +图像处理参数通过URL查询字符串传递: + +``` +http://your-domain/api/oss-management/objects/my-image.jpg?process=image/resize,w_100,h_100/watermark,text_Hello +``` + +## 注意事项 + +* 需要安装ImageSharp相关的NuGet包 +* 建议配置适当的图像处理限制以避免资源滥用 +* 建议启用图像缓存以提高性能 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/README.EN.md new file mode 100644 index 000000000..bd5277a37 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/README.EN.md @@ -0,0 +1,52 @@ +# LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp + +ImageSharp image processing implementation module for local file system + +## Features + +* Implements image processing functionality for local file system based on ImageSharp +* Implements IImageProcessor interface +* Provides high-performance image processing capabilities +* Supports multiple image formats +* Provides rich image processing options + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementFileSystemImagingImageSharpModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Image Processing Features + +Supports the following image processing operations: +* Scaling: Supports multiple scaling modes and algorithms +* Cropping: Supports rectangular and circular cropping +* Rotation: Supports rotation at any angle +* Watermark: Supports text and image watermarks +* Format Conversion: Supports conversion between multiple image formats +* Quality Adjustment: Supports compression quality control + +## Performance Optimization + +* Uses ImageSharp's high-performance algorithms +* Supports image processing cache +* Supports asynchronous processing +* Supports memory optimization + +## Notes + +* Requires installation of ImageSharp related NuGet packages +* Recommended to configure appropriate image processing limits +* Recommended to enable image caching +* Pay attention to memory usage management + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/README.md new file mode 100644 index 000000000..74dd84cc6 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/README.md @@ -0,0 +1,52 @@ +# LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp + +本地文件系统的ImageSharp图像处理实现模块 + +## 功能 + +* 基于ImageSharp实现本地文件系统的图像处理功能 +* 实现IImageProcessor接口 +* 提供高性能的图像处理能力 +* 支持多种图像格式 +* 提供丰富的图像处理选项 + +## 配置使用 + +模块按需引用: + +```csharp +[DependsOn(typeof(AbpOssManagementFileSystemImagingImageSharpModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 图像处理功能 + +支持以下图像处理操作: +* 缩放:支持多种缩放模式和算法 +* 裁剪:支持矩形裁剪和圆形裁剪 +* 旋转:支持任意角度旋转 +* 水印:支持文字水印和图片水印 +* 格式转换:支持多种图片格式之间的转换 +* 质量调整:支持压缩质量控制 + +## 性能优化 + +* 使用ImageSharp的高性能算法 +* 支持图像处理缓存 +* 支持异步处理 +* 支持内存优化 + +## 注意事项 + +* 需要安装ImageSharp相关的NuGet包 +* 建议配置适当的图像处理限制 +* 建议启用图像缓存 +* 注意内存使用管理 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/README.EN.md new file mode 100644 index 000000000..713236329 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.OssManagement.FileSystem.Imaging + +Base image processing module for local file system + +## Features + +* Provides basic image processing functionality for local file system +* Defines image processing interfaces and abstract classes +* Supports image processing extensions +* Provides image processing pipeline +* Supports image processing cache + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementFileSystemImagingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Core Interfaces + +* IImageProcessor: Image processor interface +* IImageProcessorFactory: Image processor factory interface +* IImageProcessorCache: Image processor cache interface +* IImageProcessorPipeline: Image processing pipeline interface + +## Extension Features + +* Supports custom image processors +* Supports custom image processing pipelines +* Supports custom image caching strategies +* Supports image processing parameter validation + +## Related Modules + +* LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp: ImageSharp-based implementation + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/README.md new file mode 100644 index 000000000..28e3a82b8 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/README.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.OssManagement.FileSystem.Imaging + +本地文件系统的图像处理基础模块 + +## 功能 + +* 提供本地文件系统的图像处理基础功能 +* 定义图像处理接口和抽象类 +* 支持图像处理扩展 +* 提供图像处理管道 +* 支持图像处理缓存 + +## 配置使用 + +模块按需引用: + +```csharp +[DependsOn(typeof(AbpOssManagementFileSystemImagingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 核心接口 + +* IImageProcessor:图像处理器接口 +* IImageProcessorFactory:图像处理器工厂接口 +* IImageProcessorCache:图像处理缓存接口 +* IImageProcessorPipeline:图像处理管道接口 + +## 扩展功能 + +* 支持自定义图像处理器 +* 支持自定义图像处理管道 +* 支持自定义图像缓存策略 +* 支持图像处理参数验证 + +## 相关模块 + +* LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp:基于ImageSharp的具体实现 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/README.EN.md new file mode 100644 index 000000000..8554b7730 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/README.EN.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.OssManagement.FileSystem + +Local file system OSS container interface implementation + +## Features + +* Implements object storage management based on local file system +* Supports basic operations including file upload, download, and deletion +* Supports file sharding upload and breakpoint continuation +* Supports automatic creation and management of file directories +* Supports file system-based access control +* Supports storage and management of file metadata + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementFileSystemModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Details + +Required configuration items: +* BasePath: Base path for file storage +* AppendContainerNameToBasePath: Whether to append container name to base path +* HttpServer: HTTP server configuration + * Scheme: Protocol scheme (http/https) + * Host: Host address + * Port: Port number + +## Related Modules + +* LINGYUN.Abp.OssManagement.FileSystem.ImageSharp: Provides image processing functionality +* LINGYUN.Abp.OssManagement.FileSystem.Imaging: Provides basic image functionality support +* LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp: ImageSharp-based image processing implementation + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/README.md index ae3c3c1bb..f578d8014 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/README.md +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/README.md @@ -2,6 +2,15 @@ 本地文件系统oss容器接口 +## 功能 + +* 实现基于本地文件系统的对象存储管理 +* 支持文件上传、下载、删除等基本操作 +* 支持文件分片上传和断点续传 +* 支持文件目录的自动创建和管理 +* 支持基于文件系统的访问控制 +* 支持文件元数据的存储和管理 + ## 配置使用 模块按需引用 @@ -13,3 +22,24 @@ public class YouProjectModule : AbpModule // other } ``` + +## 配置说明 + +需要配置以下关键信息: +* BasePath:文件存储的基础路径 +* AppendContainerNameToBasePath:是否将容器名称附加到基础路径 +* HttpServer:HTTP服务器配置 + * Scheme:协议方案(http/https) + * Host:主机地址 + * Port:端口号 + +## 相关模块 + +* LINGYUN.Abp.OssManagement.FileSystem.ImageSharp:提供图像处理功能 +* LINGYUN.Abp.OssManagement.FileSystem.Imaging:提供基础图像功能支持 +* LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp:基于ImageSharp的图像处理实现 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/README.EN.md new file mode 100644 index 000000000..77e14fa3e --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/README.EN.md @@ -0,0 +1,47 @@ +# LINGYUN.Abp.OssManagement.HttpApi.Client + +Object Storage Management HTTP API Client + +## Features + +* Provides HTTP API client proxy for object storage management +* Implements remote service calls +* Supports dynamic API client proxy generation + +## Usage + +1. Add module dependency: + +```csharp +[DependsOn(typeof(AbpOssManagementHttpApiClientModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Configure remote services: + +```json +{ + "RemoteServices": { + "Default": { + "BaseUrl": "http://your-api-server/" + } + } +} +``` + +## Available Services + +* IOssContainerAppService: Container management service +* IOssObjectAppService: Object management service +* IPublicFileAppService: Public file service +* IPrivateFileAppService: Private file service +* IShareFileAppService: Shared file service +* IStaticFilesAppService: Static file service + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/README.md new file mode 100644 index 000000000..749d26a5c --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/README.md @@ -0,0 +1,47 @@ +# LINGYUN.Abp.OssManagement.HttpApi.Client + +对象存储管理HTTP API客户端 + +## 功能 + +* 提供对象存储管理的HTTP API客户端代理 +* 实现远程服务调用 +* 支持动态API客户端代理生成 + +## 使用方式 + +1. 添加模块依赖: + +```csharp +[DependsOn(typeof(AbpOssManagementHttpApiClientModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 配置远程服务: + +```json +{ + "RemoteServices": { + "Default": { + "BaseUrl": "http://your-api-server/" + } + } +} +``` + +## 可用服务 + +* IOssContainerAppService:容器管理服务 +* IOssObjectAppService:对象管理服务 +* IPublicFileAppService:公共文件服务 +* IPrivateFileAppService:私有文件服务 +* IShareFileAppService:共享文件服务 +* IStaticFilesAppService:静态文件服务 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..6942626b1 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/README.EN.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.OssManagement.HttpApi + +Object Storage Management HTTP API Layer + +## Features + +* Provides HTTP API interfaces for object storage management +* Implements RESTful API design +* Supports HTTP interfaces for file upload, download, and sharing +* Provides permission validation and access control + +## API Controllers + +### Container Management +* OssContainerController + * POST /api/oss-management/containers: Create container + * GET /api/oss-management/containers/{name}: Get container information + * GET /api/oss-management/containers: Get container list + * DELETE /api/oss-management/containers/{name}: Delete container + +### Object Management +* OssObjectController + * POST /api/oss-management/objects: Upload object + * GET /api/oss-management/objects/{*path}: Get object + * DELETE /api/oss-management/objects/{*path}: Delete object + +### File Management +* PublicFilesController: Handles public file access +* PrivateFilesController: Handles private file access +* ShareFilesController: Handles shared file access +* StaticFilesController: Handles static file access + +## Features + +* Supports file sharding upload +* Supports breakpoint continuation +* Supports file streaming download +* Supports file access control +* Supports file metadata management + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/README.md new file mode 100644 index 000000000..ef58a6052 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/README.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.OssManagement.HttpApi + +对象存储管理HTTP API层 + +## 功能 + +* 提供对象存储管理的HTTP API接口 +* 实现RESTful风格的API设计 +* 支持文件上传、下载和共享的HTTP接口 +* 提供权限验证和访问控制 + +## API控制器 + +### 容器管理 +* OssContainerController + * POST /api/oss-management/containers:创建容器 + * GET /api/oss-management/containers/{name}:获取容器信息 + * GET /api/oss-management/containers:获取容器列表 + * DELETE /api/oss-management/containers/{name}:删除容器 + +### 对象管理 +* OssObjectController + * POST /api/oss-management/objects:上传对象 + * GET /api/oss-management/objects/{*path}:获取对象 + * DELETE /api/oss-management/objects/{*path}:删除对象 + +### 文件管理 +* PublicFilesController:处理公共文件访问 +* PrivateFilesController:处理私有文件访问 +* ShareFilesController:处理共享文件访问 +* StaticFilesController:处理静态文件访问 + +## 特性 + +* 支持文件分片上传 +* 支持断点续传 +* 支持文件流式下载 +* 支持文件访问权限控制 +* 支持文件元数据管理 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.ImageSharp/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.ImageSharp/README.EN.md new file mode 100644 index 000000000..980106b6c --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.ImageSharp/README.EN.md @@ -0,0 +1,47 @@ +# LINGYUN.Abp.OssManagement.ImageSharp + +ImageSharp-based image processing interface for OSS objects + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementFileSystemImageSharpModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Features + +* Implements image processing functionality for OSS objects based on ImageSharp +* Supports image format conversion +* Supports image resizing and cropping +* Supports watermark addition +* Supports image quality adjustment +* Supports image metadata processing + +## Image Processing Features + +Supports the following image processing operations: +* resize: Adjust image size +* crop: Crop image +* rotate: Rotate image +* watermark: Add watermark +* format: Convert image format +* quality: Adjust image quality + +## Usage Example + +Image processing parameters are passed through URL query string: + +``` +http://your-domain/api/oss-management/objects/my-image.jpg?process=image/resize,w_100,h_100/watermark,text_Hello +``` + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.ImageSharp/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.ImageSharp/README.md index 0ef3abd8b..66837efe7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.ImageSharp/README.md +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.ImageSharp/README.md @@ -13,3 +13,35 @@ public class YouProjectModule : AbpModule // other } ``` + +## 功能 + +* 基于ImageSharp实现OSS对象的图像处理功能 +* 支持图像格式转换 +* 支持图像缩放和裁剪 +* 支持图像水印添加 +* 支持图像质量调整 +* 支持图像元数据处理 + +## 图像处理功能 + +支持以下图像处理操作: +* resize:调整图像大小 +* crop:裁剪图像 +* rotate:旋转图像 +* watermark:添加水印 +* format:转换图像格式 +* quality:调整图像质量 + +## 使用示例 + +图像处理参数通过URL查询字符串传递: + +``` +http://your-domain/api/oss-management/objects/my-image.jpg?process=image/resize,w_100,h_100/watermark,text_Hello +``` + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Imaging/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Imaging/README.EN.md new file mode 100644 index 000000000..4e59eceea --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Imaging/README.EN.md @@ -0,0 +1,51 @@ +# LINGYUN.Abp.OssManagement.Imaging + +Object Storage Management Image Processing Module + +## Features + +* Provides basic image processing functionality for object storage +* Supports image format conversion +* Supports image resizing and cropping +* Supports watermark addition +* Supports image quality adjustment +* Supports image metadata processing + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementImagingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Image Processing Features + +Supports the following image processing operations: +* resize: Adjust image size +* crop: Crop image +* rotate: Rotate image +* watermark: Add watermark +* format: Convert image format +* quality: Adjust image quality + +## Usage Example + +Image processing parameters are passed through URL query string: + +``` +http://your-domain/api/oss-management/objects/my-image.jpg?process=image/resize,w_100,h_100/watermark,text_Hello +``` + +## Related Modules + +* LINGYUN.Abp.OssManagement.ImageSharp: Provides ImageSharp-based implementation + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Imaging/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Imaging/README.md new file mode 100644 index 000000000..a8543a13e --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Imaging/README.md @@ -0,0 +1,51 @@ +# LINGYUN.Abp.OssManagement.Imaging + +对象存储管理图像处理模块 + +## 功能 + +* 提供对象存储的图像处理基础功能 +* 支持图像格式转换 +* 支持图像缩放和裁剪 +* 支持图像水印添加 +* 支持图像质量调整 +* 支持图像元数据处理 + +## 配置使用 + +模块按需引用: + +```csharp +[DependsOn(typeof(AbpOssManagementImagingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 图像处理功能 + +支持以下图像处理操作: +* resize:调整图像大小 +* crop:裁剪图像 +* rotate:旋转图像 +* watermark:添加水印 +* format:转换图像格式 +* quality:调整图像质量 + +## 使用示例 + +图像处理参数通过URL查询字符串传递: + +``` +http://your-domain/api/oss-management/objects/my-image.jpg?process=image/resize,w_100,h_100/watermark,text_Hello +``` + +## 相关模块 + +* LINGYUN.Abp.OssManagement.ImageSharp:提供基于ImageSharp的具体实现 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/README.EN.md new file mode 100644 index 000000000..3fde7e614 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/README.EN.md @@ -0,0 +1,40 @@ +# LINGYUN.Abp.OssManagement.Minio + +MinIO implementation for OSS container management interface + +## Features + +* Implements object storage management based on MinIO +* Supports basic operations including file upload, download, and deletion +* Supports file sharding upload and breakpoint continuation +* Integrates with MinIO access control and security mechanisms +* Supports custom bucket policies + +## Configuration + +Module reference as needed + +Please refer to [BlobStoring Minio](https://abp.io/docs/latest/framework/infrastructure/blob-storing/minio) for related configuration items. + +```csharp +[DependsOn(typeof(AbpOssManagementMinioModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Details + +Required configuration items: +* EndPoint: MinIO server address +* AccessKey: Access key +* SecretKey: Secret key +* BucketName: Bucket name +* WithSSL: Whether to enable SSL connection +* CreateBucketIfNotExists: Whether to create bucket if it doesn't exist + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/README.md index 8155334ca..68249fa60 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/README.md +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/README.md @@ -2,6 +2,14 @@ Oss容器管理接口的Minio实现 +## 功能 + +* 实现基于MinIO的对象存储管理 +* 支持文件上传、下载、删除等基本操作 +* 支持文件分片上传和断点续传 +* 集成MinIO的访问控制和安全机制 +* 支持自定义存储桶策略 + ## 配置使用 模块按需引用 @@ -16,4 +24,17 @@ public class YouProjectModule : AbpModule } ``` +## 配置说明 + +需要配置以下关键信息: +* EndPoint:MinIO服务器地址 +* AccessKey:访问密钥 +* SecretKey:密钥密码 +* BucketName:存储桶名称 +* WithSSL:是否启用SSL连接 +* CreateBucketIfNotExists:不存在时是否创建存储桶 + +## 链接 +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/README.EN.md new file mode 100644 index 000000000..9f6614083 --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/README.EN.md @@ -0,0 +1,43 @@ +# LINGYUN.Abp.OssManagement.Nexus + +OSS Management implementation for Nexus Repository + +## Features + +* Implements object storage management based on Nexus Raw repository +* Supports basic operations including file upload, download, and deletion +* Supports file sharding upload and breakpoint continuation +* Integrates with Nexus access control and security mechanisms +* Supports object expiration management + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementNexusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Details + +Required configuration items: +* BaseUrl: Nexus server address +* Repository: Raw repository name +* Username: Access username +* Password: Access password +* Format: Repository format, default is raw + +## Notes + +* This module requires Nexus server to support Raw repository type +* Ensure the configured user has sufficient permissions to access the Raw repository +* HTTPS is recommended for secure transmission + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/README.md new file mode 100644 index 000000000..98de7eb1d --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/README.md @@ -0,0 +1,43 @@ +# LINGYUN.Abp.OssManagement.Nexus + +Nexus仓库的OSS管理模块实现 + +## 功能 + +* 实现基于Nexus Raw仓库的对象存储管理 +* 支持文件上传、下载和删除等基本操作 +* 支持文件分片上传和断点续传 +* 集成Nexus的访问控制和安全机制 +* 支持对象过期管理 + +## 配置使用 + +模块按需引用: + +```csharp +[DependsOn(typeof(AbpOssManagementNexusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置说明 + +需要配置以下关键信息: +* BaseUrl:Nexus服务器地址 +* Repository:Raw仓库名称 +* Username:访问用户名 +* Password:访问密码 +* Format:仓库格式,默认为raw + +## 注意事项 + +* 此模块需要Nexus服务器支持Raw仓库类型 +* 需要确保配置的用户具有足够的权限访问Raw仓库 +* 建议使用HTTPS进行安全传输 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/README.EN.md new file mode 100644 index 000000000..4acfd433d --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/README.EN.md @@ -0,0 +1,49 @@ +# LINGYUN.Abp.OssManagement.SettingManagement + +Object Storage Management Settings Management Module + +## Features + +* Provides settings management functionality for object storage management +* Implements settings reading and modification +* Supports multi-tenant configuration +* Supports different levels of settings management + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Settings + +### Basic Settings +* DownloadPackageSize: Download package size +* FileLimitLength: File size limit +* AllowFileExtensions: Allowed file extensions + +### API Endpoints + +* GET /api/oss-management/settings: Get settings +* PUT /api/oss-management/settings: Update settings + +### Permissions + +* AbpOssManagement.Setting: Settings management permission + +## Notes + +* Appropriate permissions are required to access settings +* Some settings may require application restart to take effect +* It's recommended to backup current configuration before modifying settings + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/README.md new file mode 100644 index 000000000..30e6dcb4d --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/README.md @@ -0,0 +1,49 @@ +# LINGYUN.Abp.OssManagement.SettingManagement + +对象存储管理设置管理模块 + +## 功能 + +* 提供对象存储管理的设置管理功能 +* 实现设置的读取和修改 +* 支持多租户配置 +* 支持不同级别的设置管理 + +## 配置使用 + +模块按需引用: + +```csharp +[DependsOn(typeof(AbpOssManagementSettingManagementModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 设置项 + +### 基础设置 +* DownloadPackageSize:下载包大小 +* FileLimitLength:文件大小限制 +* AllowFileExtensions:允许的文件扩展名 + +### API接口 + +* GET /api/oss-management/settings:获取设置 +* PUT /api/oss-management/settings:更新设置 + +### 权限 + +* AbpOssManagement.Setting:设置管理权限 + +## 注意事项 + +* 需要具有相应的权限才能访问设置 +* 某些设置可能需要重启应用才能生效 +* 建议在修改设置前备份当前配置 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/README.EN.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/README.EN.md new file mode 100644 index 000000000..e182aa04a --- /dev/null +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.OssManagement.Tencent + +Tencent Cloud OSS container interface implementation + +## Features + +* Implements object storage management based on Tencent Cloud COS +* Supports basic operations including file upload, download, and deletion +* Supports file sharding upload and breakpoint continuation +* Integrates with Tencent Cloud COS access control and security mechanisms +* Supports object expiration management +* Supports temporary key access + +## Configuration + +Module reference as needed: + +```csharp +[DependsOn(typeof(AbpOssManagementTencentCloudModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Details + +Required configuration items: +* SecretId: Tencent Cloud access key ID +* SecretKey: Tencent Cloud access key secret +* Region: Region information +* AppId: Application ID +* Bucket: Bucket name +* SecurityToken: Optional temporary security token + +## Notes + +* Recommended to use sub-account keys for access +* Recommended to enable server-side encryption +* Recommended to configure appropriate bucket policies +* Recommended to enable logging functionality + +## Links + +* [中文文档](./README.md) +* [Module documentation](../README.md) diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/README.md index e46d7a4ba..3310a28ce 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/README.md +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/README.md @@ -2,6 +2,15 @@ 腾讯云oss容器接口 +## 功能 + +* 实现基于腾讯云COS的对象存储管理 +* 支持文件上传、下载和删除等基本操作 +* 支持文件分片上传和断点续传 +* 集成腾讯云COS的访问控制和安全机制 +* 支持对象过期管理 +* 支持临时密钥访问 + ## 配置使用 模块按需引用 @@ -13,3 +22,25 @@ public class YouProjectModule : AbpModule // other } ``` + +## 配置说明 + +需要配置以下关键信息: +* SecretId:腾讯云访问密钥ID +* SecretKey:腾讯云访问密钥密码 +* Region:地域信息 +* AppId:应用ID +* Bucket:存储桶名称 +* SecurityToken:可选的临时安全令牌 + +## 注意事项 + +* 建议使用子账号密钥进行访问 +* 建议开启服务端加密 +* 建议配置适当的存储桶策略 +* 建议启用日志记录功能 + +## 链接 + +* [English documentation](./README.EN.md) +* [模块说明](../README.md) diff --git a/aspnet-core/modules/oss-management/README.md b/aspnet-core/modules/oss-management/README.md index 047df60b7..47ae00b30 100644 --- a/aspnet-core/modules/oss-management/README.md +++ b/aspnet-core/modules/oss-management/README.md @@ -1,62 +1,64 @@ -# Oss-Management - -File-Management更名为Oss-Management - -## 模块说明 - -### 基础模块 - -* [LINGYUN.Abp.OssManagement.Domain.Shared](./LINGYUN.Abp.OssManagement.Domain.Shared) 领域层公共模块,定义了错误代码、本地化、模块设置 -* [LINGYUN.Abp.OssManagement.Domain](./LINGYUN.Abp.OssManagement.Domain) 领域层模块,定义了抽象的Oss容器与对象管理接口 -* [LINGYUN.Abp.OssManagement.Application.Contracts](./LINGYUN.Abp.OssManagement.Application.Contracts) 应用服务层公共模块,定义了管理Oss的外部接口、权限、功能限制策略 -* [LINGYUN.Abp.OssManagement.Application](./LINGYUN.Abp.OssManagement.Application) 应用服务层实现,实现了Oss管理接口 -* [LINGYUN.Abp.OssManagement.HttpApi](./LINGYUN.Abp.OssManagement.HttpApi) RestApi实现,实现了独立的对外RestApi接口 -* [LINGYUN.Abp.OssManagement.HttpApi.Client](./LINGYUN.Abp.OssManagement.HttpApi.Client) 客户端代理模块, 简化远程调用过程 -* [LINGYUN.Abp.OssManagement.SettingManagement](./LINGYUN.Abp.OssManagement.SettingManagement) 设置管理模块,对外暴露自身的设置管理,用于网关聚合 - -### 高阶模块 - -* [LINGYUN.Abp.BlobStoring.OssManagement](./LINGYUN.Abp.BlobStoring.OssManagement) abp框架对象存储提供者**IBlobProvider**的Oss管理模块实现, 依赖于Oss客户端代理模块 -* [LINGYUN.Abp.OssManagement.Aliyun](./LINGYUN.Abp.OssManagement.Aliyun) Oss管理的阿里云实现,实现了部分阿里云Oss服务的容器与对象管理 -* [LINGYUN.Abp.OssManagement.FileSystem](./LINGYUN.Abp.OssManagement.FileSystem) Oss管理的本地文件系统实现,实现了部分本地文件系统的容器(目录)与对象(文件/目录)管理 -* [LINGYUN.Abp.OssManagement.ImageSharp](./LINGYUN.Abp.OssManagement.ImageSharp) Oss对象的ImageSharp扩展,当前端传递需求处理对象时,此模块用于实现基于图形文件流的处理 -* [LINGYUN.Abp.OssManagement.Imaging](./LINGYUN.Abp.OssManagement.Imaging) Oss对象的Volo.Abp.Imaging扩展 -* [LINGYUN.Abp.OssManagement.Imaging.ImageSharp](./LINGYUN.Abp.OssManagement.Imaging.ImageSharp) Oss对象的Volo.Abp.Imaging.ImageSharp扩展 -* [LINGYUN.Abp.OssManagement.Nexus](./LINGYUN.Abp.OssManagement.Nexus) Oss管理的Nexus实现,管理来自私有Nexus仓库的RAW存储类型 -* [LINGYUN.Abp.OssManagement.Minio](./LINGYUN.Abp.OssManagement.Minio) Oss管理的Minio实现,管理基于Minio的对象存储服务 -* [LINGYUN.Abp.OssManagement.Tencent](./LINGYUN.Abp.OssManagement.Tencent) Oss管理的腾讯云实现,实现了部分腾讯云Oss服务的容器与对象管理(未完全实现) - -### 权限定义 - -* AbpOssManagement.Container 授权对象是否允许访问容器(bucket) -* AbpOssManagement.Container.Create 授权对象是否允许创建容器(bucket) -* AbpOssManagement.Container.Delete 授权对象是否允许删除容器(bucket) -* AbpOssManagement.OssObject 授权对象是否允许访问Oss对象 -* AbpOssManagement.OssObject.Create 授权对象是否允许创建Oss对象 -* AbpOssManagement.OssObject.Delete 授权对象是否允许删除Oss对象 -* AbpOssManagement.OssObject.Download 授权对象是否允许下载Oss对象 - -### 功能定义 - -* AbpOssManagement.OssObject.DownloadFile 用户可以下载文件 -* AbpOssManagement.OssObject.DownloadLimit 用户在周期内允许下载文件的最大次数,范围0-1000000 -* AbpOssManagement.OssObject.DownloadInterval 用户限制下载文件次数的周期,时钟刻度:月,默认: 1,范围1-12 -* AbpOssManagement.OssObject.UploadFile 用户可以上传文件 -* AbpOssManagement.OssObject.UploadLimit 用户在周期内允许上传文件的最大次数,范围0-1000000 -* AbpOssManagement.OssObject.UploadInterval 用户限制上传文件次数的周期,时钟刻度:月,默认: 1,范围1-12 -* AbpOssManagement.OssObject.MaxUploadFileCount 单次上传文件的数量,未实现 - -### 配置定义 - -* Abp.OssManagement.DownloadPackageSize 下载分包大小,分块下载时单次传输的数据大小,未实现 -* Abp.OssManagement.FileLimitLength 上传文件限制大小,默认:100 -* Abp.OssManagement.AllowFileExtensions 允许的上传文件扩展名,多个扩展名以逗号分隔,默认:dll,zip,rar,txt,log,xml,config,json,jpeg,jpg,png,bmp,ico,xlsx,xltx,xls,xlt,docs,dots,doc,dot,pptx,potx,ppt,pot,chm - -## 更新日志 - -*【2021-03-10】 变更FileManagement命名空间为OssManagement -*【2021-10-22】 增加PublicFilesController用于身份认证通过的用户上传/下载文件,所有操作限定在用户目录下 -*【2021-12-13】 增加LINGYUN.Abp.BlobStoring.OssManagement用于实现Oss代理二进制文件存储 -*【2023-09-04】 集成Volo.Abp.Imaging模块用于图形文件流处理 -*【2023-10-11】 集成Nexus仓库实现基于Nexus Raw类型存储(**未完善**) -*【2024-10-24】 集成Volo.Abp.BlobStoring.Minio模块用于实现基于Minio的文件存储 \ No newline at end of file +# Oss-Management + +File-Management更名为Oss-Management + +## 模块说明 + +### 基础模块 + +* [LINGYUN.Abp.OssManagement.Domain.Shared](./LINGYUN.Abp.OssManagement.Domain.Shared) 领域层公共模块,定义了错误代码、本地化、模块设置 +* [LINGYUN.Abp.OssManagement.Domain](./LINGYUN.Abp.OssManagement.Domain) 领域层模块,定义了抽象的Oss容器与对象管理接口 +* [LINGYUN.Abp.OssManagement.Application.Contracts](./LINGYUN.Abp.OssManagement.Application.Contracts) 应用服务层公共模块,定义了管理Oss的外部接口、权限、功能限制策略 +* [LINGYUN.Abp.OssManagement.Application](./LINGYUN.Abp.OssManagement.Application) 应用服务层实现,实现了Oss管理接口 +* [LINGYUN.Abp.OssManagement.HttpApi](./LINGYUN.Abp.OssManagement.HttpApi) RestApi实现,实现了独立的对外RestApi接口 +* [LINGYUN.Abp.OssManagement.HttpApi.Client](./LINGYUN.Abp.OssManagement.HttpApi.Client) 客户端代理模块, 简化远程调用过程 +* [LINGYUN.Abp.OssManagement.SettingManagement](./LINGYUN.Abp.OssManagement.SettingManagement) 设置管理模块,对外暴露自身的设置管理,用于网关聚合 + +### 高阶模块 + +* [LINGYUN.Abp.BlobStoring.OssManagement](./LINGYUN.Abp.BlobStoring.OssManagement) abp框架对象存储提供者**IBlobProvider**的Oss管理模块实现, 依赖于Oss客户端代理模块 +* [LINGYUN.Abp.OssManagement.Aliyun](./LINGYUN.Abp.OssManagement.Aliyun) Oss管理的阿里云实现,实现了部分阿里云Oss服务的容器与对象管理 +* [LINGYUN.Abp.OssManagement.FileSystem](./LINGYUN.Abp.OssManagement.FileSystem) Oss管理的本地文件系统实现,实现了部分本地文件系统的容器(目录)与对象(文件/目录)管理 +* [LINGYUN.Abp.OssManagement.ImageSharp](./LINGYUN.Abp.OssManagement.ImageSharp) Oss对象的ImageSharp扩展,当前端传递需求处理对象时,此模块用于实现基于图形文件流的处理 +* [LINGYUN.Abp.OssManagement.Imaging](./LINGYUN.Abp.OssManagement.Imaging) Oss对象的Volo.Abp.Imaging扩展 +* [LINGYUN.Abp.OssManagement.Imaging.ImageSharp](./LINGYUN.Abp.OssManagement.Imaging.ImageSharp) Oss对象的Volo.Abp.Imaging.ImageSharp扩展 +* [LINGYUN.Abp.OssManagement.FileSystem.Imaging](./LINGYUN.Abp.OssManagement.FileSystem.Imaging) 本地文件系统的图像处理基础模块,提供图像处理接口和管道 +* [LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp](./LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp) 基于ImageSharp的本地文件系统图像处理实现,提供高性能图像处理功能 +* [LINGYUN.Abp.OssManagement.Nexus](./LINGYUN.Abp.OssManagement.Nexus) Oss管理的Nexus实现,管理来自私有Nexus仓库的RAW存储类型 +* [LINGYUN.Abp.OssManagement.Minio](./LINGYUN.Abp.OssManagement.Minio) Oss管理的Minio实现,管理基于Minio的对象存储服务 +* [LINGYUN.Abp.OssManagement.Tencent](./LINGYUN.Abp.OssManagement.Tencent) Oss管理的腾讯云实现,实现了部分腾讯云Oss服务的容器与对象管理(未完全实现) + +### 权限定义 + +* AbpOssManagement.Container 授权对象是否允许访问容器(bucket) +* AbpOssManagement.Container.Create 授权对象是否允许创建容器(bucket) +* AbpOssManagement.Container.Delete 授权对象是否允许删除容器(bucket) +* AbpOssManagement.OssObject 授权对象是否允许访问Oss对象 +* AbpOssManagement.OssObject.Create 授权对象是否允许创建Oss对象 +* AbpOssManagement.OssObject.Delete 授权对象是否允许删除Oss对象 +* AbpOssManagement.OssObject.Download 授权对象是否允许下载Oss对象 + +### 功能定义 + +* AbpOssManagement.OssObject.DownloadFile 用户可以下载文件 +* AbpOssManagement.OssObject.DownloadLimit 用户在周期内允许下载文件的最大次数,范围0-1000000 +* AbpOssManagement.OssObject.DownloadInterval 用户限制下载文件次数的周期,时钟刻度:月,默认: 1,范围1-12 +* AbpOssManagement.OssObject.UploadFile 用户可以上传文件 +* AbpOssManagement.OssObject.UploadLimit 用户在周期内允许上传文件的最大次数,范围0-1000000 +* AbpOssManagement.OssObject.UploadInterval 用户限制上传文件次数的周期,时钟刻度:月,默认: 1,范围1-12 +* AbpOssManagement.OssObject.MaxUploadFileCount 单次上传文件的数量,未实现 + +### 配置定义 + +* Abp.OssManagement.DownloadPackageSize 下载分包大小,分块下载时单次传输的数据大小,未实现 +* Abp.OssManagement.FileLimitLength 上传文件限制大小,默认:100 +* Abp.OssManagement.AllowFileExtensions 允许的上传文件扩展名,多个扩展名以逗号分隔,默认:dll,zip,rar,txt,log,xml,config,json,jpeg,jpg,png,bmp,ico,xlsx,xltx,xls,xlt,docs,dots,doc,dot,pptx,potx,ppt,pot,chm + +## 更新日志 + +*【2021-03-10】 变更FileManagement命名空间为OssManagement +*【2021-10-22】 增加PublicFilesController用于身份认证通过的用户上传/下载文件,所有操作限定在用户目录下 +*【2021-12-13】 增加LINGYUN.Abp.BlobStoring.OssManagement用于实现Oss代理二进制文件存储 +*【2023-09-04】 集成Volo.Abp.Imaging模块用于图形文件流处理 +*【2023-10-11】 集成Nexus仓库实现基于Nexus Raw类型存储(**未完善**) +*【2024-10-24】 集成Volo.Abp.BlobStoring.Minio模块用于实现基于Minio的文件存储 \ No newline at end of file diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..ff6b78984 --- /dev/null +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/README.EN.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.PermissionManagement.Application.Contracts + +Permission management application service contract module, defining interfaces and DTOs for permission management. + +## Features + +* Permission Group Definition Interfaces + * Provides CRUD operation interfaces for permission groups + * Supports pagination query for permission groups +* Permission Definition Interfaces + * Provides CRUD operation interfaces for permissions + * Supports pagination query for permissions +* Permission Definition DTOs + * PermissionGroupDefinitionDto - Permission group definition DTO + * PermissionDefinitionDto - Permission definition DTO + * Supports permission provider configuration (Role, User, OrganizationUnit, etc.) +* Permission Error Codes + * 001100 - Permission group already exists + * 001010 - Static permission group is not allowed to change + * 001404 - Permission group not found + * 002100 - Permission already exists + * 002010 - Static permission is not allowed to change + * 002101 - Could not retrieve the group definition of permission + * 002404 - Permission not found + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpPermissionManagementApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Permission Definition + +```csharp +public class YourPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var permissionGroup = context.AddGroup( + "YourPermissionGroup", + "Your Permission Group"); + + var permission = permissionGroup.AddPermission( + "YourPermission", + "Your Permission", + MultiTenancySides.Both); + + permission.AddChild( + "Create", + "Create Permission"); + } +} +``` + +## See Also + +* [LINGYUN.Abp.PermissionManagement.Application](../LINGYUN.Abp.PermissionManagement.Application/README.EN.md) +* [LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits](../LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.EN.md) +* [LINGYUN.Abp.PermissionManagement.HttpApi](../LINGYUN.Abp.PermissionManagement.HttpApi/README.EN.md) diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/README.md b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/README.md new file mode 100644 index 000000000..43916fce5 --- /dev/null +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/README.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.PermissionManagement.Application.Contracts + +权限管理应用服务契约模块,定义了权限管理的接口和DTO。 + +## 功能特性 + +* 权限组定义接口 + * 提供权限组的CRUD操作接口 + * 支持权限组分页查询 +* 权限定义接口 + * 提供权限的CRUD操作接口 + * 支持权限分页查询 +* 权限定义DTO + * PermissionGroupDefinitionDto - 权限组定义DTO + * PermissionDefinitionDto - 权限定义DTO + * 支持权限提供者配置(Role、User、OrganizationUnit等) +* 权限错误代码定义 + * 001100 - 权限组已存在 + * 001010 - 静态权限组不允许修改 + * 001404 - 权限组不存在 + * 002100 - 权限已存在 + * 002010 - 静态权限不允许修改 + * 002101 - 无法获取权限的组定义 + * 002404 - 权限不存在 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpPermissionManagementApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 权限定义 + +```csharp +public class YourPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var permissionGroup = context.AddGroup( + "YourPermissionGroup", + "Your Permission Group"); + + var permission = permissionGroup.AddPermission( + "YourPermission", + "Your Permission", + MultiTenancySides.Both); + + permission.AddChild( + "Create", + "Create Permission"); + } +} +``` + +## 另请参阅 + +* [LINGYUN.Abp.PermissionManagement.Application](../LINGYUN.Abp.PermissionManagement.Application/README.md) +* [LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits](../LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.md) +* [LINGYUN.Abp.PermissionManagement.HttpApi](../LINGYUN.Abp.PermissionManagement.HttpApi/README.md) diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/README.EN.md b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/README.EN.md new file mode 100644 index 000000000..ebd85fa65 --- /dev/null +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/README.EN.md @@ -0,0 +1,100 @@ +# LINGYUN.Abp.PermissionManagement.Application + +Permission management application service module, providing application layer implementation for permission management. + +## Features + +* Permission Group Definition Management + * Create, update, and delete permission group definitions + * Support enabling/disabling permission groups + * Support static/dynamic configuration of permission groups +* Permission Definition Management + * Create, update, and delete permission definitions + * Support enabling/disabling permissions + * Support static/dynamic configuration of permissions + * Support parent-child hierarchy relationships for permissions +* Multi-tenancy Support + * Support both Host and Tenant multi-tenancy modes + * Support multi-tenancy side configuration for permissions + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(VoloAbpPermissionManagementApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Permission Group Definition Management +```csharp +public class YourService +{ + private readonly IPermissionGroupDefinitionAppService _groupDefinitionAppService; + + public YourService(IPermissionGroupDefinitionAppService groupDefinitionAppService) + { + _groupDefinitionAppService = groupDefinitionAppService; + } + + public async Task ManageGroupDefinitionAsync() + { + // Create permission group + await _groupDefinitionAppService.CreateAsync(new PermissionGroupDefinitionCreateDto + { + Name = "MyPermissionGroup", + DisplayName = "My Permission Group" + }); + + // Update permission group + await _groupDefinitionAppService.UpdateAsync("MyPermissionGroup", + new PermissionGroupDefinitionUpdateDto + { + DisplayName = "Updated Permission Group" + }); + } +} +``` + +2. Permission Definition Management +```csharp +public class YourService +{ + private readonly IPermissionDefinitionAppService _permissionDefinitionAppService; + + public YourService(IPermissionDefinitionAppService permissionDefinitionAppService) + { + _permissionDefinitionAppService = permissionDefinitionAppService; + } + + public async Task ManagePermissionDefinitionAsync() + { + // Create permission + await _permissionDefinitionAppService.CreateAsync(new PermissionDefinitionCreateDto + { + GroupName = "MyPermissionGroup", + Name = "MyPermission", + DisplayName = "My Permission", + Providers = new[] { "Role", "User" } + }); + + // Update permission + await _permissionDefinitionAppService.UpdateAsync("MyPermission", + new PermissionDefinitionUpdateDto + { + DisplayName = "Updated Permission" + }); + } +} +``` + +## See Also + +* [LINGYUN.Abp.PermissionManagement.Application.Contracts](../LINGYUN.Abp.PermissionManagement.Application.Contracts/README.EN.md) +* [LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits](../LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.EN.md) +* [LINGYUN.Abp.PermissionManagement.HttpApi](../LINGYUN.Abp.PermissionManagement.HttpApi/README.EN.md) diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/README.md b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/README.md new file mode 100644 index 000000000..14913bc39 --- /dev/null +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/README.md @@ -0,0 +1,100 @@ +# LINGYUN.Abp.PermissionManagement.Application + +权限管理应用服务模块,提供权限管理的应用层实现。 + +## 功能特性 + +* 权限组定义管理 + * 创建、更新、删除权限组定义 + * 支持权限组的启用/禁用 + * 支持权限组的静态/动态配置 +* 权限定义管理 + * 创建、更新、删除权限定义 + * 支持权限的启用/禁用 + * 支持权限的静态/动态配置 + * 支持权限的父子层级关系 +* 多租户支持 + * 支持Host和Tenant两种多租户模式 + * 支持权限的多租户侧配置 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(VoloAbpPermissionManagementApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 权限组定义管理 +```csharp +public class YourService +{ + private readonly IPermissionGroupDefinitionAppService _groupDefinitionAppService; + + public YourService(IPermissionGroupDefinitionAppService groupDefinitionAppService) + { + _groupDefinitionAppService = groupDefinitionAppService; + } + + public async Task ManageGroupDefinitionAsync() + { + // 创建权限组 + await _groupDefinitionAppService.CreateAsync(new PermissionGroupDefinitionCreateDto + { + Name = "MyPermissionGroup", + DisplayName = "My Permission Group" + }); + + // 更新权限组 + await _groupDefinitionAppService.UpdateAsync("MyPermissionGroup", + new PermissionGroupDefinitionUpdateDto + { + DisplayName = "Updated Permission Group" + }); + } +} +``` + +2. 权限定义管理 +```csharp +public class YourService +{ + private readonly IPermissionDefinitionAppService _permissionDefinitionAppService; + + public YourService(IPermissionDefinitionAppService permissionDefinitionAppService) + { + _permissionDefinitionAppService = permissionDefinitionAppService; + } + + public async Task ManagePermissionDefinitionAsync() + { + // 创建权限 + await _permissionDefinitionAppService.CreateAsync(new PermissionDefinitionCreateDto + { + GroupName = "MyPermissionGroup", + Name = "MyPermission", + DisplayName = "My Permission", + Providers = new[] { "Role", "User" } + }); + + // 更新权限 + await _permissionDefinitionAppService.UpdateAsync("MyPermission", + new PermissionDefinitionUpdateDto + { + DisplayName = "Updated Permission" + }); + } +} +``` + +## 另请参阅 + +* [LINGYUN.Abp.PermissionManagement.Application.Contracts](../LINGYUN.Abp.PermissionManagement.Application.Contracts/README.md) +* [LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits](../LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.md) +* [LINGYUN.Abp.PermissionManagement.HttpApi](../LINGYUN.Abp.PermissionManagement.HttpApi/README.md) diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.EN.md b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.EN.md new file mode 100644 index 000000000..8b7152d96 --- /dev/null +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.EN.md @@ -0,0 +1,62 @@ +# LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits + +Organization unit permission management domain module, providing permission management functionality based on organization units. + +## Features + +* Organization Unit Permission Management + * Support assigning permissions to organization units + * Support organization unit permission inheritance +* Permission Provider + * Implement OrganizationUnit permission provider + * Support role organization unit permission check + * Support user organization unit permission check +* Automatic Permission Cleanup + * Automatically clean up related permissions when organization unit is deleted + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpPermissionManagementDomainOrganizationUnitsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Organization Unit Permission Management +```csharp +public class YourService +{ + private readonly IPermissionManager _permissionManager; + + public YourService(IPermissionManager permissionManager) + { + _permissionManager = permissionManager; + } + + public async Task ManageOrganizationUnitPermissionAsync(string organizationUnitCode) + { + // Set organization unit permission + await _permissionManager.SetAsync( + "MyPermission", + OrganizationUnitPermissionValueProvider.ProviderName, + organizationUnitCode); + + // Check organization unit permission + var result = await _permissionManager.GetAsync( + "MyPermission", + OrganizationUnitPermissionValueProvider.ProviderName, + organizationUnitCode); + } +} +``` + +## See Also + +* [LINGYUN.Abp.PermissionManagement.Application](../LINGYUN.Abp.PermissionManagement.Application/README.EN.md) +* [LINGYUN.Abp.PermissionManagement.Application.Contracts](../LINGYUN.Abp.PermissionManagement.Application.Contracts/README.EN.md) +* [LINGYUN.Abp.PermissionManagement.HttpApi](../LINGYUN.Abp.PermissionManagement.HttpApi/README.EN.md) diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.md b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.md new file mode 100644 index 000000000..0776023e9 --- /dev/null +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.md @@ -0,0 +1,62 @@ +# LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits + +组织单元权限管理领域模块,提供基于组织单元的权限管理功能。 + +## 功能特性 + +* 组织单元权限管理 + * 支持为组织单元分配权限 + * 支持组织单元权限的继承 +* 权限提供者 + * 实现OrganizationUnit权限提供者 + * 支持角色组织单元权限检查 + * 支持用户组织单元权限检查 +* 自动权限清理 + * 组织单元删除时自动清理相关权限 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpPermissionManagementDomainOrganizationUnitsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 组织单元权限管理 +```csharp +public class YourService +{ + private readonly IPermissionManager _permissionManager; + + public YourService(IPermissionManager permissionManager) + { + _permissionManager = permissionManager; + } + + public async Task ManageOrganizationUnitPermissionAsync(string organizationUnitCode) + { + // 设置组织单元权限 + await _permissionManager.SetAsync( + "MyPermission", + OrganizationUnitPermissionValueProvider.ProviderName, + organizationUnitCode); + + // 检查组织单元权限 + var result = await _permissionManager.GetAsync( + "MyPermission", + OrganizationUnitPermissionValueProvider.ProviderName, + organizationUnitCode); + } +} +``` + +## 另请参阅 + +* [LINGYUN.Abp.PermissionManagement.Application](../LINGYUN.Abp.PermissionManagement.Application/README.md) +* [LINGYUN.Abp.PermissionManagement.Application.Contracts](../LINGYUN.Abp.PermissionManagement.Application.Contracts/README.md) +* [LINGYUN.Abp.PermissionManagement.HttpApi](../LINGYUN.Abp.PermissionManagement.HttpApi/README.md) diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/README.EN.md b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..bff971bac --- /dev/null +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/README.EN.md @@ -0,0 +1,87 @@ +# LINGYUN.Abp.PermissionManagement.HttpApi + +Permission management HTTP API module, providing RESTful API interfaces for permission management. + +## Features + +* Permission Group Definition API + * Provides CRUD operation interfaces for permission groups + * Supports pagination query for permission groups +* Permission Definition API + * Provides CRUD operation interfaces for permissions + * Supports pagination query for permissions +* Unified API Base Classes + * PermissionManagementControllerBase - Permission management controller base class + * Standardized API response format + +## Module Dependencies + +```csharp +[DependsOn( + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpPermissionManagementHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Endpoints + +1. Permission Group Definition +``` +GET /api/permission-management/groups +POST /api/permission-management/groups +PUT /api/permission-management/groups/{name} +DELETE /api/permission-management/groups/{name} +``` + +2. Permission Definition +``` +GET /api/permission-management/permissions +POST /api/permission-management/permissions +PUT /api/permission-management/permissions/{name} +DELETE /api/permission-management/permissions/{name} +``` + +## Basic Usage + +1. Permission Group Definition Management +```http +### Create permission group +POST /api/permission-management/groups +{ + "name": "MyPermissionGroup", + "displayName": "My Permission Group" +} + +### Update permission group +PUT /api/permission-management/groups/MyPermissionGroup +{ + "displayName": "Updated Permission Group" +} +``` + +2. Permission Definition Management +```http +### Create permission +POST /api/permission-management/permissions +{ + "groupName": "MyPermissionGroup", + "name": "MyPermission", + "displayName": "My Permission", + "providers": ["Role", "User"] +} + +### Update permission +PUT /api/permission-management/permissions/MyPermission +{ + "displayName": "Updated Permission" +} +``` + +## See Also + +* [LINGYUN.Abp.PermissionManagement.Application](../LINGYUN.Abp.PermissionManagement.Application/README.EN.md) +* [LINGYUN.Abp.PermissionManagement.Application.Contracts](../LINGYUN.Abp.PermissionManagement.Application.Contracts/README.EN.md) +* [LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits](../LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.EN.md) diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/README.md b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/README.md new file mode 100644 index 000000000..45190e192 --- /dev/null +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/README.md @@ -0,0 +1,87 @@ +# LINGYUN.Abp.PermissionManagement.HttpApi + +权限管理HTTP API模块,提供权限管理的RESTful API接口。 + +## 功能特性 + +* 权限组定义API + * 提供权限组的CRUD操作接口 + * 支持权限组分页查询 +* 权限定义API + * 提供权限的CRUD操作接口 + * 支持权限分页查询 +* 统一的API基类 + * PermissionManagementControllerBase - 权限管理控制器基类 + * 标准化的API响应格式 + +## 模块引用 + +```csharp +[DependsOn( + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpPermissionManagementHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API接口 + +1. 权限组定义 +``` +GET /api/permission-management/groups +POST /api/permission-management/groups +PUT /api/permission-management/groups/{name} +DELETE /api/permission-management/groups/{name} +``` + +2. 权限定义 +``` +GET /api/permission-management/permissions +POST /api/permission-management/permissions +PUT /api/permission-management/permissions/{name} +DELETE /api/permission-management/permissions/{name} +``` + +## 基本用法 + +1. 权限组定义管理 +```http +### 创建权限组 +POST /api/permission-management/groups +{ + "name": "MyPermissionGroup", + "displayName": "My Permission Group" +} + +### 更新权限组 +PUT /api/permission-management/groups/MyPermissionGroup +{ + "displayName": "Updated Permission Group" +} +``` + +2. 权限定义管理 +```http +### 创建权限 +POST /api/permission-management/permissions +{ + "groupName": "MyPermissionGroup", + "name": "MyPermission", + "displayName": "My Permission", + "providers": ["Role", "User"] +} + +### 更新权限 +PUT /api/permission-management/permissions/MyPermission +{ + "displayName": "Updated Permission" +} +``` + +## 另请参阅 + +* [LINGYUN.Abp.PermissionManagement.Application](../LINGYUN.Abp.PermissionManagement.Application/README.md) +* [LINGYUN.Abp.PermissionManagement.Application.Contracts](../LINGYUN.Abp.PermissionManagement.Application.Contracts/README.md) +* [LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits](../LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/README.EN.md new file mode 100644 index 000000000..aed3f086f --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/README.EN.md @@ -0,0 +1,80 @@ +# LINGYUN.Abp.UI.Navigation.VueVbenAdmin + +Navigation menu initialization module for **abp-vue-vben-admin**. This module provides menu data initialization functionality required for integration with the VueVbenAdmin frontend framework. + +## Features + +* Menu Data Initialization + * Preset menu structure + * Automatic layout registration + * Dynamic menu configuration + +* VueVbenAdmin Integration + * Layout component configuration + * UI theme adaptation + * Menu item customization + +* Extensibility Support + * Custom menu providers + * Menu data override + * Layout configuration extensions + +## Quick Start + +1. Reference the module +```csharp +[DependsOn(typeof(AbpUINavigationVueVbenAdminModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +2. Configure options +```csharp +Configure(options => +{ + // UI name configuration + options.UI = "Vue Vben Admin"; + // Layout name configuration + options.LayoutName = "Vben Admin Layout"; + // Layout component configuration + options.LayoutPath = "LAYOUT"; +}); +``` + +## Configuration Options + +* `AbpUINavigationVueVbenAdminOptions.UI` + * Description: UI name + * Default value: Vue Vben Admin + * Note: Not recommended to change, must be consistent with frontend + +* `AbpUINavigationVueVbenAdminOptions.LayoutName` + * Description: Layout name + * Default value: Vben Admin Layout + * Note: Not recommended to change, must be consistent with frontend + +* `AbpUINavigationVueVbenAdminOptions.LayoutPath` + * Description: Layout component path + * Default value: LAYOUT + * Note: Not recommended to change, must be consistent with frontend + +## Usage Guide + +1. Menu Initialization + * The module automatically registers default menu data + * Custom menus can be added by implementing the `INavigationDataSeedContributor` interface + +2. Layout Configuration + * Layout configuration must match the frontend route configuration + * When modifying layout configuration, related frontend configurations need to be synchronized + +3. Extension Development + * Custom menu initialization logic can be implemented by inheriting the `VueVbenAdminNavigationDataSeeder` class + * Default implementations can be overridden through dependency injection + +## More Information + +* [VueVbenAdmin Official Documentation](https://doc.vvbin.cn/) +* [ABP Official Documentation](https://docs.abp.io/) diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/README.md b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/README.md index 699aca2dc..34db9927b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/README.md +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/README.md @@ -1,21 +1,80 @@ -# LINGYUN.Abp.UI.Navigation.VueVbenAdmin - -适用于 **abp-vue-vben-admin** 的初始化菜单数据模块 - -## 配置使用 - -```csharp -[DependsOn(typeof(AbpUINavigationVueVbenAdminModule))] -public class YouProjectModule : AbpModule -{ - // other -} -``` - -## 配置项 - -* AbpUINavigationVueVbenAdminOptions.UI UI名称,默认值: Vue Vben Admin,不建议变更,否则需要改变前端 -* AbpUINavigationVueVbenAdminOptions.LayoutName 布局名称,默认值: Vben Admin Layout,不建议变更,否则需要改变前端 -* AbpUINavigationVueVbenAdminOptions.LayoutPath 布局组件,默认值: LAYOUT,不建议变更,否则需要改变前端 - -## 其他 +# LINGYUN.Abp.UI.Navigation.VueVbenAdmin + +适用于 **abp-vue-vben-admin** 的导航菜单初始化模块。本模块提供了与VueVbenAdmin前端框架集成所需的菜单数据初始化功能。 + +## 功能特性 + +* 菜单数据初始化 + * 预设菜单结构 + * 自动注册布局 + * 动态菜单配置 + +* VueVbenAdmin集成 + * 布局组件配置 + * UI主题适配 + * 菜单项定制 + +* 扩展性支持 + * 自定义菜单提供者 + * 菜单数据重写 + * 布局配置扩展 + +## 快速开始 + +1. 引用模块 +```csharp +[DependsOn(typeof(AbpUINavigationVueVbenAdminModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +2. 配置选项 +```csharp +Configure(options => +{ + // UI名称配置 + options.UI = "Vue Vben Admin"; + // 布局名称配置 + options.LayoutName = "Vben Admin Layout"; + // 布局组件配置 + options.LayoutPath = "LAYOUT"; +}); +``` + +## 配置项说明 + +* `AbpUINavigationVueVbenAdminOptions.UI` + * 说明:UI名称 + * 默认值:Vue Vben Admin + * 注意:不建议变更,需要与前端保持一致 + +* `AbpUINavigationVueVbenAdminOptions.LayoutName` + * 说明:布局名称 + * 默认值:Vben Admin Layout + * 注意:不建议变更,需要与前端保持一致 + +* `AbpUINavigationVueVbenAdminOptions.LayoutPath` + * 说明:布局组件路径 + * 默认值:LAYOUT + * 注意:不建议变更,需要与前端保持一致 + +## 使用说明 + +1. 菜单初始化 + * 模块会自动注册默认的菜单数据 + * 可以通过实现 `INavigationDataSeedContributor` 接口来添加自定义菜单 + +2. 布局配置 + * 布局配置需要与前端的路由配置相匹配 + * 修改布局配置时需要同步修改前端相关配置 + +3. 扩展开发 + * 可以通过继承 `VueVbenAdminNavigationDataSeeder` 类来自定义菜单初始化逻辑 + * 支持通过依赖注入覆盖默认实现 + +## 更多信息 + +* [VueVbenAdmin官方文档](https://doc.vvbin.cn/) +* [ABP官方文档](https://docs.abp.io/) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/README.EN.md new file mode 100644 index 000000000..a17382dcd --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/README.EN.md @@ -0,0 +1,85 @@ +# LINGYUN.Platform.Application.Contracts + +The application service contract layer of the platform management module, defining application service interfaces, DTO objects, and permission definitions. + +## Features + +* Menu Management Interface + * Menu CRUD operations + * User menu management + * Role menu management + * Menu favorite functionality + +* Package Management Interface + * Package CRUD operations + * Package version management + * Package file upload and download + +* Permission Definitions + * Platform management permission group + * Data dictionary permissions + * Menu management permissions + * Package management permissions + +## Module Reference + +```csharp +[DependsOn(typeof(PlatformApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Application Service Interfaces + +* `IMenuAppService`: Menu management service interface +* `IUserFavoriteMenuAppService`: User favorite menu service interface +* `IPackageAppService`: Package management service interface + +## Data Transfer Objects + +* Menu Related DTOs + * `MenuDto`: Menu DTO + * `MenuCreateDto`: Create menu DTO + * `MenuUpdateDto`: Update menu DTO + * `MenuItemDto`: Menu item DTO + * `UserFavoriteMenuDto`: User favorite menu DTO + +* Package Management Related DTOs + * `PackageDto`: Package DTO + * `PackageCreateDto`: Create package DTO + * `PackageUpdateDto`: Update package DTO + * `PackageBlobDto`: Package file DTO + +## Permission Definitions + +```json +{ + "Platform": { + "Default": "Platform Management", + "DataDictionary": { + "Default": "Data Dictionary Management", + "Create": "Create", + "Update": "Update", + "Delete": "Delete" + }, + "Menu": { + "Default": "Menu Management", + "Create": "Create", + "Update": "Update", + "Delete": "Delete" + }, + "Package": { + "Default": "Package Management", + "Create": "Create", + "Update": "Update", + "Delete": "Delete" + } + } +} +``` + +## More + +For more information, please refer to [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/README.md b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/README.md new file mode 100644 index 000000000..ff2484f84 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/README.md @@ -0,0 +1,85 @@ +# LINGYUN.Platform.Application.Contracts + +平台管理模块的应用服务契约层,定义了应用服务接口、DTO对象和权限定义。 + +## 功能特性 + +* 菜单管理接口 + * 菜单CRUD操作 + * 用户菜单管理 + * 角色菜单管理 + * 菜单收藏功能 + +* 包管理接口 + * 包CRUD操作 + * 包版本管理 + * 包文件上传下载 + +* 权限定义 + * 平台管理权限组 + * 数据字典权限 + * 菜单管理权限 + * 包管理权限 + +## 模块引用 + +```csharp +[DependsOn(typeof(PlatformApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 应用服务接口 + +* `IMenuAppService`: 菜单管理服务接口 +* `IUserFavoriteMenuAppService`: 用户收藏菜单服务接口 +* `IPackageAppService`: 包管理服务接口 + +## 数据传输对象 + +* 菜单相关DTO + * `MenuDto`: 菜单DTO + * `MenuCreateDto`: 创建菜单DTO + * `MenuUpdateDto`: 更新菜单DTO + * `MenuItemDto`: 菜单项DTO + * `UserFavoriteMenuDto`: 用户收藏菜单DTO + +* 包管理相关DTO + * `PackageDto`: 包DTO + * `PackageCreateDto`: 创建包DTO + * `PackageUpdateDto`: 更新包DTO + * `PackageBlobDto`: 包文件DTO + +## 权限定义 + +```json +{ + "Platform": { + "Default": "平台管理", + "DataDictionary": { + "Default": "数据字典管理", + "Create": "创建", + "Update": "更新", + "Delete": "删除" + }, + "Menu": { + "Default": "菜单管理", + "Create": "创建", + "Update": "更新", + "Delete": "删除" + }, + "Package": { + "Default": "包管理", + "Create": "创建", + "Update": "更新", + "Delete": "删除" + } + } +} +``` + +## 更多 + +更多信息请参考 [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Platform.Application/README.EN.md new file mode 100644 index 000000000..39eb9bc87 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/README.EN.md @@ -0,0 +1,69 @@ +# LINGYUN.Platform.Application + +The application service implementation layer of the platform management module, implementing all functionality defined in the application service interfaces. + +## Features + +* User Favorite Menu Service + * Create favorite menu + * Update favorite menu + * Delete favorite menu + * Query favorite menu list + * Manage other users' favorite menus + +* Object Mapping Configuration + * Automatic mapping from entities to DTOs + * Support for custom mapping rules + * Support for extra property mapping + +* Permission Validation + * Policy-based permission validation + * Integration with ABP authorization system + * Fine-grained permission control + +## Module Reference + +```csharp +[DependsOn(typeof(PlatformApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Application Service Implementation + +* `UserFavoriteMenuAppService`: User favorite menu service implementation + * Support for custom menu icons + * Support for custom menu colors + * Support for custom menu aliases + * Support for multi-framework menu management + +## Object Mapping + +```csharp +public class PlatformApplicationMappingProfile : Profile +{ + public PlatformApplicationMappingProfile() + { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } +} +``` + +## Base Services + +* `PlatformApplicationServiceBase`: Platform management application service base class + * Provides common functionality and helper methods + * Unified exception handling + * Unified permission validation + +## More + +For more information, please refer to [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/README.md b/aspnet-core/modules/platform/LINGYUN.Platform.Application/README.md new file mode 100644 index 000000000..f10ea3014 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/README.md @@ -0,0 +1,69 @@ +# LINGYUN.Platform.Application + +平台管理模块的应用服务实现层,实现了应用服务接口定义的所有功能。 + +## 功能特性 + +* 用户收藏菜单服务 + * 创建收藏菜单 + * 更新收藏菜单 + * 删除收藏菜单 + * 查询收藏菜单列表 + * 管理其他用户的收藏菜单 + +* 对象映射配置 + * 实体到DTO的自动映射 + * 支持自定义映射规则 + * 支持额外属性映射 + +* 权限验证 + * 基于策略的权限验证 + * 集成ABP授权系统 + * 细粒度的权限控制 + +## 模块引用 + +```csharp +[DependsOn(typeof(PlatformApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 应用服务实现 + +* `UserFavoriteMenuAppService`: 用户收藏菜单服务实现 + * 支持用户自定义菜单图标 + * 支持用户自定义菜单颜色 + * 支持用户自定义菜单别名 + * 支持多框架菜单管理 + +## 对象映射 + +```csharp +public class PlatformApplicationMappingProfile : Profile +{ + public PlatformApplicationMappingProfile() + { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } +} +``` + +## 基础服务 + +* `PlatformApplicationServiceBase`: 平台管理应用服务基类 + * 提供通用功能和帮助方法 + * 统一异常处理 + * 统一权限验证 + +## 更多 + +更多信息请参考 [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/README.EN.md new file mode 100644 index 000000000..66f4a7d33 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/README.EN.md @@ -0,0 +1,30 @@ +# LINGYUN.Platform.Domain.Shared + +The shared domain layer of the platform management module, which defines the basic types, enumerations, and constants required for platform management. + +## Features + +* Define platform management basic enumerations +* Define platform management constants +* Define platform management localization resources +* Define platform management domain shared interfaces + +## Module Reference + +```csharp +[DependsOn(typeof(PlatformDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Reference the module +2. Use defined enumerations and constants +3. Use localization resources + +## More + +For more information, please refer to [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/README.md b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/README.md new file mode 100644 index 000000000..52586019f --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/README.md @@ -0,0 +1,30 @@ +# LINGYUN.Platform.Domain.Shared + +平台管理模块的共享领域层,定义了平台管理所需的基本类型、枚举和常量。 + +## 功能特性 + +* 定义平台管理基础枚举 +* 定义平台管理常量 +* 定义平台管理本地化资源 +* 定义平台管理领域共享接口 + +## 模块引用 + +```csharp +[DependsOn(typeof(PlatformDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 引用模块 +2. 使用定义的枚举和常量 +3. 使用本地化资源 + +## 更多 + +更多信息请参考 [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/README.EN.md new file mode 100644 index 000000000..f97929b04 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/README.EN.md @@ -0,0 +1,69 @@ +# LINGYUN.Platform.Domain + +The domain layer of the platform management module, implementing core business logic and domain models required for platform management. + +## Features + +* Menu Management + * Support for multi-level menu structure + * User menu customization + * Role menu permissions + * Menu standardization conversion + +* Layout Management + * Layout view entities + * Layout data association + * Multi-framework support + +* Data Dictionary + * Data dictionary management + * Data dictionary item management + * Data dictionary seed data + +* Package Management + * Package version control + * Package file management + * Blob storage integration + * Package filtering specification + +* Enterprise Portal + * Enterprise information management + * Enterprise data storage + +## Module Reference + +```csharp +[DependsOn(typeof(PlatformDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Domain Services + +* `DataDictionaryDataSeeder`: Data dictionary seed data service +* `PackageBlobManager`: Package file management service +* `DefaultStandardMenuConverter`: Standard menu conversion service + +## Repository Interfaces + +* `IMenuRepository`: Menu repository interface +* `IUserMenuRepository`: User menu repository interface +* `IRoleMenuRepository`: Role menu repository interface +* `ILayoutRepository`: Layout repository interface +* `IEnterpriseRepository`: Enterprise repository interface + +## Entities + +* `Menu`: Menu entity +* `UserMenu`: User menu entity +* `RoleMenu`: Role menu entity +* `Layout`: Layout entity +* `Package`: Package entity +* `Data`: Data dictionary entity +* `DataItem`: Data dictionary item entity + +## More + +For more information, please refer to [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/README.md b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/README.md new file mode 100644 index 000000000..33fe568fe --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/README.md @@ -0,0 +1,69 @@ +# LINGYUN.Platform.Domain + +平台管理模块的领域层,实现了平台管理所需的核心业务逻辑和领域模型。 + +## 功能特性 + +* 菜单管理 + * 支持多级菜单结构 + * 用户菜单定制 + * 角色菜单权限 + * 菜单标准化转换 + +* 布局管理 + * 布局视图实体 + * 布局数据关联 + * 多框架支持 + +* 数据字典 + * 数据字典管理 + * 数据字典项管理 + * 数据字典种子数据 + +* 包管理 + * 包版本控制 + * 包文件管理 + * Blob存储集成 + * 包过滤规范 + +* 企业门户 + * 企业信息管理 + * 企业数据存储 + +## 模块引用 + +```csharp +[DependsOn(typeof(PlatformDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 领域服务 + +* `DataDictionaryDataSeeder`: 数据字典种子数据服务 +* `PackageBlobManager`: 包文件管理服务 +* `DefaultStandardMenuConverter`: 标准菜单转换服务 + +## 仓储接口 + +* `IMenuRepository`: 菜单仓储接口 +* `IUserMenuRepository`: 用户菜单仓储接口 +* `IRoleMenuRepository`: 角色菜单仓储接口 +* `ILayoutRepository`: 布局仓储接口 +* `IEnterpriseRepository`: 企业仓储接口 + +## 实体 + +* `Menu`: 菜单实体 +* `UserMenu`: 用户菜单实体 +* `RoleMenu`: 角色菜单实体 +* `Layout`: 布局实体 +* `Package`: 包实体 +* `Data`: 数据字典实体 +* `DataItem`: 数据字典项实体 + +## 更多 + +更多信息请参考 [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..286e3ffba --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/README.EN.md @@ -0,0 +1,57 @@ +# LINGYUN.Platform.EntityFrameworkCore + +The EntityFrameworkCore implementation of the platform management module, providing data access and persistence functionality. + +## Features + +* Implementation of all platform management repository interfaces +* Support for multiple database providers +* Entity relationship mapping configuration +* Database context definition +* Support for query optimization and performance tuning + +## Module Reference + +```csharp +[DependsOn(typeof(PlatformEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Repository Implementations + +* `EfCoreUserMenuRepository`: User menu repository implementation + * Support for getting user startup menu + * Support for user menu list query + * Support for user menu permission validation + +* `EfCorePackageRepository`: Package management repository implementation + * Support for package version query + * Support for package specification filtering + * Support for package details loading + +* `EfCoreEnterpriseRepository`: Enterprise repository implementation + * Support for tenant association query + * Support for enterprise list pagination + +## Database Context + +* `IPlatformDbContext`: Platform management database context interface + * Define DbSet for all entities + * Support for multi-tenant data isolation + +## Configuration + +```json +{ + "ConnectionStrings": { + "Platform": "Server=localhost;Database=Platform;Trusted_Connection=True" + } +} +``` + +## More + +For more information, please refer to [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/README.md b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/README.md new file mode 100644 index 000000000..a7e9b1869 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/README.md @@ -0,0 +1,57 @@ +# LINGYUN.Platform.EntityFrameworkCore + +平台管理模块的EntityFrameworkCore实现,提供了数据访问和持久化功能。 + +## 功能特性 + +* 实现平台管理所有仓储接口 +* 支持多数据库提供程序 +* 实体关系映射配置 +* 数据库上下文定义 +* 支持查询优化和性能调优 + +## 模块引用 + +```csharp +[DependsOn(typeof(PlatformEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 仓储实现 + +* `EfCoreUserMenuRepository`: 用户菜单仓储实现 + * 支持获取用户启动菜单 + * 支持用户菜单列表查询 + * 支持用户菜单权限验证 + +* `EfCorePackageRepository`: 包管理仓储实现 + * 支持包版本查询 + * 支持包规格过滤 + * 支持包详情加载 + +* `EfCoreEnterpriseRepository`: 企业仓储实现 + * 支持租户关联查询 + * 支持企业列表分页 + +## 数据库上下文 + +* `IPlatformDbContext`: 平台管理数据库上下文接口 + * 定义所有实体的DbSet + * 支持多租户数据隔离 + +## 配置项 + +```json +{ + "ConnectionStrings": { + "Platform": "Server=localhost;Database=Platform;Trusted_Connection=True" + } +} +``` + +## 更多 + +更多信息请参考 [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/README.EN.md new file mode 100644 index 000000000..f782eea5b --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/README.EN.md @@ -0,0 +1,71 @@ +# LINGYUN.Platform.HttpApi + +The HTTP API layer of the platform management module, providing RESTful style API interfaces. + +## Features + +* Menu Management API + * Get current user menu + * Get user menu list + * Get role menu list + * Menu CRUD operations + * User favorite menu management + +* Layout Management API + * Layout CRUD operations + * Get all layouts list + +* Data Dictionary API + * Data dictionary CRUD operations + * Data dictionary item management + +* Package Management API + * Package CRUD operations + * Package file upload and download + * Get latest version package + +## Module Reference + +```csharp +[DependsOn(typeof(PlatformHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Controllers + +* `MenuController`: Menu management controller + * `GET /api/platform/menus/by-current-user`: Get current user menu + * `GET /api/platform/menus/by-user`: Get specified user menu + * `GET /api/platform/menus/by-role`: Get role menu + * `POST /api/platform/menus`: Create menu + * `PUT /api/platform/menus/{id}`: Update menu + * `DELETE /api/platform/menus/{id}`: Delete menu + +* `UserFavoriteMenuController`: User favorite menu controller + * `GET /api/platform/menus/favorites/my-favorite-menus`: Get my favorite menus + * `POST /api/platform/menus/favorites/my-favorite-menus`: Create favorite menu + * `PUT /api/platform/menus/favorites/my-favorite-menus/{MenuId}`: Update favorite menu + * `DELETE /api/platform/menus/favorites/my-favorite-menus`: Delete favorite menu + +* `PackageController`: Package management controller + * `GET /api/platform/packages/{Name}/latest`: Get latest version package + * `POST /api/platform/packages/{id}/blob`: Upload package file + * `GET /api/platform/packages/{id}/blob/{Name}`: Download package file + * `DELETE /api/platform/packages/{id}/blob/{Name}`: Delete package file + +## Configuration + +```json +{ + "App": { + "CorsOrigins": "https://*.YourDomain.com,http://localhost:4200" + } +} +``` + +## More + +For more information, please refer to [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/README.md b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/README.md new file mode 100644 index 000000000..806b3bdf4 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/README.md @@ -0,0 +1,71 @@ +# LINGYUN.Platform.HttpApi + +平台管理模块的HTTP API层,提供了RESTful风格的API接口。 + +## 功能特性 + +* 菜单管理API + * 获取当前用户菜单 + * 获取用户菜单列表 + * 获取角色菜单列表 + * 菜单CRUD操作 + * 用户收藏菜单管理 + +* 布局管理API + * 布局CRUD操作 + * 获取所有布局列表 + +* 数据字典API + * 数据字典CRUD操作 + * 数据字典项管理 + +* 包管理API + * 包CRUD操作 + * 包文件上传下载 + * 获取最新版本包 + +## 模块引用 + +```csharp +[DependsOn(typeof(PlatformHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API控制器 + +* `MenuController`: 菜单管理控制器 + * `GET /api/platform/menus/by-current-user`: 获取当前用户菜单 + * `GET /api/platform/menus/by-user`: 获取指定用户菜单 + * `GET /api/platform/menus/by-role`: 获取角色菜单 + * `POST /api/platform/menus`: 创建菜单 + * `PUT /api/platform/menus/{id}`: 更新菜单 + * `DELETE /api/platform/menus/{id}`: 删除菜单 + +* `UserFavoriteMenuController`: 用户收藏菜单控制器 + * `GET /api/platform/menus/favorites/my-favorite-menus`: 获取我的收藏菜单 + * `POST /api/platform/menus/favorites/my-favorite-menus`: 创建收藏菜单 + * `PUT /api/platform/menus/favorites/my-favorite-menus/{MenuId}`: 更新收藏菜单 + * `DELETE /api/platform/menus/favorites/my-favorite-menus`: 删除收藏菜单 + +* `PackageController`: 包管理控制器 + * `GET /api/platform/packages/{Name}/latest`: 获取最新版本包 + * `POST /api/platform/packages/{id}/blob`: 上传包文件 + * `GET /api/platform/packages/{id}/blob/{Name}`: 下载包文件 + * `DELETE /api/platform/packages/{id}/blob/{Name}`: 删除包文件 + +## 配置项 + +```json +{ + "App": { + "CorsOrigins": "https://*.YourDomain.com,http://localhost:4200" + } +} +``` + +## 更多 + +更多信息请参考 [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/README.EN.md new file mode 100644 index 000000000..4622d24d1 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/README.EN.md @@ -0,0 +1,87 @@ +# LINGYUN.Platform.Settings.VueVbenAdmin + +The platform settings module for the VueVbenAdmin frontend framework, providing theme, layout, menu, and other setting features. + +## Features + +* Theme Settings + * Dark mode + * Gray mode + * Color weak mode + * Theme color + +* Layout Settings + * Full screen mode + * Content mode + * Page loading state + * Footer display + * Back to top + +* Menu Settings + * Menu mode + * Menu theme + * Menu width + * Menu collapse + * Menu split + * Menu drag + +* Header Settings + * Fixed header + * Header theme + * Full screen button + * Document button + * Notice button + * Search button + +* Multi-tab Settings + * Tab cache + * Tab drag + * Tab refresh + * Tab fold + +## Module Reference + +```csharp +[DependsOn(typeof(PlatformSettingsVueVbenAdminModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Localization Resources + +* Support for Simplified Chinese +* Support for English + +## Configuration + +```json +{ + "Settings": { + "DarkMode": false, + "PageLoading": true, + "PermissionCacheType": 1, + "ShowSettingButton": true, + "ShowDarkModeToggle": true, + "SettingButtonPosition": "auto", + "PermissionMode": "ROUTE_MAPPING", + "SessionTimeoutProcessing": 0, + "GrayMode": false, + "ColorWeak": false, + "ThemeColor": "#0960bd", + "FullContent": false, + "ContentMode": "full", + "ShowLogo": true, + "ShowFooter": true, + "OpenKeepAlive": true, + "LockTime": 0, + "ShowBreadCrumb": true, + "ShowBreadCrumbIcon": false + } +} +``` + +## More + +For more information, please refer to [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/README.md b/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/README.md new file mode 100644 index 000000000..58827b858 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/README.md @@ -0,0 +1,87 @@ +# LINGYUN.Platform.Settings.VueVbenAdmin + +VueVbenAdmin前端框架的平台设置模块,提供了主题、布局、菜单等设置功能。 + +## 功能特性 + +* 主题设置 + * 暗黑模式 + * 灰色模式 + * 色弱模式 + * 主题颜色 + +* 布局设置 + * 全屏模式 + * 内容模式 + * 页面加载状态 + * 页脚显示 + * 返回顶部 + +* 菜单设置 + * 菜单模式 + * 菜单主题 + * 菜单宽度 + * 菜单折叠 + * 菜单分割 + * 菜单拖拽 + +* 标题栏设置 + * 固定标题栏 + * 标题栏主题 + * 全屏按钮 + * 文档按钮 + * 通知按钮 + * 搜索按钮 + +* 多标签页设置 + * 标签页缓存 + * 标签页拖拽 + * 标签页刷新 + * 标签页折叠 + +## 模块引用 + +```csharp +[DependsOn(typeof(PlatformSettingsVueVbenAdminModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 本地化资源 + +* 支持中文简体 +* 支持英文 + +## 配置项 + +```json +{ + "Settings": { + "DarkMode": false, + "PageLoading": true, + "PermissionCacheType": 1, + "ShowSettingButton": true, + "ShowDarkModeToggle": true, + "SettingButtonPosition": "auto", + "PermissionMode": "ROUTE_MAPPING", + "SessionTimeoutProcessing": 0, + "GrayMode": false, + "ColorWeak": false, + "ThemeColor": "#0960bd", + "FullContent": false, + "ContentMode": "full", + "ShowLogo": true, + "ShowFooter": true, + "OpenKeepAlive": true, + "LockTime": 0, + "ShowBreadCrumb": true, + "ShowBreadCrumbIcon": false + } +} +``` + +## 更多 + +更多信息请参考 [Platform](../README.md) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/README.EN.md b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/README.EN.md new file mode 100644 index 000000000..fac26b59d --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/README.EN.md @@ -0,0 +1,130 @@ +# LINGYUN.Platform.Theme.VueVbenAdmin + +Theme management module for the VueVbenAdmin frontend framework, providing management functionality for theme, layout, menu, and related configurations. + +## Features + +* Theme Settings + * Dark mode + * Gray mode + * Color weak mode + * Theme color configuration + +* Layout Settings + * Full screen mode + * Content mode + * Page loading state + * Footer display + * Back to top + +* Menu Settings + * Menu mode + * Menu theme + * Menu width + * Menu collapse + * Menu split + * Menu drag + +* Header Settings + * Fixed header + * Header theme + * Full screen button + * Document button + * Notice button + * Search button + +* Multi-tab Settings + * Tab cache + * Tab drag + * Tab refresh + * Tab fold + +## Quick Start + +1. Reference the module +```csharp +[DependsOn(typeof(PlatformThemeVueVbenAdminModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +2. Configure options +```json +{ + "Theme": { + "DarkMode": false, + "GrayMode": false, + "ColorWeak": false, + "ThemeColor": "#0960bd" + }, + "Layout": { + "FullContent": false, + "ContentMode": "full", + "ShowLogo": true, + "ShowFooter": true, + "ShowBreadCrumb": true, + "ShowBreadCrumbIcon": false + }, + "Menu": { + "Mode": "inline", + "Theme": "dark", + "Width": 210, + "Collapsed": false, + "Split": false, + "Draggable": true + }, + "Header": { + "Fixed": true, + "Theme": "light", + "ShowFullScreen": true, + "ShowDoc": true, + "ShowNotice": true, + "ShowSearch": true + }, + "MultiTab": { + "Cache": true, + "Draggable": true, + "Refresh": true, + "Fold": true + } +} +``` + +## Usage Guide + +1. Theme Configuration + * Support for multiple theme mode switching + * Customizable theme colors + * Theme persistence storage + +2. Layout Configuration + * Flexible layout modes + * Configurable page element display + * Responsive layout support + +3. Menu Configuration + * Various menu display modes + * Support for menu drag sorting + * Menu theme customization + +4. Extension Development + * Support for custom theme configuration providers + * Extensible theme settings + * Theme data localization support + +## Important Notes + +1. Theme Configuration + * Theme configurations affect the interface display for all users + * Choose appropriate theme modes based on actual requirements + +2. Performance Considerations + * Configure tab cache quantity reasonably + * Use page loading animations appropriately + +## More Information + +* [VueVbenAdmin Theme Configuration Documentation](https://doc.vvbin.cn/guide/design.html) +* [ABP Official Documentation](https://docs.abp.io/) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/README.md b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/README.md new file mode 100644 index 000000000..634942166 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/README.md @@ -0,0 +1,130 @@ +# LINGYUN.Platform.Theme.VueVbenAdmin + +VueVbenAdmin前端框架的主题管理模块,提供主题、布局、菜单等相关配置的管理功能。 + +## 功能特性 + +* 主题设置 + * 暗黑模式 + * 灰色模式 + * 色弱模式 + * 主题色配置 + +* 布局设置 + * 全屏模式 + * 内容模式 + * 页面加载状态 + * 页脚显示 + * 返回顶部 + +* 菜单设置 + * 菜单模式 + * 菜单主题 + * 菜单宽度 + * 菜单折叠 + * 菜单拆分 + * 菜单拖拽 + +* 标题栏设置 + * 固定头部 + * 头部主题 + * 全屏按钮 + * 文档按钮 + * 通知按钮 + * 搜索按钮 + +* 多标签页设置 + * 标签页缓存 + * 标签页拖拽 + * 标签页刷新 + * 标签页折叠 + +## 快速开始 + +1. 引用模块 +```csharp +[DependsOn(typeof(PlatformThemeVueVbenAdminModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +2. 配置选项 +```json +{ + "Theme": { + "DarkMode": false, + "GrayMode": false, + "ColorWeak": false, + "ThemeColor": "#0960bd" + }, + "Layout": { + "FullContent": false, + "ContentMode": "full", + "ShowLogo": true, + "ShowFooter": true, + "ShowBreadCrumb": true, + "ShowBreadCrumbIcon": false + }, + "Menu": { + "Mode": "inline", + "Theme": "dark", + "Width": 210, + "Collapsed": false, + "Split": false, + "Draggable": true + }, + "Header": { + "Fixed": true, + "Theme": "light", + "ShowFullScreen": true, + "ShowDoc": true, + "ShowNotice": true, + "ShowSearch": true + }, + "MultiTab": { + "Cache": true, + "Draggable": true, + "Refresh": true, + "Fold": true + } +} +``` + +## 使用说明 + +1. 主题配置 + * 支持多种主题模式切换 + * 可自定义主题色 + * 提供主题持久化存储 + +2. 布局配置 + * 灵活的布局模式 + * 可配置的页面元素显示 + * 支持响应式布局 + +3. 菜单配置 + * 多样的菜单显示模式 + * 支持菜单拖拽排序 + * 菜单主题自定义 + +4. 扩展开发 + * 支持自定义主题配置提供者 + * 可扩展的主题设置项 + * 主题数据本地化支持 + +## 注意事项 + +1. 主题配置 + * 主题配置会影响所有用户的界面显示 + * 建议根据实际需求选择合适的主题模式 + +2. 性能考虑 + * 合理配置标签页缓存数量 + * 适当使用页面加载动画 + +## 更多信息 + +* [VueVbenAdmin主题配置文档](https://doc.vvbin.cn/guide/design.html) +* [ABP官方文档](https://docs.abp.io/) diff --git a/aspnet-core/modules/platform/README.EN.md b/aspnet-core/modules/platform/README.EN.md new file mode 100644 index 000000000..b1dbf769e --- /dev/null +++ b/aspnet-core/modules/platform/README.EN.md @@ -0,0 +1,96 @@ +# LINGYUN.Platform + +Platform management module that provides a complete set of platform management features, including menu management, layout management, data dictionary, package management, and more. + +## Features + +* Menu Management + * Multi-level menu structure + * User menu customization + * Role-based menu permissions + * Menu favorites + * Dynamic menu presets + +* Layout Management + * Layout view entities + * Layout data association + * Multi-framework support + +* Data Dictionary + * Data dictionary management + * Dictionary item management + * Dictionary seed data + +* Package Management + * Package version control + * Package file management + * Blob storage integration + * Package filtering specifications + +* VueVbenAdmin Integration + * Theme settings + * Layout settings + * Menu settings + * Header settings + * Multi-tab settings + +## Project Structure + +* `LINGYUN.Platform.Domain.Shared`: Shared domain layer +* `LINGYUN.Platform.Domain`: Domain layer +* `LINGYUN.Platform.EntityFrameworkCore`: Data access layer +* `LINGYUN.Platform.Application.Contracts`: Application service contracts layer +* `LINGYUN.Platform.Application`: Application service implementation layer +* `LINGYUN.Platform.HttpApi`: HTTP API layer +* `LINGYUN.Platform.Settings.VueVbenAdmin`: VueVbenAdmin frontend framework settings module + +## Quick Start + +1. Reference the modules +```csharp +[DependsOn( + typeof(PlatformDomainModule), + typeof(PlatformApplicationModule), + typeof(PlatformHttpApiModule), + typeof(PlatformSettingsVueVbenAdminModule) +)] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +2. Configure the database +```json +{ + "ConnectionStrings": { + "Platform": "Server=localhost;Database=Platform;Trusted_Connection=True" + } +} +``` + +3. Update the database +```bash +dotnet ef database update +``` + +## Important Notes + +1. Dynamic Menu Management + * The module initializes vue-admin related menus by default + * Menu data can be preset through the `IDataSeedContributor` interface + * Layout (path) and menu (component) do not need the @/ prefix + +2. Database Migration + * Please execute database migration before running the platform service + * Use the `dotnet ef database update` command to update the database structure + +## More Information + +* [Shared Domain Layer](./LINGYUN.Platform.Domain.Shared/README.EN.md) +* [Domain Layer](./LINGYUN.Platform.Domain/README.EN.md) +* [Data Access Layer](./LINGYUN.Platform.EntityFrameworkCore/README.EN.md) +* [Application Service Contracts Layer](./LINGYUN.Platform.Application.Contracts/README.EN.md) +* [Application Service Implementation Layer](./LINGYUN.Platform.Application/README.EN.md) +* [HTTP API Layer](./LINGYUN.Platform.HttpApi/README.EN.md) +* [VueVbenAdmin Settings Module](./LINGYUN.Platform.Settings.VueVbenAdmin/README.EN.md) diff --git a/aspnet-core/modules/platform/README.md b/aspnet-core/modules/platform/README.md index 850eda505..e3ff3e3ec 100644 --- a/aspnet-core/modules/platform/README.md +++ b/aspnet-core/modules/platform/README.md @@ -1,27 +1,96 @@ -# LINGYUN.Platform.Domain +# LINGYUN.Platform -平台管理模块 +平台管理模块,提供了一套完整的平台管理功能,包括菜单管理、布局管理、数据字典、包管理等功能。 -#### 注意 +## 功能特性 -> 动态菜单管理 +* 菜单管理 + * 多级菜单结构 + * 用户菜单定制 + * 角色菜单权限 + * 菜单收藏功能 + * 动态菜单预置 - ## IDataSeedContributor - 说明: 用于预置菜单数据的接口,模块默认已初始化与vue-admin相关的菜单 +* 布局管理 + * 布局视图实体 + * 布局数据关联 + * 多框架支持 - ## 其他注意事项 +* 数据字典 + * 数据字典管理 + * 数据字典项管理 + * 数据字典种子数据 - 1、不论是布局(path)还是菜单(component),都不需要添加 @/ 的前缀(这通常在前端定义路由时需要),因为前端不支持这样的形式 +* 包管理 + * 包版本控制 + * 包文件管理 + * Blob存储集成 + * 包过滤规范 - 2、请在运行平台服务之前,执行 dotnet ef database update 更新平台服务数据结构 - +* VueVbenAdmin集成 + * 主题设置 + * 布局设置 + * 菜单设置 + * 标题栏设置 + * 多标签页设置 -## 配置使用 +## 项目结构 +* `LINGYUN.Platform.Domain.Shared`: 共享领域层 +* `LINGYUN.Platform.Domain`: 领域层 +* `LINGYUN.Platform.EntityFrameworkCore`: 数据访问层 +* `LINGYUN.Platform.Application.Contracts`: 应用服务契约层 +* `LINGYUN.Platform.Application`: 应用服务实现层 +* `LINGYUN.Platform.HttpApi`: HTTP API层 +* `LINGYUN.Platform.Settings.VueVbenAdmin`: VueVbenAdmin前端框架设置模块 +## 快速开始 + +1. 引用模块 ```csharp -[DependsOn(typeof(PlatformDomainModule))] +[DependsOn( + typeof(PlatformDomainModule), + typeof(PlatformApplicationModule), + typeof(PlatformHttpApiModule), + typeof(PlatformSettingsVueVbenAdminModule) +)] public class YouProjectModule : AbpModule { - // other + // other } +``` + +2. 配置数据库 +```json +{ + "ConnectionStrings": { + "Platform": "Server=localhost;Database=Platform;Trusted_Connection=True" + } +} +``` + +3. 更新数据库 +```bash +dotnet ef database update +``` + +## 注意事项 + +1. 动态菜单管理 + * 模块默认已初始化与vue-admin相关的菜单 + * 可以通过 `IDataSeedContributor` 接口预置菜单数据 + * 布局(path)和菜单(component)不需要添加 @/ 前缀 + +2. 数据库迁移 + * 请在运行平台服务之前执行数据库迁移 + * 使用 `dotnet ef database update` 命令更新数据库结构 + +## 更多信息 + +* [共享领域层](./LINGYUN.Platform.Domain.Shared/README.md) +* [领域层](./LINGYUN.Platform.Domain/README.md) +* [数据访问层](./LINGYUN.Platform.EntityFrameworkCore/README.md) +* [应用服务契约层](./LINGYUN.Platform.Application.Contracts/README.md) +* [应用服务实现层](./LINGYUN.Platform.Application/README.md) +* [HTTP API层](./LINGYUN.Platform.HttpApi/README.md) +* [VueVbenAdmin设置模块](./LINGYUN.Platform.Settings.VueVbenAdmin/README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/README.EN.md new file mode 100644 index 000000000..f93eb6e33 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/README.EN.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.IM.SignalR + +Instant messaging module implemented based on SignalR. + +## Features + +* Message sender provider implemented with SignalR +* Integration with ABP SignalR module +* Multi-language support + +## Dependencies + +* [LINGYUN.Abp.IM](../LINGYUN.Abp.IM/README.EN.md) +* `AbpAspNetCoreSignalRModule` + +## Installation + +1. First, install the LINGYUN.Abp.IM.SignalR package to your project: + +```bash +dotnet add package LINGYUN.Abp.IM.SignalR +``` + +2. Add `AbpIMSignalRModule` to your module's dependency list: + +```csharp +[DependsOn(typeof(AbpIMSignalRModule))] +public class YourModule : AbpModule +{ +} +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/README.md new file mode 100644 index 000000000..aaa59ee50 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/README.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.IM.SignalR + +基于 SignalR 实现的即时通讯模块。 + +## 功能特性 + +* 基于 SignalR 实现的消息发送者提供程序 +* 集成 ABP SignalR 模块 +* 多语言支持 + +## 依赖模块 + +* [LINGYUN.Abp.IM](../LINGYUN.Abp.IM/README.md) +* `AbpAspNetCoreSignalRModule` + +## 配置使用 + +1. 首先,需要安装 LINGYUN.Abp.IM.SignalR 到你的项目中: + +```bash +dotnet add package LINGYUN.Abp.IM.SignalR +``` + +2. 添加 `AbpIMSignalRModule` 到你的模块的依赖列表: + +```csharp +[DependsOn(typeof(AbpIMSignalRModule))] +public class YourModule : AbpModule +{ +} +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/README.EN.md new file mode 100644 index 000000000..dd29b29c2 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/README.EN.md @@ -0,0 +1,25 @@ +# LINGYUN.Abp.IM + +The foundation module for instant messaging. + +## Features + +* Provides instant messaging infrastructure +* Provides message sender provider interface +* Extensible message sender providers + +## Configuration + +The module uses `AbpIMOptions` configuration class: + +```csharp +Configure(options => +{ + // Add custom message sender provider + options.Providers.Add(); +}); +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/README.md new file mode 100644 index 000000000..5df983d4c --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/README.md @@ -0,0 +1,25 @@ +# LINGYUN.Abp.IM + +即时通讯模块的基础模块。 + +## 功能特性 + +* 提供即时通讯基础设施 +* 提供消息发送者提供程序接口 +* 可扩展的消息发送者提供程序 + +## 配置使用 + +模块配置使用 `AbpIMOptions` 选项类: + +```csharp +Configure(options => +{ + // 添加自定义消息发送者提供程序 + options.Providers.Add(); +}); +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/README.EN.md new file mode 100644 index 000000000..bc4d2234d --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/README.EN.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.MessageService.Application.Contracts + +Message service application layer contracts module. + +## Features + +* Defines application layer interfaces for message service +* Defines DTOs for message service +* Provides multi-language resources +* Supports virtual file system + +## Dependencies + +* [LINGYUN.Abp.MessageService.Domain.Shared](../LINGYUN.Abp.MessageService.Domain.Shared/README.EN.md) + +## Installation + +1. First, install the LINGYUN.Abp.MessageService.Application.Contracts package to your project: + +```bash +dotnet add package LINGYUN.Abp.MessageService.Application.Contracts +``` + +2. Add `AbpMessageServiceApplicationContractsModule` to your module's dependency list: + +```csharp +[DependsOn(typeof(AbpMessageServiceApplicationContractsModule))] +public class YourModule : AbpModule +{ +} +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/README.md new file mode 100644 index 000000000..40fcfdddf --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/README.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.MessageService.Application.Contracts + +消息服务应用层契约模块。 + +## 功能特性 + +* 定义消息服务的应用层接口 +* 定义消息服务的 DTO +* 提供多语言资源 +* 支持虚拟文件系统 + +## 依赖模块 + +* [LINGYUN.Abp.MessageService.Domain.Shared](../LINGYUN.Abp.MessageService.Domain.Shared/README.md) + +## 配置使用 + +1. 首先,需要安装 LINGYUN.Abp.MessageService.Application.Contracts 到你的项目中: + +```bash +dotnet add package LINGYUN.Abp.MessageService.Application.Contracts +``` + +2. 添加 `AbpMessageServiceApplicationContractsModule` 到你的模块的依赖列表: + +```csharp +[DependsOn(typeof(AbpMessageServiceApplicationContractsModule))] +public class YourModule : AbpModule +{ +} +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/README.EN.md new file mode 100644 index 000000000..99b153e45 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/README.EN.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.MessageService.Application + +Message service application layer module. + +## Features + +* Implements application layer interfaces for message service +* Implements business logic for message service +* Supports automatic object mapping + +## Dependencies + +* [LINGYUN.Abp.MessageService.Application.Contracts](../LINGYUN.Abp.MessageService.Application.Contracts/README.EN.md) +* [LINGYUN.Abp.MessageService.Domain](../LINGYUN.Abp.MessageService.Domain/README.EN.md) + +## Installation + +1. First, install the LINGYUN.Abp.MessageService.Application package to your project: + +```bash +dotnet add package LINGYUN.Abp.MessageService.Application +``` + +2. Add `AbpMessageServiceApplicationModule` to your module's dependency list: + +```csharp +[DependsOn(typeof(AbpMessageServiceApplicationModule))] +public class YourModule : AbpModule +{ +} +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/README.md new file mode 100644 index 000000000..b4a905252 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/README.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.MessageService.Application + +消息服务应用层模块。 + +## 功能特性 + +* 实现消息服务的应用层接口 +* 实现消息服务的业务逻辑 +* 支持自动对象映射 + +## 依赖模块 + +* [LINGYUN.Abp.MessageService.Application.Contracts](../LINGYUN.Abp.MessageService.Application.Contracts/README.md) +* [LINGYUN.Abp.MessageService.Domain](../LINGYUN.Abp.MessageService.Domain/README.md) + +## 配置使用 + +1. 首先,需要安装 LINGYUN.Abp.MessageService.Application 到你的项目中: + +```bash +dotnet add package LINGYUN.Abp.MessageService.Application +``` + +2. 添加 `AbpMessageServiceApplicationModule` 到你的模块的依赖列表: + +```csharp +[DependsOn(typeof(AbpMessageServiceApplicationModule))] +public class YourModule : AbpModule +{ +} +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/README.EN.md new file mode 100644 index 000000000..bb04dd515 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/README.EN.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.MessageService.Domain.Shared + +Message service domain shared layer module. + +## Features + +* Defines message service infrastructure +* Provides multi-language resources +* Defines exception localization +* Defines error codes + +## Dependencies + +* `AbpLocalizationModule` + +## Installation + +1. First, install the LINGYUN.Abp.MessageService.Domain.Shared package to your project: + +```bash +dotnet add package LINGYUN.Abp.MessageService.Domain.Shared +``` + +2. Add `AbpMessageServiceDomainSharedModule` to your module's dependency list: + +```csharp +[DependsOn(typeof(AbpMessageServiceDomainSharedModule))] +public class YourModule : AbpModule +{ +} +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/README.md new file mode 100644 index 000000000..e37d9b2ff --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/README.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.MessageService.Domain.Shared + +消息服务领域共享层模块。 + +## 功能特性 + +* 定义消息服务的基础设施 +* 提供多语言资源 +* 定义异常本地化 +* 定义错误代码 + +## 依赖模块 + +* `AbpLocalizationModule` + +## 配置使用 + +1. 首先,需要安装 LINGYUN.Abp.MessageService.Domain.Shared 到你的项目中: + +```bash +dotnet add package LINGYUN.Abp.MessageService.Domain.Shared +``` + +2. 添加 `AbpMessageServiceDomainSharedModule` 到你的模块的依赖列表: + +```csharp +[DependsOn(typeof(AbpMessageServiceDomainSharedModule))] +public class YourModule : AbpModule +{ +} +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/README.EN.md new file mode 100644 index 000000000..894edc79f --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/README.EN.md @@ -0,0 +1,40 @@ +# LINGYUN.Abp.MessageService.Domain + +Message service domain layer module. + +## Features + +* Implements message service domain logic +* Integrates object extension functionality +* Integrates caching functionality +* Integrates notification functionality +* Supports auto mapping +* Supports multi-language + +## Dependencies + +* `AbpAutoMapperModule` +* `AbpCachingModule` +* `AbpNotificationsModule` +* [LINGYUN.Abp.MessageService.Domain.Shared](../LINGYUN.Abp.MessageService.Domain.Shared/README.EN.md) + +## Installation + +1. First, install the LINGYUN.Abp.MessageService.Domain package to your project: + +```bash +dotnet add package LINGYUN.Abp.MessageService.Domain +``` + +2. Add `AbpMessageServiceDomainModule` to your module's dependency list: + +```csharp +[DependsOn(typeof(AbpMessageServiceDomainModule))] +public class YourModule : AbpModule +{ +} +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/README.md new file mode 100644 index 000000000..96d6fcc80 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/README.md @@ -0,0 +1,40 @@ +# LINGYUN.Abp.MessageService.Domain + +消息服务领域层模块。 + +## 功能特性 + +* 实现消息服务的领域逻辑 +* 集成对象扩展功能 +* 集成缓存功能 +* 集成通知功能 +* 支持自动映射 +* 支持多语言 + +## 依赖模块 + +* `AbpAutoMapperModule` +* `AbpCachingModule` +* `AbpNotificationsModule` +* [LINGYUN.Abp.MessageService.Domain.Shared](../LINGYUN.Abp.MessageService.Domain.Shared/README.md) + +## 配置使用 + +1. 首先,需要安装 LINGYUN.Abp.MessageService.Domain 到你的项目中: + +```bash +dotnet add package LINGYUN.Abp.MessageService.Domain +``` + +2. 添加 `AbpMessageServiceDomainModule` 到你的模块的依赖列表: + +```csharp +[DependsOn(typeof(AbpMessageServiceDomainModule))] +public class YourModule : AbpModule +{ +} +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..10ca3d59e --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.MessageService.EntityFrameworkCore + +EntityFrameworkCore implementation module for message service. + +## Features + +* Implements data access layer for message service +* Provides default repository implementations +* Implements repositories for the following entities: + * ChatGroup + * UserChatGroup + * UserChatCard + * UserChatSetting + * UserChatFriend + +## Dependencies + +* [LINGYUN.Abp.MessageService.Domain](../LINGYUN.Abp.MessageService.Domain/README.EN.md) +* `AbpEntityFrameworkCoreModule` + +## Installation + +1. First, install the LINGYUN.Abp.MessageService.EntityFrameworkCore package to your project: + +```bash +dotnet add package LINGYUN.Abp.MessageService.EntityFrameworkCore +``` + +2. Add `AbpMessageServiceEntityFrameworkCoreModule` to your module's dependency list: + +```csharp +[DependsOn(typeof(AbpMessageServiceEntityFrameworkCoreModule))] +public class YourModule : AbpModule +{ +} +``` + +3. Add message service related DbSet to your DbContext: + +```csharp +public class YourDbContext : AbpDbContext, IMessageServiceDbContext +{ + public DbSet ChatGroups { get; set; } + public DbSet UserChatGroups { get; set; } + public DbSet UserChatCards { get; set; } + public DbSet UserChatSettings { get; set; } + public DbSet UserChatFriends { get; set; } + + public YourDbContext(DbContextOptions options) + : base(options) + { + } +} +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/README.md new file mode 100644 index 000000000..6c9c036f2 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.MessageService.EntityFrameworkCore + +消息服务的 EntityFrameworkCore 实现模块。 + +## 功能特性 + +* 实现消息服务的数据访问层 +* 提供默认仓储实现 +* 实现以下实体的仓储: + * ChatGroup - 聊天组 + * UserChatGroup - 用户聊天组 + * UserChatCard - 用户聊天卡片 + * UserChatSetting - 用户聊天设置 + * UserChatFriend - 用户聊天好友 + +## 依赖模块 + +* [LINGYUN.Abp.MessageService.Domain](../LINGYUN.Abp.MessageService.Domain/README.md) +* `AbpEntityFrameworkCoreModule` + +## 配置使用 + +1. 首先,需要安装 LINGYUN.Abp.MessageService.EntityFrameworkCore 到你的项目中: + +```bash +dotnet add package LINGYUN.Abp.MessageService.EntityFrameworkCore +``` + +2. 添加 `AbpMessageServiceEntityFrameworkCoreModule` 到你的模块的依赖列表: + +```csharp +[DependsOn(typeof(AbpMessageServiceEntityFrameworkCoreModule))] +public class YourModule : AbpModule +{ +} +``` + +3. 在你的 DbContext 中添加消息服务相关的 DbSet: + +```csharp +public class YourDbContext : AbpDbContext, IMessageServiceDbContext +{ + public DbSet ChatGroups { get; set; } + public DbSet UserChatGroups { get; set; } + public DbSet UserChatCards { get; set; } + public DbSet UserChatSettings { get; set; } + public DbSet UserChatFriends { get; set; } + + public YourDbContext(DbContextOptions options) + : base(options) + { + } +} +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/README.EN.md new file mode 100644 index 000000000..4039175de --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.MessageService.HttpApi.Client + +Message service HTTP API client module. + +## Features + +* Provides HTTP client proxies for message service +* Automatic HTTP client proxy service registration + +## Dependencies + +* [LINGYUN.Abp.MessageService.Application.Contracts](../LINGYUN.Abp.MessageService.Application.Contracts/README.EN.md) +* `AbpHttpClientModule` + +## Installation + +1. First, install the LINGYUN.Abp.MessageService.HttpApi.Client package to your project: + +```bash +dotnet add package LINGYUN.Abp.MessageService.HttpApi.Client +``` + +2. Add `AbpMessageServiceHttpApiClientModule` to your module's dependency list: + +```csharp +[DependsOn(typeof(AbpMessageServiceHttpApiClientModule))] +public class YourModule : AbpModule +{ +} +``` + +3. Configure remote service URL: + +```json +{ + "RemoteServices": { + "AbpMessageService": { + "BaseUrl": "http://your-service-url" + } + } +} +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/README.md new file mode 100644 index 000000000..d79bfe49b --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/README.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.MessageService.HttpApi.Client + +消息服务 HTTP API 客户端模块。 + +## 功能特性 + +* 提供消息服务的 HTTP 客户端代理 +* 自动注册 HTTP 客户端代理服务 + +## 依赖模块 + +* [LINGYUN.Abp.MessageService.Application.Contracts](../LINGYUN.Abp.MessageService.Application.Contracts/README.md) +* `AbpHttpClientModule` + +## 配置使用 + +1. 首先,需要安装 LINGYUN.Abp.MessageService.HttpApi.Client 到你的项目中: + +```bash +dotnet add package LINGYUN.Abp.MessageService.HttpApi.Client +``` + +2. 添加 `AbpMessageServiceHttpApiClientModule` 到你的模块的依赖列表: + +```csharp +[DependsOn(typeof(AbpMessageServiceHttpApiClientModule))] +public class YourModule : AbpModule +{ +} +``` + +3. 配置远程服务地址: + +```json +{ + "RemoteServices": { + "AbpMessageService": { + "BaseUrl": "http://your-service-url" + } + } +} +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/README.EN.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/README.EN.md new file mode 100644 index 000000000..dd21ba291 --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/README.EN.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.MessageService.HttpApi + +Message service HTTP API module. + +## Features + +* Provides HTTP API interfaces for message service +* Supports MVC data annotation localization +* Automatic API controller registration + +## Dependencies + +* [LINGYUN.Abp.MessageService.Application.Contracts](../LINGYUN.Abp.MessageService.Application.Contracts/README.EN.md) +* `AbpAspNetCoreMvcModule` + +## Installation + +1. First, install the LINGYUN.Abp.MessageService.HttpApi package to your project: + +```bash +dotnet add package LINGYUN.Abp.MessageService.HttpApi +``` + +2. Add `AbpMessageServiceHttpApiModule` to your module's dependency list: + +```csharp +[DependsOn(typeof(AbpMessageServiceHttpApiModule))] +public class YourModule : AbpModule +{ +} +``` + +## More + +[中文文档](README.md) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/README.md b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/README.md new file mode 100644 index 000000000..42f0ea60b --- /dev/null +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/README.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.MessageService.HttpApi + +消息服务 HTTP API 模块。 + +## 功能特性 + +* 提供消息服务的 HTTP API 接口 +* 支持 MVC 数据注解本地化 +* 自动注册 API 控制器 + +## 依赖模块 + +* [LINGYUN.Abp.MessageService.Application.Contracts](../LINGYUN.Abp.MessageService.Application.Contracts/README.md) +* `AbpAspNetCoreMvcModule` + +## 配置使用 + +1. 首先,需要安装 LINGYUN.Abp.MessageService.HttpApi 到你的项目中: + +```bash +dotnet add package LINGYUN.Abp.MessageService.HttpApi +``` + +2. 添加 `AbpMessageServiceHttpApiModule` 到你的模块的依赖列表: + +```csharp +[DependsOn(typeof(AbpMessageServiceHttpApiModule))] +public class YourModule : AbpModule +{ +} +``` + +## 更多 + +[English document](README.EN.md) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md new file mode 100644 index 000000000..75783da2a --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md @@ -0,0 +1,66 @@ +# LINGYUN.Abp.ExceptionHandling.Notifications + +A real-time notification type based on the ABP framework's **IExceptionSubscriber** interface, used to send exception information to users through real-time notifications. + +## Features + +* Supports real-time exception notifications +* Supports multi-tenancy +* Supports notification templates +* Supports system-level notifications +* Integrated with common notification module + +## Configuration and Usage + +Before use, you need to configure **AbpExceptionHandlingOptions** to define which exceptions need notifications. + +```csharp + [DependsOn( + typeof(AbpNotificationsExceptionHandlingModule) + )] + public class YouProjectModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Customize exceptions to handle + Configure(options => + { + // Add exception types that need to be handled + options.Handlers.Add(); + }); + } + } +``` + +## Notification Content + +Exception notifications include the following information: +* `header`: Exception notification header information +* `footer`: Exception notification footer information +* `loglevel`: Log level +* `stackTrace`: Exception stack trace information + +## Notification Names + +The module uses the following notification names: +* `NotificationsCommonNotificationNames.ExceptionHandling`: Exception handling notification name + +## Notification Template + +* Sender: System +* Notification Level: Error +* Multi-tenant Support: Yes + +## Dependencies + +* `AbpExceptionHandlingModule`: Base exception handling module +* `AbpNotificationsCommonModule`: Common notification module + +## Related Links + +* [Base Exception Handling Module](../../../framework/common/LINGYUN.Abp.ExceptionHandling/README.EN.md) +* [Exception Email Notification Module](../../../framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md) + +## More + +For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin). diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md new file mode 100644 index 000000000..7ef89b656 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md @@ -0,0 +1,66 @@ +# LINGYUN.Abp.ExceptionHandling.Notifications + +基于abp框架底层的**IExceptionSubscriber**的实时通知类型,用于将异常信息通过实时通知方式发送给用户。 + +## 功能特性 + +* 支持异常实时通知 +* 支持多租户 +* 支持通知模板 +* 支持系统级通知 +* 集成了通用通知模块 + +## 配置使用 + +使用前需要配置**AbpExceptionHandlingOptions**定义需要发送通知的异常。 + +```csharp + [DependsOn( + typeof(AbpNotificationsExceptionHandlingModule) + )] + public class YouProjectModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + // 自定义需要处理的异常 + Configure(options => + { + // 加入需要处理的异常类型 + options.Handlers.Add(); + }); + } + } +``` + +## 通知内容 + +异常通知包含以下信息: +* `header`: 异常通知头部信息 +* `footer`: 异常通知底部信息 +* `loglevel`: 日志级别 +* `stackTrace`: 异常堆栈信息 + +## 通知名称 + +模块使用以下通知名称: +* `NotificationsCommonNotificationNames.ExceptionHandling`: 异常处理通知名称 + +## 通知模板 + +* 发送者: System +* 通知级别: Error +* 支持多租户: 是 + +## 依赖模块 + +* `AbpExceptionHandlingModule`: 基础异常处理模块 +* `AbpNotificationsCommonModule`: 通用通知模块 + +## 相关链接 + +* [基础异常处理模块](../../../framework/common/LINGYUN.Abp.ExceptionHandling/README.md) +* [异常邮件通知模块](../../../framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md) + +## 更多 + +有关更多信息和配置示例,请参阅[文档](https://github.com/colinin/abp-next-admin)。 diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/README.EN.md new file mode 100644 index 000000000..e2e1f44f2 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/README.EN.md @@ -0,0 +1,79 @@ +# LINGYUN.Abp.Notifications.Application.Contracts + +The application layer contracts module of the notification system, providing application service interface definitions and data transfer objects. + +## Features + +* Notification application service interface definitions +* Notification subscription application service interface definitions +* Notification data transfer object (DTO) definitions +* Notification permission definitions + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Application Service Interfaces + +### INotificationAppService + +* GetAsync - Get notification details +* GetListAsync - Get notification list +* DeleteAsync - Delete notification +* MarkReadAsync - Mark notification as read +* MarkAllReadAsync - Mark all notifications as read + +### INotificationSubscriptionAppService + +* SubscribeAsync - Subscribe to notification +* UnSubscribeAsync - Unsubscribe from notification +* GetAssignableSubscribersAsync - Get list of assignable subscribers +* GetSubscribedListAsync - Get list of subscribed notifications + +## Data Transfer Objects + +### NotificationInfo + +* Id - Unique identifier for the notification +* NotificationName - Notification name +* Data - Notification data +* CreationTime - Creation time +* Type - Notification type +* Severity - Notification severity + +### NotificationSubscriptionInfo + +* NotificationName - Notification name +* DisplayName - Display name +* Description - Description +* IsSubscribed - Subscription status + +## Permission Definitions + +* Notifications - Notification management + * Notifications.Manage - Manage notifications + * Notifications.Delete - Delete notifications + * Notifications.Subscribe - Subscribe to notifications + +## Basic Usage + +1. Implement notification application service +```csharp +public class NotificationAppService : ApplicationService, INotificationAppService +{ + public async Task GetAsync(Guid id) + { + // Implement logic to get notification details + } +} +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/README.md new file mode 100644 index 000000000..82ea7ac27 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/README.md @@ -0,0 +1,79 @@ +# LINGYUN.Abp.Notifications.Application.Contracts + +通知系统的应用层契约模块,提供了通知系统的应用服务接口定义和数据传输对象。 + +## 功能特性 + +* 通知应用服务接口定义 +* 通知订阅应用服务接口定义 +* 通知数据传输对象(DTO)定义 +* 通知权限定义 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 应用服务接口 + +### INotificationAppService + +* GetAsync - 获取通知详情 +* GetListAsync - 获取通知列表 +* DeleteAsync - 删除通知 +* MarkReadAsync - 标记通知为已读 +* MarkAllReadAsync - 标记所有通知为已读 + +### INotificationSubscriptionAppService + +* SubscribeAsync - 订阅通知 +* UnSubscribeAsync - 取消订阅通知 +* GetAssignableSubscribersAsync - 获取可分配的订阅者列表 +* GetSubscribedListAsync - 获取已订阅的通知列表 + +## 数据传输对象 + +### NotificationInfo + +* Id - 通知唯一标识 +* NotificationName - 通知名称 +* Data - 通知数据 +* CreationTime - 创建时间 +* Type - 通知类型 +* Severity - 通知严重程度 + +### NotificationSubscriptionInfo + +* NotificationName - 通知名称 +* DisplayName - 显示名称 +* Description - 描述 +* IsSubscribed - 是否已订阅 + +## 权限定义 + +* Notifications - 通知管理 + * Notifications.Manage - 管理通知 + * Notifications.Delete - 删除通知 + * Notifications.Subscribe - 订阅通知 + +## 基本用法 + +1. 实现通知应用服务 +```csharp +public class NotificationAppService : ApplicationService, INotificationAppService +{ + public async Task GetAsync(Guid id) + { + // 实现获取通知详情的逻辑 + } +} +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/README.EN.md new file mode 100644 index 000000000..fa8059bad --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Notifications.Application + +The application layer module of the notification system, providing application service implementations for the notification system. + +## Features + +* Notification management service +* Notification subscription service +* Notification publishing service +* Notification query service +* Notification status management service + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Application Services + +### INotificationAppService + +* GetAsync - Get notification details +* GetListAsync - Get notification list +* DeleteAsync - Delete notification +* MarkReadAsync - Mark notification as read +* MarkAllReadAsync - Mark all notifications as read + +### INotificationSubscriptionAppService + +* SubscribeAsync - Subscribe to notification +* UnSubscribeAsync - Unsubscribe from notification +* GetAssignableSubscribersAsync - Get list of assignable subscribers +* GetSubscribedListAsync - Get list of subscribed notifications + +## Basic Usage + +1. Send notification +```csharp +await NotificationAppService.PublishAsync( + name: "YourNotification", + data: new NotificationData(), + userIds: new[] { CurrentUser.Id }); +``` + +2. Manage notification subscription +```csharp +await NotificationSubscriptionAppService.SubscribeAsync( + notificationName: "YourNotification"); +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/README.md new file mode 100644 index 000000000..d7a3688ed --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Notifications.Application + +通知系统的应用层模块,提供了通知系统的应用服务实现。 + +## 功能特性 + +* 通知管理服务 +* 通知订阅服务 +* 通知发布服务 +* 通知查询服务 +* 通知状态管理服务 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 应用服务 + +### INotificationAppService + +* GetAsync - 获取通知详情 +* GetListAsync - 获取通知列表 +* DeleteAsync - 删除通知 +* MarkReadAsync - 标记通知为已读 +* MarkAllReadAsync - 标记所有通知为已读 + +### INotificationSubscriptionAppService + +* SubscribeAsync - 订阅通知 +* UnSubscribeAsync - 取消订阅通知 +* GetAssignableSubscribersAsync - 获取可分配的订阅者列表 +* GetSubscribedListAsync - 获取已订阅的通知列表 + +## 基本用法 + +1. 发送通知 +```csharp +await NotificationAppService.PublishAsync( + name: "YourNotification", + data: new NotificationData(), + userIds: new[] { CurrentUser.Id }); +``` + +2. 管理通知订阅 +```csharp +await NotificationSubscriptionAppService.SubscribeAsync( + notificationName: "YourNotification"); +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/README.EN.md new file mode 100644 index 000000000..f31544a70 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/README.EN.md @@ -0,0 +1,113 @@ +# LINGYUN.Abp.Notifications.Common + +The common module of the notification system, providing basic definitions and shared functionality. + +## Features + +* Notification Definitions + * Notification group definitions + * Notification type definitions + * Notification level definitions +* Common Utilities + * Notification data handling + * Notification status management +* Extension Features + * Notification data extensions + * Notification provider extensions + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsCommonModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Definitions + +### Notification Group + +```csharp +public class NotificationGroupDefinition +{ + public string Name { get; } + public string DisplayName { get; } + public string Description { get; } + public bool AllowSubscriptionToClients { get; } +} +``` + +### Notification Definition + +```csharp +public class NotificationDefinition +{ + public string Name { get; } + public string DisplayName { get; } + public string Description { get; } + public NotificationType NotificationType { get; } + public NotificationLifetime Lifetime { get; } + public bool AllowSubscriptionToClients { get; } +} +``` + +## Basic Usage + +1. Define Notification Group +```csharp +public class YourNotificationGroupDefinitionProvider : NotificationGroupDefinitionProvider +{ + public override void Define(INotificationGroupDefinitionContext context) + { + context.Add( + new NotificationGroupDefinition( + name: "App.Notifications", + displayName: L("AppNotifications"), + description: L("AppNotificationsDescription") + ) + ); + } +} +``` + +2. Define Notification +```csharp +public class YourNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + context.Add( + new NotificationDefinition( + name: "App.NewMessage", + displayName: L("NewMessage"), + description: L("NewMessageDescription"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent + ) + ); + } +} +``` + +3. Use Notification Data Extensions +```csharp +public static class NotificationDataExtensions +{ + public static void SetTitle(this NotificationData data, string title) + { + data.ExtraProperties["Title"] = title; + } + + public static string GetTitle(this NotificationData data) + { + return data.ExtraProperties.GetOrDefault("Title") as string; + } +} +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [Notifications Documentation](https://docs.abp.io/en/abp/latest/Notifications) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/README.md new file mode 100644 index 000000000..1c9a70be6 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/README.md @@ -0,0 +1,113 @@ +# LINGYUN.Abp.Notifications.Common + +通知系统的公共模块,提供了通知系统的基础定义和共享功能。 + +## 功能特性 + +* 通知定义 + * 通知组定义 + * 通知类型定义 + * 通知级别定义 +* 通用工具类 + * 通知数据处理 + * 通知状态管理 +* 扩展功能 + * 通知数据扩展 + * 通知提供者扩展 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsCommonModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基础定义 + +### 通知组 + +```csharp +public class NotificationGroupDefinition +{ + public string Name { get; } + public string DisplayName { get; } + public string Description { get; } + public bool AllowSubscriptionToClients { get; } +} +``` + +### 通知定义 + +```csharp +public class NotificationDefinition +{ + public string Name { get; } + public string DisplayName { get; } + public string Description { get; } + public NotificationType NotificationType { get; } + public NotificationLifetime Lifetime { get; } + public bool AllowSubscriptionToClients { get; } +} +``` + +## 基本用法 + +1. 定义通知组 +```csharp +public class YourNotificationGroupDefinitionProvider : NotificationGroupDefinitionProvider +{ + public override void Define(INotificationGroupDefinitionContext context) + { + context.Add( + new NotificationGroupDefinition( + name: "App.Notifications", + displayName: L("AppNotifications"), + description: L("AppNotificationsDescription") + ) + ); + } +} +``` + +2. 定义通知 +```csharp +public class YourNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + context.Add( + new NotificationDefinition( + name: "App.NewMessage", + displayName: L("NewMessage"), + description: L("NewMessageDescription"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent + ) + ); + } +} +``` + +3. 使用通知数据扩展 +```csharp +public static class NotificationDataExtensions +{ + public static void SetTitle(this NotificationData data, string title) + { + data.ExtraProperties["Title"] = title; + } + + public static string GetTitle(this NotificationData data) + { + return data.ExtraProperties.GetOrDefault("Title") as string; + } +} +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [通知系统文档](https://docs.abp.io/en/abp/latest/Notifications) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/README.EN.md new file mode 100644 index 000000000..b82516bba --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/README.EN.md @@ -0,0 +1,65 @@ +# LINGYUN.Abp.Notifications.Core + +The core module of the notification system, providing basic functionality and definitions for the notification system. + +## Features + +* Notification definition management +* Notification group definition management +* Extensible notification provider mechanism +* Support for custom notification definition providers + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Notifications": { + "DeletedNotifications": [], // List of notification definitions to be deleted + "DeletedNotificationGroups": [] // List of notification group definitions to be deleted + } +} +``` + +## Basic Usage + +1. Implement custom notification definition provider +```csharp +public class YourNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + // Define notifications + context.Add( + new NotificationDefinition( + name: "YourNotification", + displayName: L("YourNotification"), + description: L("YourNotificationDescription"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true) + ); + } +} +``` + +2. Register notification definition provider +```csharp +Configure(options => +{ + options.DefinitionProviders.Add(); +}); +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/README.md new file mode 100644 index 000000000..e5c857cba --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/README.md @@ -0,0 +1,65 @@ +# LINGYUN.Abp.Notifications.Core + +通知系统的核心模块,提供了通知系统的基础功能和定义。 + +## 功能特性 + +* 通知定义管理 +* 通知组定义管理 +* 可扩展的通知提供者机制 +* 支持自定义通知定义提供者 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Notifications": { + "DeletedNotifications": [], // 需要删除的通知定义列表 + "DeletedNotificationGroups": [] // 需要删除的通知组定义列表 + } +} +``` + +## 基本用法 + +1. 实现自定义通知定义提供者 +```csharp +public class YourNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + // 定义通知 + context.Add( + new NotificationDefinition( + name: "YourNotification", + displayName: L("YourNotification"), + description: L("YourNotificationDescription"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true) + ); + } +} +``` + +2. 注册通知定义提供者 +```csharp +Configure(options => +{ + options.DefinitionProviders.Add(); +}); +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/README.EN.md new file mode 100644 index 000000000..2a6dfa65d --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Notifications.Domain.Shared + +The shared domain layer module of the notification system, providing shared constants, enums, and other domain objects for the notification system. + +## Features + +* Notification type definition +* Notification severity definition +* Notification status definition +* Notification lifetime definition +* Notification constant definition + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Enum Definitions + +### NotificationType + +* Application - Application notification +* System - System notification +* User - User notification + +### NotificationSeverity + +* Info - Information +* Success - Success +* Warn - Warning +* Error - Error +* Fatal - Fatal error + +### NotificationLifetime + +* Persistent - Persistent notification +* OnlyOne - One-time notification + +## Basic Usage + +1. Use notification type +```csharp +var notificationType = NotificationType.Application; +``` + +2. Use notification severity +```csharp +var severity = NotificationSeverity.Info; +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/README.md new file mode 100644 index 000000000..1be73dc88 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Notifications.Domain.Shared + +通知系统的共享领域层模块,提供了通知系统的共享常量、枚举和其他领域对象。 + +## 功能特性 + +* 通知类型定义 +* 通知严重程度定义 +* 通知状态定义 +* 通知生命周期定义 +* 通知常量定义 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsDomainSharedModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 枚举定义 + +### NotificationType + +* Application - 应用程序通知 +* System - 系统通知 +* User - 用户通知 + +### NotificationSeverity + +* Info - 信息 +* Success - 成功 +* Warn - 警告 +* Error - 错误 +* Fatal - 致命错误 + +### NotificationLifetime + +* Persistent - 持久化通知 +* OnlyOne - 一次性通知 + +## 基本用法 + +1. 使用通知类型 +```csharp +var notificationType = NotificationType.Application; +``` + +2. 使用通知严重程度 +```csharp +var severity = NotificationSeverity.Info; +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/README.EN.md new file mode 100644 index 000000000..dd880d4aa --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/README.EN.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.Notifications.Domain + +The domain layer module of the notification system, providing domain models and business logic for the notification system. + +## Features + +* Notification entity definition +* Notification subscription management +* Notification status management +* Notification data extension support +* Support for custom notification data + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Domain Models + +### Notification + +* Id - Unique identifier for the notification +* Name - Notification name +* NotificationData - Notification data +* CreationTime - Creation time +* Type - Notification type +* Severity - Notification severity +* ExtraProperties - Extension properties + +### NotificationSubscription + +* UserId - User identifier +* NotificationName - Notification name +* CreationTime - Creation time + +## Basic Usage + +1. Create notification +```csharp +var notification = new Notification( + id: GuidGenerator.Create(), + name: "YourNotification", + data: new NotificationData(), + tenantId: CurrentTenant.Id); +``` + +2. Manage notification subscriptions +```csharp +await NotificationSubscriptionManager.SubscribeAsync( + userId: CurrentUser.Id, + notificationName: "YourNotification"); +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/README.md new file mode 100644 index 000000000..ad27db02d --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/README.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.Notifications.Domain + +通知系统的领域层模块,提供了通知系统的领域模型和业务逻辑。 + +## 功能特性 + +* 通知实体定义 +* 通知订阅管理 +* 通知状态管理 +* 通知数据扩展支持 +* 支持自定义通知数据 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 领域模型 + +### Notification + +* Id - 通知唯一标识 +* Name - 通知名称 +* NotificationData - 通知数据 +* CreationTime - 创建时间 +* Type - 通知类型 +* Severity - 通知严重程度 +* ExtraProperties - 扩展属性 + +### NotificationSubscription + +* UserId - 用户标识 +* NotificationName - 通知名称 +* CreationTime - 创建时间 + +## 基本用法 + +1. 创建通知 +```csharp +var notification = new Notification( + id: GuidGenerator.Create(), + name: "YourNotification", + data: new NotificationData(), + tenantId: CurrentTenant.Id); +``` + +2. 管理通知订阅 +```csharp +await NotificationSubscriptionManager.SubscribeAsync( + userId: CurrentUser.Id, + notificationName: "YourNotification"); +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/README.EN.md new file mode 100644 index 000000000..ec913aa7d --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/README.EN.md @@ -0,0 +1,98 @@ +# LINGYUN.Abp.Notifications.Emailing + +The email sending module of the notification system, providing functionality to send notifications via email. + +## Features + +* Email notification sending +* Email template support +* Support for HTML format emails +* Support for multiple recipients +* Support for CC and BCC + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsEmailingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Notifications": { + "Emailing": { + "Templates": { + "Default": { + "Template": "DefaultTemplate", + "Culture": "en" + } + } + } + } +} +``` + +## Basic Usage + +1. Configure Email Settings +```csharp +Configure(options => +{ + options.DefaultFromAddress = "noreply@example.com"; + options.DefaultFromDisplayName = "Notification System"; +}); +``` + +2. Send Email Notification +```csharp +public class YourNotificationHandler : INotificationHandler +{ + private readonly IEmailSender _emailSender; + + public YourNotificationHandler(IEmailSender emailSender) + { + _emailSender = emailSender; + } + + public async Task HandleAsync(NotificationInfo notification) + { + await _emailSender.SendAsync( + to: notification.UserEmail, + subject: notification.Title, + body: notification.Content, + isBodyHtml: true + ); + } +} +``` + +3. Use Email Template +```csharp +public async Task SendWithTemplateAsync() +{ + var template = await _templateRenderer.RenderAsync( + "DefaultTemplate", + new { + Title = "Notification Title", + Content = "Notification Content" + } + ); + + await _emailSender.SendAsync( + to: "user@example.com", + subject: "Notification", + body: template, + isBodyHtml: true + ); +} +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [Emailing Documentation](https://docs.abp.io/en/abp/latest/Emailing) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/README.md new file mode 100644 index 000000000..54a1dfe8a --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/README.md @@ -0,0 +1,98 @@ +# LINGYUN.Abp.Notifications.Emailing + +通知系统的邮件发送模块,提供了通过邮件发送通知的功能。 + +## 功能特性 + +* 邮件通知发送 +* 邮件模板支持 +* 支持HTML格式邮件 +* 支持多收件人 +* 支持抄送和密送 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsEmailingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Notifications": { + "Emailing": { + "Templates": { + "Default": { + "Template": "DefaultTemplate", + "Culture": "zh-Hans" + } + } + } + } +} +``` + +## 基本用法 + +1. 配置邮件设置 +```csharp +Configure(options => +{ + options.DefaultFromAddress = "noreply@example.com"; + options.DefaultFromDisplayName = "Notification System"; +}); +``` + +2. 发送邮件通知 +```csharp +public class YourNotificationHandler : INotificationHandler +{ + private readonly IEmailSender _emailSender; + + public YourNotificationHandler(IEmailSender emailSender) + { + _emailSender = emailSender; + } + + public async Task HandleAsync(NotificationInfo notification) + { + await _emailSender.SendAsync( + to: notification.UserEmail, + subject: notification.Title, + body: notification.Content, + isBodyHtml: true + ); + } +} +``` + +3. 使用邮件模板 +```csharp +public async Task SendWithTemplateAsync() +{ + var template = await _templateRenderer.RenderAsync( + "DefaultTemplate", + new { + Title = "通知标题", + Content = "通知内容" + } + ); + + await _emailSender.SendAsync( + to: "user@example.com", + subject: "通知", + body: template, + isBodyHtml: true + ); +} +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [邮件发送文档](https://docs.abp.io/en/abp/latest/Emailing) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..0af2bd173 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/README.EN.md @@ -0,0 +1,72 @@ +# LINGYUN.Abp.Notifications.EntityFrameworkCore + +The EntityFrameworkCore module of the notification system, providing data access implementation for the notification system. + +## Features + +* Notification entity mapping configuration +* Notification repository implementation +* Notification subscription repository implementation +* Support for multiple databases +* Support for custom repository extensions + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Entity Mappings + +### NotificationEfCoreEntityTypeConfiguration + +* Notification - Notification entity mapping + * Id - Primary key mapping + * NotificationName - Notification name mapping + * Data - Notification data mapping + * CreationTime - Creation time mapping + * Type - Notification type mapping + * Severity - Notification severity mapping + +### NotificationSubscriptionEfCoreEntityTypeConfiguration + +* NotificationSubscription - Notification subscription entity mapping + * UserId - User identifier mapping + * NotificationName - Notification name mapping + * CreationTime - Creation time mapping + +## Basic Usage + +1. Configure DbContext +```csharp +public class YourDbContext : AbpDbContext +{ + public DbSet Notifications { get; set; } + public DbSet NotificationSubscriptions { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureNotifications(); + } +} +``` + +2. Configure connection string +```json +{ + "ConnectionStrings": { + "Default": "Server=localhost;Database=YourDb;Trusted_Connection=True" + } +} +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [Entity Framework Core Documentation](https://docs.microsoft.com/ef/core/) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/README.md new file mode 100644 index 000000000..fa6cd7605 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/README.md @@ -0,0 +1,72 @@ +# LINGYUN.Abp.Notifications.EntityFrameworkCore + +通知系统的EntityFrameworkCore模块,提供了通知系统的数据访问实现。 + +## 功能特性 + +* 通知实体映射配置 +* 通知仓储实现 +* 通知订阅仓储实现 +* 支持多数据库 +* 支持自定义仓储扩展 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 实体映射 + +### NotificationEfCoreEntityTypeConfiguration + +* Notification - 通知实体映射 + * Id - 主键映射 + * NotificationName - 通知名称映射 + * Data - 通知数据映射 + * CreationTime - 创建时间映射 + * Type - 通知类型映射 + * Severity - 通知严重程度映射 + +### NotificationSubscriptionEfCoreEntityTypeConfiguration + +* NotificationSubscription - 通知订阅实体映射 + * UserId - 用户标识映射 + * NotificationName - 通知名称映射 + * CreationTime - 创建时间映射 + +## 基本用法 + +1. 配置DbContext +```csharp +public class YourDbContext : AbpDbContext +{ + public DbSet Notifications { get; set; } + public DbSet NotificationSubscriptions { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureNotifications(); + } +} +``` + +2. 配置连接字符串 +```json +{ + "ConnectionStrings": { + "Default": "Server=localhost;Database=YourDb;Trusted_Connection=True" + } +} +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [Entity Framework Core文档](https://docs.microsoft.com/ef/core/) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/README.EN.md new file mode 100644 index 000000000..e190a1af3 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/README.EN.md @@ -0,0 +1,72 @@ +# LINGYUN.Abp.Notifications.HttpApi + +The HTTP API module of the notification system, providing REST API interfaces for the notification system. + +## Features + +* Notification management API +* Notification subscription API +* Notification status management API +* Support for API versioning +* Support for Swagger documentation + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Endpoints + +### NotificationController + +* GET /api/notifications/{id} - Get notification details +* GET /api/notifications - Get notification list +* DELETE /api/notifications/{id} - Delete notification +* PUT /api/notifications/{id}/read - Mark notification as read +* PUT /api/notifications/read - Mark all notifications as read + +### NotificationSubscriptionController + +* POST /api/notifications/subscriptions - Subscribe to notification +* DELETE /api/notifications/subscriptions - Unsubscribe from notification +* GET /api/notifications/subscribers - Get list of assignable subscribers +* GET /api/notifications/subscriptions - Get list of subscribed notifications + +## Basic Usage + +1. Configure Startup +```csharp +public class Startup +{ + public void ConfigureServices(IServiceCollection services) + { + services.AddApplication(); + } + + public void Configure(IApplicationBuilder app) + { + app.InitializeApplication(); + } +} +``` + +2. API Call Examples +```bash +# Get notification list +curl -X GET "https://localhost:44300/api/notifications" + +# Subscribe to notification +curl -X POST "https://localhost:44300/api/notifications/subscriptions" \ + -H "Content-Type: application/json" \ + -d '{"notificationName":"YourNotification"}' +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [ASP.NET Core Documentation](https://docs.microsoft.com/aspnet/core) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/README.md new file mode 100644 index 000000000..e6465f6be --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/README.md @@ -0,0 +1,72 @@ +# LINGYUN.Abp.Notifications.HttpApi + +通知系统的HTTP API模块,提供了通知系统的REST API接口。 + +## 功能特性 + +* 通知管理API +* 通知订阅API +* 通知状态管理API +* 支持API版本控制 +* 支持Swagger文档 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API接口 + +### NotificationController + +* GET /api/notifications/{id} - 获取通知详情 +* GET /api/notifications - 获取通知列表 +* DELETE /api/notifications/{id} - 删除通知 +* PUT /api/notifications/{id}/read - 标记通知为已读 +* PUT /api/notifications/read - 标记所有通知为已读 + +### NotificationSubscriptionController + +* POST /api/notifications/subscriptions - 订阅通知 +* DELETE /api/notifications/subscriptions - 取消订阅通知 +* GET /api/notifications/subscribers - 获取可分配的订阅者列表 +* GET /api/notifications/subscriptions - 获取已订阅的通知列表 + +## 基本用法 + +1. 配置Startup +```csharp +public class Startup +{ + public void ConfigureServices(IServiceCollection services) + { + services.AddApplication(); + } + + public void Configure(IApplicationBuilder app) + { + app.InitializeApplication(); + } +} +``` + +2. 调用API示例 +```bash +# 获取通知列表 +curl -X GET "https://localhost:44300/api/notifications" + +# 订阅通知 +curl -X POST "https://localhost:44300/api/notifications/subscriptions" \ + -H "Content-Type: application/json" \ + -d '{"notificationName":"YourNotification"}' +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [ASP.NET Core文档](https://docs.microsoft.com/aspnet/core) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/README.EN.md new file mode 100644 index 000000000..31ddf6906 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/README.EN.md @@ -0,0 +1,106 @@ +# LINGYUN.Abp.Notifications.PushPlus + +PushPlus implementation of the notification module + +Enables applications to publish real-time notifications through PushPlus + +## Features + +* Support for multiple message types + * Text messages + * HTML messages + * Markdown messages + * Image messages + * Custom template messages +* Message callback support + * Custom callback URL support + * Message sending status callback support +* Multi-channel push support + * WeChat Official Account + * WeChat Work + * Email + * SMS + * WebHook +* Group message support + * Group push support + * Group management support + +## Module Reference + +```csharp +[DependsOn(typeof(AbpNotificationsPushPlusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "PushPlus": { + "Token": "Your PushPlus Token", + "DefaultChannel": "wechat", // Default push channel: wechat/webhook/mail/sms + "DefaultTemplate": "html", // Default message template: html/json/markdown/txt + "DefaultWebhook": "", // Default Webhook URL + "DefaultCallbackUrl": "" // Default callback URL + } +} +``` + +## Basic Usage + +1. Configure PushPlus Service +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.Token = "Your PushPlus Token"; + options.DefaultChannel = "wechat"; + options.DefaultTemplate = "html"; + }); +} +``` + +2. Send Notification +```csharp +public class YourService +{ + private readonly INotificationSender _notificationSender; + + public YourService(INotificationSender notificationSender) + { + _notificationSender = notificationSender; + } + + public async Task SendNotificationAsync() + { + var notificationData = new NotificationData(); + notificationData.TrySetData("title", "Message Title"); + notificationData.TrySetData("content", "Message Content"); + notificationData.SetWebhook("https://your-webhook.com"); + notificationData.SetCallbackUrl("https://your-callback.com"); + + await _notificationSender.SendNofiterAsync( + "YourNotification", + notificationData, + userIds: new[] { CurrentUser.Id } + ); + } +} +``` + +## Important Notes + +1. Registration on the PushPlus platform and obtaining a Token is required before use. +2. Ensure the configured Token is valid and has sufficient permissions. +3. Callback URL must be accessible from the public internet. +4. Different channels may have different message format requirements. +5. Message sending depends on PushPlus API, ensure network connectivity is stable. + +## More Information + +* [PushPlus Documentation](http://www.pushplus.plus/doc/) +* [ABP Documentation](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/README.md index f066567a2..e4072dd79 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/README.md +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/README.md @@ -4,6 +4,27 @@ 使应用可通过PushPlus发布实时通知 +## 功能特性 + +* 支持多种消息类型 + * 文本消息 + * HTML消息 + * Markdown消息 + * 图片消息 + * 自定义模板消息 +* 支持消息回调 + * 支持自定义回调URL + * 支持消息发送状态回调 +* 支持多渠道推送 + * 微信公众号 + * 企业微信 + * 邮件 + * 短信 + * WebHook +* 支持群组消息 + * 支持群组推送 + * 支持群组管理 + ## 模块引用 ```csharp @@ -14,3 +35,72 @@ public class YouProjectModule : AbpModule } ``` +## 配置项 + +```json +{ + "PushPlus": { + "Token": "你的PushPlus Token", + "DefaultChannel": "wechat", // 默认推送渠道:wechat/webhook/mail/sms + "DefaultTemplate": "html", // 默认消息模板:html/json/markdown/txt + "DefaultWebhook": "", // 默认Webhook地址 + "DefaultCallbackUrl": "" // 默认回调地址 + } +} +``` + +## 基本用法 + +1. 配置PushPlus服务 +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.Token = "你的PushPlus Token"; + options.DefaultChannel = "wechat"; + options.DefaultTemplate = "html"; + }); +} +``` + +2. 发送通知 +```csharp +public class YourService +{ + private readonly INotificationSender _notificationSender; + + public YourService(INotificationSender notificationSender) + { + _notificationSender = notificationSender; + } + + public async Task SendNotificationAsync() + { + var notificationData = new NotificationData(); + notificationData.TrySetData("title", "消息标题"); + notificationData.TrySetData("content", "消息内容"); + notificationData.SetWebhook("https://your-webhook.com"); + notificationData.SetCallbackUrl("https://your-callback.com"); + + await _notificationSender.SendNofiterAsync( + "YourNotification", + notificationData, + userIds: new[] { CurrentUser.Id } + ); + } +} +``` + +## 注意事项 + +1. 使用前需要在PushPlus平台注册并获取Token。 +2. 确保配置的Token有效且具有足够的权限。 +3. 回调URL必须是可以公网访问的地址。 +4. 不同渠道可能有不同的消息格式要求。 +5. 消息发送依赖于PushPlus API,需要确保网络连接正常。 + +## 更多信息 + +* [PushPlus官方文档](http://www.pushplus.plus/doc/) +* [ABP文档](https://docs.abp.io) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/README.EN.md new file mode 100644 index 000000000..347c13559 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/README.EN.md @@ -0,0 +1,88 @@ +# LINGYUN.Abp.Notifications.SignalR + +The SignalR module of the notification system, providing real-time notification functionality based on SignalR. + +## Features + +* Real-time notification push +* Notification Hub implementation +* Client connection management +* Support for group notifications +* Support for user online status management + +## Module References + +```csharp +[DependsOn(typeof(AbpNotificationsSignalRModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "SignalR": { + "HubUrl": "/signalr-hubs/notifications", + "UseMessagePack": false + } +} +``` + +## Hub Definitions + +### NotificationHub + +* SubscribeToNotifications - Subscribe to notifications +* UnsubscribeFromNotifications - Unsubscribe from notifications +* GetNotifications - Get notification list +* MarkNotificationAsRead - Mark notification as read +* MarkAllNotificationsAsRead - Mark all notifications as read + +## Basic Usage + +1. Server Configuration +```csharp +public class Startup +{ + public void ConfigureServices(IServiceCollection services) + { + services.AddSignalR() + .AddMessagePackProtocol(); // Optional, use MessagePack protocol + } + + public void Configure(IApplicationBuilder app) + { + app.UseEndpoints(endpoints => + { + endpoints.MapHub("/signalr-hubs/notifications"); + }); + } +} +``` + +2. Client Usage +```javascript +// Connect to notification hub +const connection = new signalR.HubConnectionBuilder() + .withUrl("/signalr-hubs/notifications") + .build(); + +// Listen for notifications +connection.on("ReceiveNotification", (notification) => { + console.log("Received new notification:", notification); +}); + +// Start connection +await connection.start(); + +// Subscribe to notifications +await connection.invoke("SubscribeToNotifications"); +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [SignalR Documentation](https://docs.microsoft.com/aspnet/core/signalr) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/README.md new file mode 100644 index 000000000..d9aeb44f6 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/README.md @@ -0,0 +1,88 @@ +# LINGYUN.Abp.Notifications.SignalR + +通知系统的SignalR模块,提供了基于SignalR的实时通知功能。 + +## 功能特性 + +* 实时通知推送 +* 通知Hub实现 +* 客户端连接管理 +* 支持分组通知 +* 支持用户在线状态管理 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsSignalRModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "SignalR": { + "HubUrl": "/signalr-hubs/notifications", + "UseMessagePack": false + } +} +``` + +## Hub定义 + +### NotificationHub + +* SubscribeToNotifications - 订阅通知 +* UnsubscribeFromNotifications - 取消订阅通知 +* GetNotifications - 获取通知列表 +* MarkNotificationAsRead - 标记通知为已读 +* MarkAllNotificationsAsRead - 标记所有通知为已读 + +## 基本用法 + +1. 服务端配置 +```csharp +public class Startup +{ + public void ConfigureServices(IServiceCollection services) + { + services.AddSignalR() + .AddMessagePackProtocol(); // 可选,使用MessagePack协议 + } + + public void Configure(IApplicationBuilder app) + { + app.UseEndpoints(endpoints => + { + endpoints.MapHub("/signalr-hubs/notifications"); + }); + } +} +``` + +2. 客户端使用 +```javascript +// 连接到通知Hub +const connection = new signalR.HubConnectionBuilder() + .withUrl("/signalr-hubs/notifications") + .build(); + +// 监听通知 +connection.on("ReceiveNotification", (notification) => { + console.log("收到新通知:", notification); +}); + +// 启动连接 +await connection.start(); + +// 订阅通知 +await connection.invoke("SubscribeToNotifications"); +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [SignalR文档](https://docs.microsoft.com/aspnet/core/signalr) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/README.EN.md new file mode 100644 index 000000000..67fb2b6cb --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/README.EN.md @@ -0,0 +1,98 @@ +# LINGYUN.Abp.Notifications.Sms + +SMS implementation of notification publishing provider + +Most rewritten modules maintain the same name as the official modules and are distinguished by namespace, mainly because only a small part was rewritten or additional functionality was added. +If most of the module code is rewritten, or if it's a completely extended module, then it will have its own name. + +#### Note + +Custom sending methods can be implemented by implementing the ##ISmsNotificationSender## interface or overriding ##SmsNotificationSender## + +## Features + +* SMS notification sending +* SMS template support +* Support for multiple SMS service providers +* Support for SMS variable replacement +* Support for batch sending + +## Configuration + +* This configuration item will be removed in the next major SMS-related version + +```json +{ + "Notifications": { + "Sms": { + "TemplateParamsPrefix": "SMS template variable prefix" + } + } +} +``` + +```csharp +[DependsOn(typeof(AbpNotificationsSmsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Implement SMS sending interface +```csharp +public class YourSmsNotificationSender : SmsNotificationSender +{ + public override async Task SendAsync(NotificationInfo notification) + { + var templateParams = GetTemplateParams(notification); + await SmsService.SendAsync( + notification.UserPhoneNumber, + notification.Title, + templateParams + ); + } +} +``` + +2. Register SMS sending service +```csharp +Configure(options => +{ + options.TemplateParamsPrefix = "sms_"; // SMS template variable prefix +}); +``` + +3. Send SMS notification +```csharp +public class YourService +{ + private readonly INotificationSender _notificationSender; + + public YourService(INotificationSender notificationSender) + { + _notificationSender = notificationSender; + } + + public async Task SendSmsNotificationAsync() + { + await _notificationSender.SendNofiterAsync( + "YourNotification", + new NotificationData + { + // SMS template parameters + ["sms_code"] = "123456", + ["sms_time"] = "5" + }, + userIds: new[] { CurrentUser.Id } + ); + } +} +``` + +## More Information + +* [ABP Documentation](https://docs.abp.io) +* [SMS Service Documentation](https://docs.abp.io/en/abp/latest/SMS-Sending) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/README.md index eef114e53..fea84c038 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/README.md +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/README.md @@ -9,6 +9,14 @@ 自定义的发送方法可以通过实现 ##ISmsNotificationSender## 接口或重写 ##SmsNotificationSender## 即可 +## 功能特性 + +* 短信通知发送 +* 短信模板支持 +* 支持多个短信服务商 +* 支持短信变量替换 +* 支持批量发送 + ## 配置使用 * 此配置项将在下一个短信相关大版本移除 @@ -31,3 +39,61 @@ public class YouProjectModule : AbpModule { // other } + +## 基本用法 + +1. 实现短信发送接口 +```csharp +public class YourSmsNotificationSender : SmsNotificationSender +{ + public override async Task SendAsync(NotificationInfo notification) + { + var templateParams = GetTemplateParams(notification); + await SmsService.SendAsync( + notification.UserPhoneNumber, + notification.Title, + templateParams + ); + } +} +``` + +2. 注册短信发送服务 +```csharp +Configure(options => +{ + options.TemplateParamsPrefix = "sms_"; // 短信模板变量前缀 +}); +``` + +3. 发送短信通知 +```csharp +public class YourService +{ + private readonly INotificationSender _notificationSender; + + public YourService(INotificationSender notificationSender) + { + _notificationSender = notificationSender; + } + + public async Task SendSmsNotificationAsync() + { + await _notificationSender.SendNofiterAsync( + "YourNotification", + new NotificationData + { + // 短信模板参数 + ["sms_code"] = "123456", + ["sms_time"] = "5" + }, + userIds: new[] { CurrentUser.Id } + ); + } +} +``` + +## 更多信息 + +* [ABP文档](https://docs.abp.io) +* [短信服务文档](https://docs.abp.io/en/abp/latest/SMS-Sending) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.EN.md new file mode 100644 index 000000000..189e30acc --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.EN.md @@ -0,0 +1,85 @@ +# LINGYUN.Abp.Notifications.WeChat.MiniProgram + +WeChat Mini Program notification publishing module, providing functionality to send subscription messages to users through WeChat Mini Program. + +## Features + +* WeChat Mini Program subscription message sending +* Support for custom message templates +* Support for multi-language messages +* Support for different environments (development, trial, release) +* Integration with ABP notification system + +## Module Reference + +```csharp +[DependsOn(typeof(AbpNotificationsWeChatMiniProgramModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +> Note: This configuration will be removed in the next major WeChat-related version and merged into LINGYUN.Abp.WeChat.MiniProgram.AbpWeChatMiniProgramOptions + +```json +{ + "Notifications": { + "WeChat": { + "MiniProgram": { + "DefaultMsgPrefix": "", // Default message prefix + "DefaultTemplateId": "", // Default Mini Program template ID + "DefaultState": "developer", // Default Mini Program type: developer/trial/formal + "DefaultLanguage": "zh_CN" // Default Mini Program language + } + } + } +} +``` + +## Usage + +### Sending Notifications + +```csharp +public class YourService +{ + private readonly INotificationPublisher _notificationPublisher; + + public YourService(INotificationPublisher notificationPublisher) + { + _notificationPublisher = notificationPublisher; + } + + public async Task SendNotificationAsync() + { + await _notificationPublisher.PublishAsync( + "WeChatMiniProgram.Notification", // Notification name + new NotificationData(), // Notification data + userIds: new[] { "userId" }, // Recipient user IDs + tenantIds: new[] { "tenantId" } // Tenant IDs + ); + } +} +``` + +### Custom Notification Handling + +```csharp +public class YourNotificationHandler : + INotificationHandler +{ + public async Task HandleNotificationAsync( + WeChatMiniProgramNotification notification) + { + // Handle notification + } +} +``` + +## More Documentation + +* [Chinese Documentation](README.md) +* [WeChat Mini Program Subscribe Message Documentation](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.md index 4a484e36a..dc8ac965d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.md +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/README.md @@ -1,37 +1,85 @@ # LINGYUN.Abp.Notifications.WeChat.MiniProgram -通知发布提供程序的微信小程序实现 +微信小程序通知发布模块,提供通过微信小程序向用户发送订阅消息的功能。 -大部分重写的模块都和官方模块名称保持一致,通过命名空间区分,主要是只改写了一小部分或者增加额外的功能 -如果大部分模块代码都重写,或者完全就是扩展模块,才会定义自己的名字 +## 功能特性 -#### 注意 +* 微信小程序订阅消息发送 +* 支持自定义消息模板 +* 支持多语言消息 +* 支持不同环境(开发版、体验版、正式版) +* 集成ABP通知系统 -## 配置使用 +## 模块引用 -* 此配置项将在下一个微信相关大版本移除,合并到 LINGYUN.Abp.WeChat.MiniProgram.AbpWeChatMiniProgramOptions +```csharp +[DependsOn(typeof(AbpNotificationsWeChatMiniProgramModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` -```json +## 配置项 + +> 注意:此配置项将在下一个微信相关大版本移除,合并到 LINGYUN.Abp.WeChat.MiniProgram.AbpWeChatMiniProgramOptions +```json { "Notifications": { "WeChat": { "MiniProgram": { - "DefaultMsgPrefix": "默认消息头部标记", - "DefaultTemplateId": "默认小程序模板", - "DefaultState": "默认跳转小程序类型", - "DefaultLanguage": "默认小程序语言" + "DefaultMsgPrefix": "", // 默认消息头部标记 + "DefaultTemplateId": "", // 默认小程序模板ID + "DefaultState": "developer", // 默认跳转小程序类型:developer(开发版)、trial(体验版)、formal(正式版) + "DefaultLanguage": "zh_CN" // 默认小程序语言 } } } } +``` +## 使用方式 + +### 发送通知 + +```csharp +public class YourService +{ + private readonly INotificationPublisher _notificationPublisher; + + public YourService(INotificationPublisher notificationPublisher) + { + _notificationPublisher = notificationPublisher; + } + + public async Task SendNotificationAsync() + { + await _notificationPublisher.PublishAsync( + "WeChatMiniProgram.Notification", // 通知名称 + new NotificationData(), // 通知数据 + userIds: new[] { "userId" }, // 接收用户ID列表 + tenantIds: new[] { "tenantId" } // 租户ID列表 + ); + } +} ``` +### 自定义通知处理 ```csharp -[DependsOn(typeof(AbpNotificationsWeChatMiniProgramModule))] -public class YouProjectModule : AbpModule +public class YourNotificationHandler : + INotificationHandler { - // other + public async Task HandleNotificationAsync( + WeChatMiniProgramNotification notification) + { + // 处理通知 + } } +``` + +## 更多文档 + +* [微信小程序通知发布模块文档](README.EN.md) +* [微信小程序订阅消息开发文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/README.EN.md new file mode 100644 index 000000000..a601e3c11 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/README.EN.md @@ -0,0 +1,107 @@ +# LINGYUN.Abp.Notifications.WeChat.Work + +WeChat Work notification publishing module, providing functionality to send messages to users through WeChat Work applications. + +## Features + +* Support for multiple message types + * Text messages + * Text card messages + * Markdown messages +* Flexible message targeting + * Send to specific users + * Send to specific departments + * Send to specific tags + * Send to multiple applications +* Multi-language support + * Localized message content + * Multi-language titles and descriptions +* Feature toggle control + * Message sending controlled by feature switches +* Extensibility + * Custom notification definitions + * Custom message handling + +## Module Reference + +```csharp +[DependsOn(typeof(AbpNotificationsWeChatWorkModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +### 1. Basic Configuration + +Message sending requires configuring applications in the WeChat Work backend and obtaining the corresponding application ID (AgentId). + +### 2. Notification Definition Configuration + +```csharp +public class YourNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + var notification = context.Create( + name: "App.Notification.Test", + displayName: L("TestNotification")) + .WithAgentId("1000001") // Set application ID + .WithParty("1|2|3") // Set receiving departments + .WithTag("TagId1|TagId2") // Set receiving tags + .WithAllAgent(); // Send to all applications + } +} +``` + +### 3. Sending Notifications + +```csharp +public class YourService +{ + private readonly INotificationPublisher _notificationPublisher; + + public YourService(INotificationPublisher notificationPublisher) + { + _notificationPublisher = notificationPublisher; + } + + public async Task SendNotificationAsync() + { + var notificationData = new NotificationData(); + + // Set message content + notificationData.TrySetData("title", "Message Title"); + notificationData.TrySetData("message", "Message Content"); + notificationData.TrySetData("description", "Message Description"); + + // Set sending targets + notificationData.SetAgentId("1000001"); // Set application ID + notificationData.SetParty("1|2|3"); // Set receiving departments + notificationData.SetTag("TagId1|TagId2"); // Set receiving tags + notificationData.WithAllAgent(); // Send to all applications + + await _notificationPublisher.PublishAsync( + "App.Notification.Test", // Notification name + notificationData, // Notification data + userIds: new[] { "userId" }, // Recipient user IDs + tenantIds: new[] { "tenantId" } // Tenant IDs + ); + } +} +``` + +## Important Notes + +1. Ensure WeChat Work application is properly configured, including application ID and relevant permissions. +2. Department IDs and tag IDs must match those configured in the WeChat Work backend. +3. Multiple recipients (departments/tags) are separated by '|', with a maximum of 100. +4. Using `WithAllAgent()` will send messages to all configured applications. +5. Message sending depends on WeChat Work API, ensure network connectivity is stable. + +## More Documentation + +* [Chinese Documentation](README.md) +* [WeChat Work Application Message Development Documentation](https://developer.work.weixin.qq.com/document/path/90236) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/README.md new file mode 100644 index 000000000..559b1b692 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/README.md @@ -0,0 +1,107 @@ +# LINGYUN.Abp.Notifications.WeChat.Work + +企业微信通知发布模块,提供通过企业微信应用向用户发送消息的功能。 + +## 功能特性 + +* 支持多种消息类型 + * 文本消息 + * 文本卡片消息 + * Markdown消息 +* 灵活的消息发送目标 + * 支持发送到指定用户 + * 支持发送到指定部门 + * 支持发送到指定标签 + * 支持发送到多个应用 +* 多语言支持 + * 支持本地化消息内容 + * 支持多语言标题和描述 +* 特性开关控制 + * 支持通过功能开关控制消息发送 +* 扩展性 + * 支持自定义通知定义 + * 支持自定义消息处理 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpNotificationsWeChatWorkModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置说明 + +### 1. 基础配置 + +消息发送需要在企业微信后台配置应用,并获取相应的应用ID(AgentId)。 + +### 2. 通知定义配置 + +```csharp +public class YourNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + var notification = context.Create( + name: "App.Notification.Test", + displayName: L("TestNotification")) + .WithAgentId("1000001") // 设置应用ID + .WithParty("1|2|3") // 设置接收部门 + .WithTag("TagId1|TagId2") // 设置接收标签 + .WithAllAgent(); // 发送到所有应用 + } +} +``` + +### 3. 发送通知 + +```csharp +public class YourService +{ + private readonly INotificationPublisher _notificationPublisher; + + public YourService(INotificationPublisher notificationPublisher) + { + _notificationPublisher = notificationPublisher; + } + + public async Task SendNotificationAsync() + { + var notificationData = new NotificationData(); + + // 设置消息内容 + notificationData.TrySetData("title", "消息标题"); + notificationData.TrySetData("message", "消息内容"); + notificationData.TrySetData("description", "消息描述"); + + // 设置发送目标 + notificationData.SetAgentId("1000001"); // 设置应用ID + notificationData.SetParty("1|2|3"); // 设置接收部门 + notificationData.SetTag("TagId1|TagId2"); // 设置接收标签 + notificationData.WithAllAgent(); // 发送到所有应用 + + await _notificationPublisher.PublishAsync( + "App.Notification.Test", // 通知名称 + notificationData, // 通知数据 + userIds: new[] { "userId" }, // 接收用户ID列表 + tenantIds: new[] { "tenantId" } // 租户ID列表 + ); + } +} +``` + +## 注意事项 + +1. 发送消息时需要确保企业微信应用配置正确,包括应用ID和相关权限。 +2. 部门ID和标签ID需要与企业微信后台配置的一致。 +3. 多个接收者(部门/标签)使用'|'分隔,最多支持100个。 +4. 使用 `WithAllAgent()` 时会向所有配置的应用发送消息。 +5. 消息发送依赖于企业微信API,需要确保网络连接正常。 + +## 更多文档 + +* [English Documentation](README.EN.md) +* [企业微信应用消息开发文档](https://developer.work.weixin.qq.com/document/path/90236) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/README.EN.md new file mode 100644 index 000000000..3b0b129a1 --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/README.EN.md @@ -0,0 +1,97 @@ +# LINGYUN.Abp.Notifications.WxPusher + +ABP notification module implemented through WxPusher, providing real-time notification functionality via WxPusher. + +[简体中文](./README.md) + +## Features + +* Support for multiple message types + * Text messages + * HTML messages + * Markdown messages +* Flexible message targeting + * Send to specific users + * Send to specific Topics +* Multi-language support + * Localized message content + * Multi-language titles and descriptions +* Feature toggle control + * Message sending controlled by feature switches + +## Installation + +```bash +dotnet add package LINGYUN.Abp.Notifications.WxPusher +``` + +## Module Reference + +```csharp +[DependsOn(typeof(AbpNotificationsWxPusherModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +### 1. Notification Definition Configuration + +```csharp +public class YourNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + var notification = context.Create( + name: "App.Notification.Test", + displayName: L("TestNotification")) + .WithContentType(MessageContentType.Text) // Set message type + .WithTopics(new List { 1, 2 }) // Set message Topics + .WithUrl("https://example.com"); // Set URL to jump to when clicking the message + } +} +``` + +### 2. Sending Notifications + +```csharp +public class YourService +{ + private readonly INotificationPublisher _notificationPublisher; + + public YourService(INotificationPublisher notificationPublisher) + { + _notificationPublisher = notificationPublisher; + } + + public async Task SendNotificationAsync() + { + var notificationData = new NotificationData(); + + // Set message content + notificationData.TrySetData("title", "Message Title"); + notificationData.TrySetData("message", "Message Content"); + notificationData.SetUrl("https://example.com"); // Set URL to jump to when clicking the message + + await _notificationPublisher.PublishAsync( + "App.Notification.Test", // Notification name + notificationData, // Notification data + userIds: new[] { "userId" }, // Recipient user IDs + tenantIds: new[] { "tenantId" } // Tenant IDs + ); + } +} +``` + +## Important Notes + +1. Implementation of `IWxPusherUserStore` interface is required to manage user associations with WxPusher. +2. Message sending depends on WxPusher API, ensure network connectivity is stable. +3. Set message content length reasonably to avoid exceeding WxPusher limits. +4. When using multi-language features, ensure localization resources are properly configured. + +## Source Code + +[LINGYUN.Abp.Notifications.WxPusher](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/README.md index ad2eb87f1..1e9dde617 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/README.md +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/README.md @@ -1,8 +1,29 @@ # LINGYUN.Abp.Notifications.WxPusher -通知模块的WxPusher实现 +通过WxPusher实现的ABP通知模块,提供通过WxPusher发送实时通知的功能。 -使应用可通过WxPusher发布实时通知 +[English](./README.EN.md) + +## 功能特性 + +* 支持多种消息类型 + * 文本消息 + * HTML消息 + * Markdown消息 +* 灵活的消息发送目标 + * 支持发送到指定用户 + * 支持发送到指定Topic +* 多语言支持 + * 支持本地化消息内容 + * 支持多语言标题和描述 +* 特性开关控制 + * 支持通过功能开关控制消息发送 + +## 安装 + +```bash +dotnet add package LINGYUN.Abp.Notifications.WxPusher +``` ## 模块引用 @@ -10,6 +31,67 @@ [DependsOn(typeof(AbpNotificationsWxPusherModule))] public class YouProjectModule : AbpModule { - // other + // other } ``` + +## 配置说明 + +### 1. 通知定义配置 + +```csharp +public class YourNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + var notification = context.Create( + name: "App.Notification.Test", + displayName: L("TestNotification")) + .WithContentType(MessageContentType.Text) // 设置消息类型 + .WithTopics(new List { 1, 2 }) // 设置消息Topic + .WithUrl("https://example.com"); // 设置点击消息跳转的URL + } +} +``` + +### 2. 发送通知 + +```csharp +public class YourService +{ + private readonly INotificationPublisher _notificationPublisher; + + public YourService(INotificationPublisher notificationPublisher) + { + _notificationPublisher = notificationPublisher; + } + + public async Task SendNotificationAsync() + { + var notificationData = new NotificationData(); + + // 设置消息内容 + notificationData.TrySetData("title", "消息标题"); + notificationData.TrySetData("message", "消息内容"); + notificationData.SetUrl("https://example.com"); // 设置点击消息跳转的URL + + await _notificationPublisher.PublishAsync( + "App.Notification.Test", // 通知名称 + notificationData, // 通知数据 + userIds: new[] { "userId" }, // 接收用户ID列表 + tenantIds: new[] { "tenantId" } // 租户ID列表 + ); + } +} +``` + +## 注意事项 + +1. 需要实现 `IWxPusherUserStore` 接口来管理用户与WxPusher的关联关系。 +2. 消息发送依赖于WxPusher API,需要确保网络连接正常。 +3. 请合理设置消息内容长度,避免超过WxPusher的限制。 +4. 使用多语言功能时,需要确保已正确配置本地化资源。 + +## 源码位置 + +[LINGYUN.Abp.Notifications.WxPusher](https://github.com/colinin/abp-next-admin/tree/master/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/README.EN.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/README.EN.md new file mode 100644 index 000000000..7b417726a --- /dev/null +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/README.EN.md @@ -0,0 +1,129 @@ +# LINGYUN.Abp.Notifications + +[简体中文](./README.md) | English + +Real-time notification base module. + +## Features + +* Support multiple notification types (System, User, Application, Service Callback) +* Support multiple notification lifetimes (One-time, Persistent) +* Support multiple notification content types (Text, JSON, HTML, Markdown) +* Support multiple notification severity levels (Success, Info, Warning, Error, Fatal) +* Support notification subscription management +* Support notification status management (Read/Unread) +* Multi-tenancy support +* Localization support +* Custom notification provider support + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpNotificationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +### 1. Send Notification + +```csharp +public class MyService +{ + private readonly INotificationSender _notificationSender; + + public MyService(INotificationSender notificationSender) + { + _notificationSender = notificationSender; + } + + public async Task SendNotificationAsync() + { + var data = new NotificationData(); + data.TrySetData("title", "Test Notification"); + data.TrySetData("message", "This is a test notification"); + + await _notificationSender.SendNofiterAsync( + "TestNotification", + data, + severity: NotificationSeverity.Info); + } +} +``` + +### 2. Manage Notification Subscriptions + +```csharp +public class MyService +{ + private readonly INotificationSubscriptionManager _subscriptionManager; + + public MyService(INotificationSubscriptionManager subscriptionManager) + { + _subscriptionManager = subscriptionManager; + } + + public async Task SubscribeAsync(Guid userId) + { + await _subscriptionManager.SubscribeAsync( + userId, + "TestNotification"); + } +} +``` + +## Configuration Options + +```json +{ + "Notifications": { + "PublishProviders": [ + "SignalR" // Optional notification provider + ] + } +} +``` + +## Notification Types + +* Application - Platform notifications +* System - System notifications +* User - User notifications +* ServiceCallback - Service callback notifications + +## Notification Lifetimes + +* OnlyOne - One-time notifications +* Persistent - Persistent notifications + +## Notification Content Types + +* Text - Text +* Json - JSON +* Html - HTML +* Markdown - Markdown + +## Notification Severity Levels + +* Success - Success +* Info - Information +* Warn - Warning +* Fatal - Fatal +* Error - Error + +## Best Practices + +1. Choose appropriate notification types and lifetimes based on actual requirements +2. Use notification severity levels appropriately, avoid overusing high-level notifications +3. Add proper localization support for notifications +4. Regularly clean up expired notification data + +## Notes + +1. Persistent notifications require implementation of INotificationStore interface +2. Custom notification providers require implementation of INotificationPublishProvider interface +3. Notification names should be unique and descriptive +4. Consider data isolation in multi-tenant scenarios diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/README.md b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/README.md index dd9a6a67c..b74811cd7 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/README.md +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/README.md @@ -1,9 +1,22 @@ # LINGYUN.Abp.Notifications -实时通知基础模块 +[English](./README.EN.md) | 简体中文 +实时通知基础模块。 -## 配置使用 +## 功能 + +* 支持多种通知类型(系统、用户、应用、服务回调) +* 支持多种通知生命周期(一次性、持久化) +* 支持多种通知内容类型(文本、JSON、HTML、Markdown) +* 支持多种通知严重级别(成功、信息、警告、错误、致命) +* 支持通知订阅管理 +* 支持通知状态管理(已读/未读) +* 支持多租户 +* 支持本地化 +* 支持自定义通知提供程序 + +## 模块依赖 ```csharp [DependsOn(typeof(AbpNotificationModule))] @@ -11,3 +24,106 @@ public class YouProjectModule : AbpModule { // other } +``` + +## 基本用法 + +### 1. 发送通知 + +```csharp +public class MyService +{ + private readonly INotificationSender _notificationSender; + + public MyService(INotificationSender notificationSender) + { + _notificationSender = notificationSender; + } + + public async Task SendNotificationAsync() + { + var data = new NotificationData(); + data.TrySetData("title", "测试通知"); + data.TrySetData("message", "这是一条测试通知"); + + await _notificationSender.SendNofiterAsync( + "TestNotification", + data, + severity: NotificationSeverity.Info); + } +} +``` + +### 2. 管理通知订阅 + +```csharp +public class MyService +{ + private readonly INotificationSubscriptionManager _subscriptionManager; + + public MyService(INotificationSubscriptionManager subscriptionManager) + { + _subscriptionManager = subscriptionManager; + } + + public async Task SubscribeAsync(Guid userId) + { + await _subscriptionManager.SubscribeAsync( + userId, + "TestNotification"); + } +} +``` + +## 配置选项 + +```json +{ + "Notifications": { + "PublishProviders": [ + "SignalR" // 可选的通知提供程序 + ] + } +} +``` + +## 通知类型 + +* Application - 平台通知 +* System - 系统通知 +* User - 用户通知 +* ServiceCallback - 服务回调通知 + +## 通知生命周期 + +* OnlyOne - 一次性通知 +* Persistent - 持久化通知 + +## 通知内容类型 + +* Text - 文本 +* Json - JSON +* Html - HTML +* Markdown - Markdown + +## 通知严重级别 + +* Success - 成功 +* Info - 信息 +* Warn - 警告 +* Fatal - 致命 +* Error - 错误 + +## 最佳实践 + +1. 根据实际需求选择合适的通知类型和生命周期 +2. 合理使用通知严重级别,避免滥用高级别通知 +3. 为通知添加适当的本地化支持 +4. 定期清理过期的通知数据 + +## 注意事项 + +1. 持久化通知需要实现 INotificationStore 接口 +2. 自定义通知提供程序需要实现 INotificationPublishProvider 接口 +3. 通知名称应该具有唯一性和描述性 +4. 考虑多租户场景下的数据隔离 diff --git a/aspnet-core/modules/rules-management/README.md b/aspnet-core/modules/rules-management/README.md index 104f3341d..6ac0ef94b 100644 --- a/aspnet-core/modules/rules-management/README.md +++ b/aspnet-core/modules/rules-management/README.md @@ -1,9 +1,115 @@ # LINGYUN.Abp.RulesManagement -规则引擎管理 +规则引擎管理模块,提供了基于规则引擎的工作流和规则管理功能。 -想法很美好,现实很残酷,.NET平台还没有Java阵营那么强大的规则引擎,目前还在研究NRules.Language库,这个库应该可以实现简单的规则动态管理 +## 1. 模块说明 -## 配置使用 +该模块基于RulesEngine实现,提供了工作流规则的持久化管理、缓存管理以及API接口。主要包含以下子模块: -待完善 \ No newline at end of file +### 1.1 Domain.Shared + +* 定义了工作流记录、规则记录、动作记录等基础常量 +* 提供了动作类型等枚举定义 +* [查看详细说明](rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/README.md) + +### 1.2 Domain + +* 实现了工作流存储的核心业务逻辑 +* 提供了基于内存缓存的工作流存储实现 +* 定义了规则记录、工作流记录等领域模型 +* [查看详细说明](rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/README.md) + +### 1.3 EntityFrameworkCore + +* 提供了基于EF Core的数据访问层实现 +* 实现了工作流、规则等实体的数据库映射 +* 实现了仓储接口 +* [查看详细说明](rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/README.md) + +### 1.4 Application.Contracts + +* 定义了规则引擎管理的应用服务接口 +* 定义了数据传输对象(DTOs) +* 定义了权限 +* [查看详细说明](rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/README.md) + +### 1.5 Application + +* 实现了规则记录和工作流记录的应用服务 +* 提供了对象自动映射配置 +* [查看详细说明](rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/README.md) + +### 1.6 HttpApi + +* 提供了RESTful风格的API接口 +* 实现了规则和工作流的CRUD操作API +* [查看详细说明](rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/README.md) + +## 2. 功能特性 + +* 工作流管理 + * 支持工作流的创建、修改、删除、查询 + * 提供工作流的缓存管理 + * 支持按类型查询工作流 + +* 规则管理 + * 支持规则的创建、修改、删除、查询 + * 支持规则表达式的定义 + * 支持规则与工作流的关联 + +* 参数管理 + * 支持工作流参数的定义 + * 支持参数值的验证 + +* 动作管理 + * 支持成功/失败动作的定义 + * 支持动作执行结果的记录 + +## 3. 配置项 + +### 3.1 工作流记录配置 + +* MaxNameLength: 工作流名称最大长度,默认64 +* MaxTypeFullNameLength: 类型全名最大长度,默认255 +* MaxInjectWorkflowsLength: 注入工作流最大长度,默认(MaxNameLength + 1) * 5 + +### 3.2 规则记录配置 + +* MaxNameLength: 规则名称最大长度,默认64 +* MaxOperatorLength: 操作符最大长度,默认30 +* MaxErrorMessageLength: 错误消息最大长度,默认255 +* MaxExpressionLength: 表达式最大长度,默认int.MaxValue +* MaxSuccessEventLength: 成功事件最大长度,默认128 + +## 4. 权限 + +* RulesEngineManagement.Rule + * 规则管理权限 + * 包含创建、修改、删除、查询权限 + +* RulesEngineManagement.Workflow + * 工作流管理权限 + * 包含创建、修改、删除、查询权限 + +## 5. API接口 + +### 5.1 规则记录API + +* 基路径: api/rules-engine-management/rules +* 提供规则记录的CRUD操作API +* 支持分页查询API + +### 5.2 工作流记录API + +* 基路径: api/rules-engine-management/workflows +* 提供工作流记录的CRUD操作API +* 支持分页查询API + +## 6. 依赖 + +* Volo.Abp.Core +* LINGYUN.Abp.Rules.RulesEngine +* Microsoft.Extensions.Caching.Memory +* Volo.Abp.EntityFrameworkCore +* Volo.Abp.Ddd.Application +* Volo.Abp.AspNetCore.Mvc \ No newline at end of file diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..867888380 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/README.EN.md @@ -0,0 +1,68 @@ +# LINGYUN.Abp.RulesEngineManagement.Application.Contracts + +## 1. Introduction + +The application service contract layer of the rules engine management module, defining interfaces, DTOs, and other contracts required for rules engine management. + +## 2. Features + +* Defines application service interfaces for rules engine management +* Defines Data Transfer Objects (DTOs) +* Defines permissions + +## 3. Application Service Interfaces + +* IRuleRecordAppService + * Provides CRUD operation interfaces for rule records + * Supports querying rules by name + * Supports paginated queries + +* IWorkflowRecordAppService + * Provides CRUD operation interfaces for workflow records + * Supports querying workflows by name and type + * Supports paginated queries + +## 4. Data Transfer Objects + +### 4.1 Rule Record DTOs + +* RuleRecordDto +* CreateRuleRecordDto +* UpdateRuleRecordDto +* RuleRecordGetListInput + +### 4.2 Workflow Record DTOs + +* WorkflowRecordDto +* CreateWorkflowRecordDto +* UpdateWorkflowRecordDto +* WorkflowRecordGetListInput + +### 4.3 Parameter Record DTOs + +* ParamRecordDto +* CreateParamRecordDto +* UpdateParamRecordDto + +### 4.4 Action Record DTOs + +* ActionRecordDto +* CreateActionRecordDto +* UpdateActionRecordDto + +## 5. Permission Definitions + +* RulesEngineManagement.Rule + * Rule management permissions + * Includes create, modify, delete, query permissions + +* RulesEngineManagement.Workflow + * Workflow management permissions + * Includes create, modify, delete, query permissions + +## 6. Dependencies + +* Volo.Abp.Ddd.Application.Contracts +* LINGYUN.Abp.RulesEngineManagement.Domain.Shared + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/README.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/README.md new file mode 100644 index 000000000..9b1e70cb5 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/README.md @@ -0,0 +1,68 @@ +# LINGYUN.Abp.RulesEngineManagement.Application.Contracts + +## 1. 介绍 + +规则引擎管理模块的应用服务契约层,定义了规则引擎管理所需的接口、DTO等。 + +## 2. 功能 + +* 定义了规则引擎管理的应用服务接口 +* 定义了数据传输对象(DTOs) +* 定义了权限 + +## 3. 应用服务接口 + +* IRuleRecordAppService + * 提供规则记录的CRUD操作接口 + * 支持按名称查询规则 + * 支持分页查询 + +* IWorkflowRecordAppService + * 提供工作流记录的CRUD操作接口 + * 支持按名称和类型查询工作流 + * 支持分页查询 + +## 4. 数据传输对象 + +### 4.1 规则记录DTOs + +* RuleRecordDto +* CreateRuleRecordDto +* UpdateRuleRecordDto +* RuleRecordGetListInput + +### 4.2 工作流记录DTOs + +* WorkflowRecordDto +* CreateWorkflowRecordDto +* UpdateWorkflowRecordDto +* WorkflowRecordGetListInput + +### 4.3 参数记录DTOs + +* ParamRecordDto +* CreateParamRecordDto +* UpdateParamRecordDto + +### 4.4 动作记录DTOs + +* ActionRecordDto +* CreateActionRecordDto +* UpdateActionRecordDto + +## 5. 权限定义 + +* RulesEngineManagement.Rule + * 规则管理权限 + * 包含创建、修改、删除、查询权限 + +* RulesEngineManagement.Workflow + * 工作流管理权限 + * 包含创建、修改、删除、查询权限 + +## 6. 依赖 + +* Volo.Abp.Ddd.Application.Contracts +* LINGYUN.Abp.RulesEngineManagement.Domain.Shared + +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/README.EN.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/README.EN.md new file mode 100644 index 000000000..09b389d24 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/README.EN.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.RulesEngineManagement.Application + +## 1. Introduction + +The application service implementation layer of the rules engine management module, implementing the business logic for rules engine management. + +## 2. Features + +* Implements rule record application services +* Implements workflow record application services +* Provides auto-mapping configuration for rules engine management + +## 3. Application Service Implementation + +### 3.1 Rule Record Application Service + +* RuleRecordAppService + * Implements IRuleRecordAppService interface + * Provides CRUD operations for rule records + * Implements rule record query functionality + * Supports paginated queries + * Implements permission validation + +### 3.2 Workflow Record Application Service + +* WorkflowRecordAppService + * Implements IWorkflowRecordAppService interface + * Provides CRUD operations for workflow records + * Implements workflow record query functionality + * Supports paginated queries + * Implements permission validation + +## 4. Object Mapping + +* RulesEngineManagementApplicationAutoMapperProfile + * Configures automatic mapping between DTOs and entities + * Includes all mapping configurations related to rules engine management + +## 5. Dependencies + +* Volo.Abp.AutoMapper +* Volo.Abp.Ddd.Application +* LINGYUN.Abp.RulesEngineManagement.Application.Contracts +* LINGYUN.Abp.RulesEngineManagement.Domain + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/README.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/README.md new file mode 100644 index 000000000..073ad1c24 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/README.md @@ -0,0 +1,46 @@ +# LINGYUN.Abp.RulesEngineManagement.Application + +## 1. 介绍 + +规则引擎管理模块的应用服务实现层,实现了规则引擎管理的业务逻辑。 + +## 2. 功能 + +* 实现了规则记录的应用服务 +* 实现了工作流记录的应用服务 +* 提供了规则引擎管理的自动映射配置 + +## 3. 应用服务实现 + +### 3.1 规则记录应用服务 + +* RuleRecordAppService + * 实现了IRuleRecordAppService接口 + * 提供规则记录的CRUD操作 + * 实现了规则记录的查询功能 + * 支持分页查询 + * 实现了权限验证 + +### 3.2 工作流记录应用服务 + +* WorkflowRecordAppService + * 实现了IWorkflowRecordAppService接口 + * 提供工作流记录的CRUD操作 + * 实现了工作流记录的查询功能 + * 支持分页查询 + * 实现了权限验证 + +## 4. 对象映射 + +* RulesEngineManagementApplicationAutoMapperProfile + * 配置了DTO与实体间的自动映射 + * 包含了所有规则引擎管理相关的映射配置 + +## 5. 依赖 + +* Volo.Abp.AutoMapper +* Volo.Abp.Ddd.Application +* LINGYUN.Abp.RulesEngineManagement.Application.Contracts +* LINGYUN.Abp.RulesEngineManagement.Domain + +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/README.EN.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/README.EN.md new file mode 100644 index 000000000..bdf52b16a --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/README.EN.md @@ -0,0 +1,42 @@ +# LINGYUN.Abp.RulesEngineManagement.Domain.Shared + +## 1. Introduction + +The shared domain layer of the rules engine management module, containing constant definitions, enumeration types, and other infrastructure required for rules engine management. + +## 2. Features + +* Defines workflow record related constants +* Defines rule record related constants +* Defines action record related constants +* Defines parameter record related constants +* Defines action type enumeration + +## 3. Constants Configuration + +### 3.1 Workflow Record Constants + +* MaxNameLength: Maximum length of workflow name, default 64 +* MaxTypeFullNameLength: Maximum length of type full name, default 255 +* MaxInjectWorkflowsLength: Maximum length of inject workflows, default (MaxNameLength + 1) * 5 + +### 3.2 Rule Record Constants + +* MaxNameLength: Maximum length of rule name, default 64 +* MaxOperatorLength: Maximum length of operator, default 30 +* MaxErrorMessageLength: Maximum length of error message, default 255 +* MaxInjectWorkflowsLength: Maximum length of inject workflows, default (MaxNameLength + 1) * 5 +* MaxExpressionLength: Maximum length of expression, default int.MaxValue +* MaxSuccessEventLength: Maximum length of success event, default 128 + +### 3.3 Action Type Enumeration + +* Success = 0: Success +* Failure = 1: Failure + +## 4. Dependencies + +* Volo.Abp.Validation +* LINGYUN.Abp.Rules.RulesEngine + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/README.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/README.md new file mode 100644 index 000000000..39d0940b9 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/README.md @@ -0,0 +1,42 @@ +# LINGYUN.Abp.RulesEngineManagement.Domain.Shared + +## 1. 介绍 + +规则引擎管理模块的共享领域层,包含了规则引擎管理所需的常量定义、枚举类型等基础设施。 + +## 2. 功能 + +* 定义了工作流记录相关的常量 +* 定义了规则记录相关的常量 +* 定义了动作记录相关的常量 +* 定义了参数记录相关的常量 +* 定义了动作类型枚举 + +## 3. 常量配置 + +### 3.1 工作流记录常量 + +* MaxNameLength: 工作流名称最大长度,默认64 +* MaxTypeFullNameLength: 类型全名最大长度,默认255 +* MaxInjectWorkflowsLength: 注入工作流最大长度,默认为(MaxNameLength + 1) * 5 + +### 3.2 规则记录常量 + +* MaxNameLength: 规则名称最大长度,默认64 +* MaxOperatorLength: 操作符最大长度,默认30 +* MaxErrorMessageLength: 错误消息最大长度,默认255 +* MaxInjectWorkflowsLength: 注入工作流最大长度,默认为(MaxNameLength + 1) * 5 +* MaxExpressionLength: 表达式最大长度,默认为int.MaxValue +* MaxSuccessEventLength: 成功事件最大长度,默认128 + +### 3.3 动作类型枚举 + +* Success = 0: 成功 +* Failure = 1: 失败 + +## 4. 依赖 + +* Volo.Abp.Validation +* LINGYUN.Abp.Rules.RulesEngine + +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/README.EN.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/README.EN.md new file mode 100644 index 000000000..cf135ee66 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/README.EN.md @@ -0,0 +1,54 @@ +# LINGYUN.Abp.RulesEngineManagement.Domain + +## 1. Introduction + +The domain layer of the rules engine management module implements the core business logic of the rules engine, including workflow storage, rule records, action records, and other functionalities. + +## 2. Features + +* Workflow Storage + * Supports memory-based workflow caching + * Provides workflow retrieval and query functionality + * Supports getting workflow lists by type + +* Rule Records + * Defines rule record entities + * Provides rule record repository interface + * Supports CRUD operations for rules + +* Workflow Rule Records + * Defines workflow rule record entities + * Supports association between workflows and rules + +* Parameter Records + * Defines parameter record entities + * Supports workflow parameter management + +* Action Records + * Defines action record entities + * Supports recording success/failure actions + +## 3. Domain Services + +* WorkflowStore + * Implements IWorkflowStore interface + * Provides workflow cache management + * Supports workflow querying and mapping + +## 4. Repository Interfaces + +* IRuleRecordRepository + * Provides CRUD operations for rule records + * Supports querying rules by name + +* IWorkflowRecordRepository + * Provides CRUD operations for workflow records + * Supports querying workflows by name and type + +## 5. Dependencies + +* Volo.Abp.Domain +* LINGYUN.Abp.Rules.RulesEngine +* Microsoft.Extensions.Caching.Memory + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/README.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/README.md new file mode 100644 index 000000000..ea0645df9 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/README.md @@ -0,0 +1,54 @@ +# LINGYUN.Abp.RulesEngineManagement.Domain + +## 1. 介绍 + +规则引擎管理模块的领域层,实现了规则引擎的核心业务逻辑,包括工作流存储、规则记录、动作记录等功能。 + +## 2. 功能 + +* 工作流存储 + * 支持基于内存缓存的工作流存储 + * 提供工作流的获取和查询功能 + * 支持按类型获取工作流列表 + +* 规则记录 + * 定义规则记录实体 + * 提供规则记录仓储接口 + * 支持规则的CRUD操作 + +* 工作流规则记录 + * 定义工作流规则记录实体 + * 支持工作流和规则的关联 + +* 参数记录 + * 定义参数记录实体 + * 支持工作流参数的管理 + +* 动作记录 + * 定义动作记录实体 + * 支持成功/失败动作的记录 + +## 3. 领域服务 + +* WorkflowStore + * 实现了IWorkflowStore接口 + * 提供工作流的缓存管理 + * 支持工作流的查询和映射 + +## 4. 仓储接口 + +* IRuleRecordRepository + * 提供规则记录的CRUD操作 + * 支持按名称查询规则 + +* IWorkflowRecordRepository + * 提供工作流记录的CRUD操作 + * 支持按名称和类型查询工作流 + +## 5. 依赖 + +* Volo.Abp.Domain +* LINGYUN.Abp.Rules.RulesEngine +* Microsoft.Extensions.Caching.Memory + +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..6b05a2aee --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/README.EN.md @@ -0,0 +1,59 @@ +# LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore + +## 1. Introduction + +The EntityFrameworkCore implementation of the rules engine management module, providing EF Core-based data access layer implementation. + +## 2. Features + +* Implements DbContext for the rules engine management module +* Provides entity database mapping configuration +* Implements repository interfaces + +## 3. Database Implementation + +### 3.1 DbContext + +* RulesEngineManagementDbContext + * Implements IRulesEngineManagementDbContext interface + * Contains DbSet definitions for all entities + * Supports multi-tenancy + +### 3.2 Repository Implementation + +* EfCoreRuleRecordRepository + * Implements IRuleRecordRepository interface + * Provides CRUD operations for rule records + * Supports querying rules by name + +* EfCoreWorkflowRecordRepository + * Implements IWorkflowRecordRepository interface + * Provides CRUD operations for workflow records + * Supports querying workflows by name and type + +### 3.3 Entity Mapping + +* Workflow Record Mapping + * Configures primary keys and indexes + * Configures field length restrictions + * Configures relationships + +* Rule Record Mapping + * Configures primary keys and indexes + * Configures field length restrictions + * Configures relationships + +* Parameter Record Mapping + * Configures primary keys + * Configures field length restrictions + +* Action Record Mapping + * Configures primary keys + * Configures field length restrictions + +## 4. Dependencies + +* Volo.Abp.EntityFrameworkCore +* LINGYUN.Abp.RulesEngineManagement.Domain + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/README.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/README.md new file mode 100644 index 000000000..f3dab2cb6 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/README.md @@ -0,0 +1,59 @@ +# LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore + +## 1. 介绍 + +规则引擎管理模块的EntityFrameworkCore实现,提供了基于EF Core的数据访问层实现。 + +## 2. 功能 + +* 实现了规则引擎管理模块的DbContext +* 提供了实体的数据库映射配置 +* 实现了仓储接口 + +## 3. 数据库实现 + +### 3.1 DbContext + +* RulesEngineManagementDbContext + * 实现了IRulesEngineManagementDbContext接口 + * 包含了所有实体的DbSet定义 + * 支持多租户 + +### 3.2 仓储实现 + +* EfCoreRuleRecordRepository + * 实现了IRuleRecordRepository接口 + * 提供规则记录的CRUD操作 + * 支持按名称查询规则 + +* EfCoreWorkflowRecordRepository + * 实现了IWorkflowRecordRepository接口 + * 提供工作流记录的CRUD操作 + * 支持按名称和类型查询工作流 + +### 3.3 实体映射 + +* 工作流记录映射 + * 配置了主键、索引 + * 配置了字段长度限制 + * 配置了关联关系 + +* 规则记录映射 + * 配置了主键、索引 + * 配置了字段长度限制 + * 配置了关联关系 + +* 参数记录映射 + * 配置了主键 + * 配置了字段长度限制 + +* 动作记录映射 + * 配置了主键 + * 配置了字段长度限制 + +## 4. 依赖 + +* Volo.Abp.EntityFrameworkCore +* LINGYUN.Abp.RulesEngineManagement.Domain + +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/README.EN.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..27fe09228 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/README.EN.md @@ -0,0 +1,36 @@ +# LINGYUN.Abp.RulesEngineManagement.HttpApi + +## 1. Introduction + +The HTTP API layer of the rules engine management module, providing RESTful API interfaces. + +## 2. Features + +* Implements HTTP API interfaces for rule records +* Implements HTTP API interfaces for workflow records +* Provides API interface routing configuration + +## 3. API Interfaces + +### 3.1 Rule Record API + +* RuleRecordController + * Base path: api/rules-engine-management/rules + * Provides CRUD operation APIs for rule records + * Supports paginated query API + * Implements permission validation + +### 3.2 Workflow Record API + +* WorkflowRecordController + * Base path: api/rules-engine-management/workflows + * Provides CRUD operation APIs for workflow records + * Supports paginated query API + * Implements permission validation + +## 4. Dependencies + +* Volo.Abp.AspNetCore.Mvc +* LINGYUN.Abp.RulesEngineManagement.Application.Contracts + +[查看中文文档](README.md) diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/README.md b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/README.md new file mode 100644 index 000000000..7d3800d54 --- /dev/null +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/README.md @@ -0,0 +1,36 @@ +# LINGYUN.Abp.RulesEngineManagement.HttpApi + +## 1. 介绍 + +规则引擎管理模块的HTTP API层,提供了基于RESTful的API接口。 + +## 2. 功能 + +* 实现了规则记录的HTTP API接口 +* 实现了工作流记录的HTTP API接口 +* 提供了API接口的路由配置 + +## 3. API接口 + +### 3.1 规则记录API + +* RuleRecordController + * 基路径: api/rules-engine-management/rules + * 提供规则记录的CRUD操作API + * 支持分页查询API + * 实现了权限验证 + +### 3.2 工作流记录API + +* WorkflowRecordController + * 基路径: api/rules-engine-management/workflows + * 提供工作流记录的CRUD操作API + * 支持分页查询API + * 实现了权限验证 + +## 4. 依赖 + +* Volo.Abp.AspNetCore.Mvc +* LINGYUN.Abp.RulesEngineManagement.Application.Contracts + +[点击查看英文文档](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/README.EN.md new file mode 100644 index 000000000..468542356 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/README.EN.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.MultiTenancy.Saas + +Multi-tenant SaaS management module, providing tenant management, version management and other features. + +## Features + +* Tenant Management: Create, edit, delete tenants, manage tenant connection strings +* Edition Management: Create, edit, delete editions, manage edition features +* Tenant Expiration Management: Support tenant expiration time setting, expiration warning, expired resource recycling +* Tenant Feature Management: Support assigning feature permissions to tenants + +## Configuration + +### Module Configuration + +```json +{ + "AbpSaas": { + "Tenants": { + "RecycleStrategy": "1", // Resource recycling strategy: 0-Reserve, 1-Recycle + "ExpirationReminderDays": "15", // Expiration warning days, range 1-30 days + "ExpiredRecoveryTime": "15" // Expired recovery time, range 1-30 days + } + } +} +``` + +### Permission Configuration + +* AbpSaas.Editions + * AbpSaas.Editions.Create: Create edition + * AbpSaas.Editions.Update: Update edition + * AbpSaas.Editions.Delete: Delete edition + * AbpSaas.Editions.ManageFeatures: Manage edition features + +* AbpSaas.Tenants + * AbpSaas.Tenants.Create: Create tenant + * AbpSaas.Tenants.Update: Update tenant + * AbpSaas.Tenants.Delete: Delete tenant + * AbpSaas.Tenants.ManageFeatures: Manage tenant features + * AbpSaas.Tenants.ManageConnectionStrings: Manage tenant connection strings + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/README.md new file mode 100644 index 000000000..b9e092ea6 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/README.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.MultiTenancy.Saas + +多租户SaaS管理模块,提供租户管理、版本管理等功能。 + +## 功能特性 + +* 租户管理:创建、编辑、删除租户,管理租户连接字符串 +* 版本管理:创建、编辑、删除版本,管理版本功能 +* 租户过期管理:支持租户过期时间设置、过期预警、过期资源回收 +* 租户功能管理:支持为租户分配功能权限 + +## 配置使用 + +### 模块配置 + +```json +{ + "AbpSaas": { + "Tenants": { + "RecycleStrategy": "1", // 资源回收策略:0-保留,1-回收 + "ExpirationReminderDays": "15", // 过期预警天数,范围1-30天 + "ExpiredRecoveryTime": "15" // 过期回收时长,范围1-30天 + } + } +} +``` + +### 权限配置 + +* AbpSaas.Editions + * AbpSaas.Editions.Create:创建版本 + * AbpSaas.Editions.Update:更新版本 + * AbpSaas.Editions.Delete:删除版本 + * AbpSaas.Editions.ManageFeatures:管理版本功能 + +* AbpSaas.Tenants + * AbpSaas.Tenants.Create:创建租户 + * AbpSaas.Tenants.Update:更新租户 + * AbpSaas.Tenants.Delete:删除租户 + * AbpSaas.Tenants.ManageFeatures:管理租户功能 + * AbpSaas.Tenants.ManageConnectionStrings:管理租户连接字符串 + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/README.EN.md new file mode 100644 index 000000000..299d310db --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/README.EN.md @@ -0,0 +1,29 @@ +# LINGYUN.Abp.Saas.Application.Contracts + +SaaS application service contract module, defining application service interfaces, DTO objects and permission definitions for tenant and edition management. + +## Features + +* Tenant Management Interface (ITenantAppService) + * Defines all service interfaces for tenant management + * Contains tenant-related DTO object definitions + * Tenant connection string management interface + +* Edition Management Interface (IEditionAppService) + * Defines all service interfaces for edition management + * Contains edition-related DTO object definitions + +* Permission Definition (AbpSaasPermissions) + * Edition management permissions + * Tenant management permissions + * Feature management permissions + * Connection string management permissions + +* DTO Objects + * EditionCreateDto/EditionUpdateDto + * TenantCreateDto/TenantUpdateDto + * TenantConnectionStringCreateDto/TenantConnectionStringUpdateDto + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/README.md new file mode 100644 index 000000000..0e817d813 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/README.md @@ -0,0 +1,29 @@ +# LINGYUN.Abp.Saas.Application.Contracts + +SaaS应用服务契约模块,定义了租户和版本管理的应用服务接口、DTO对象和权限定义。 + +## 功能特性 + +* 租户管理接口(ITenantAppService) + * 定义了租户管理的所有服务接口 + * 包含租户相关的DTO对象定义 + * 租户连接字符串管理接口 + +* 版本管理接口(IEditionAppService) + * 定义了版本管理的所有服务接口 + * 包含版本相关的DTO对象定义 + +* 权限定义(AbpSaasPermissions) + * 版本管理权限 + * 租户管理权限 + * 功能管理权限 + * 连接字符串管理权限 + +* DTO对象 + * EditionCreateDto/EditionUpdateDto + * TenantCreateDto/TenantUpdateDto + * TenantConnectionStringCreateDto/TenantConnectionStringUpdateDto + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/README.EN.md new file mode 100644 index 000000000..b39c49b2a --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/README.EN.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Saas.Application + +SaaS application service layer module, implementing application service interfaces for tenant and edition management. + +## Features + +* Tenant Management Service (TenantAppService) + * Create tenant + * Update tenant + * Delete tenant + * Get tenant list + * Get tenant details + * Manage tenant connection strings + * Manage tenant features + +* Edition Management Service (EditionAppService) + * Create edition + * Update edition + * Delete edition + * Get edition list + * Get edition details + * Manage edition features + +## Permission Validation + +All application service methods have added corresponding permission validation to ensure that only users with corresponding permissions can access. + +## Object Mapping + +The following object mappings are implemented using AutoMapper: +* Edition <-> EditionDto +* Tenant <-> TenantDto +* TenantConnectionString <-> TenantConnectionStringDto + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/README.md new file mode 100644 index 000000000..13e850bd6 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/README.md @@ -0,0 +1,37 @@ +# LINGYUN.Abp.Saas.Application + +SaaS应用服务层模块,实现了租户和版本管理的应用服务接口。 + +## 功能特性 + +* 租户管理服务(TenantAppService) + * 创建租户 + * 更新租户 + * 删除租户 + * 获取租户列表 + * 获取租户详情 + * 管理租户连接字符串 + * 管理租户功能 + +* 版本管理服务(EditionAppService) + * 创建版本 + * 更新版本 + * 删除版本 + * 获取版本列表 + * 获取版本详情 + * 管理版本功能 + +## 权限验证 + +所有应用服务方法都已添加相应的权限验证,确保只有具有对应权限的用户才能访问。 + +## 对象映射 + +使用AutoMapper实现了以下对象映射: +* Edition <-> EditionDto +* Tenant <-> TenantDto +* TenantConnectionString <-> TenantConnectionStringDto + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/README.EN.md new file mode 100644 index 000000000..5a27d3bc4 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/README.EN.md @@ -0,0 +1,29 @@ +# LINGYUN.Abp.Saas.Domain.Shared + +SaaS domain shared layer module, defining shared content such as constants, enums, and events for tenants and editions. + +## Features + +* Constants Definition + * EditionConsts: Edition-related constants + * TenantConsts: Tenant-related constants + * TenantConnectionStringConsts: Tenant connection string related constants + +* Enum Definition + * RecycleStrategy: Resource recycling strategy + * Reserve: Keep + * Recycle: Recycle + +* Event Definition + * EditionEto: Edition event transfer object + * TenantEto: Tenant event transfer object + +* Localization Resources + * Multi-language support (en/zh-Hans) + * Error messages + * Permission descriptions + * Feature descriptions + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/README.md new file mode 100644 index 000000000..5b7b0890b --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/README.md @@ -0,0 +1,29 @@ +# LINGYUN.Abp.Saas.Domain.Shared + +SaaS领域共享层模块,定义了租户和版本的常量、枚举、事件等共享内容。 + +## 功能特性 + +* 常量定义 + * EditionConsts:版本相关常量 + * TenantConsts:租户相关常量 + * TenantConnectionStringConsts:租户连接字符串相关常量 + +* 枚举定义 + * RecycleStrategy:资源回收策略 + * Reserve:保留 + * Recycle:回收 + +* 事件定义 + * EditionEto:版本事件传输对象 + * TenantEto:租户事件传输对象 + +* 本地化资源 + * 多语言支持(en/zh-Hans) + * 错误消息 + * 权限描述 + * 功能描述 + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/README.EN.md new file mode 100644 index 000000000..f7d0e8a24 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/README.EN.md @@ -0,0 +1,27 @@ +# LINGYUN.Abp.Saas.Domain + +SaaS domain layer module, defining core domain models, repository interfaces and domain services for tenants and editions. + +## Core Features + +* Tenant Entity: Contains tenant basic information, status, expiration time, etc. +* Edition Entity: Contains edition basic information +* TenantConnectionString: Manages tenant database connections +* TenantManager: Handles tenant-related business logic +* EditionManager: Handles edition-related business logic +* EditionDataSeeder: Provides default edition data initialization + +## Domain Events + +* Tenant creation, update, deletion events +* Edition creation, update, deletion events +* Tenant connection string change events + +## Cache Management + +* Tenant Cache: Cache tenant information to improve query performance +* Edition Cache: Cache edition information to improve query performance + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/README.md new file mode 100644 index 000000000..1065b0167 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/README.md @@ -0,0 +1,27 @@ +# LINGYUN.Abp.Saas.Domain + +SaaS领域层模块,定义了租户和版本的核心领域模型、仓储接口和领域服务。 + +## 核心功能 + +* 租户实体(Tenant):包含租户基本信息、状态、过期时间等 +* 版本实体(Edition):包含版本基本信息 +* 租户连接字符串(TenantConnectionString):管理租户数据库连接 +* 租户管理器(TenantManager):处理租户相关的业务逻辑 +* 版本管理器(EditionManager):处理版本相关的业务逻辑 +* 数据种子(EditionDataSeeder):提供默认版本数据初始化 + +## 领域事件 + +* 租户创建、更新、删除事件 +* 版本创建、更新、删除事件 +* 租户连接字符串变更事件 + +## 缓存管理 + +* 租户缓存:缓存租户信息,提高查询性能 +* 版本缓存:缓存版本信息,提高查询性能 + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..3e782142f --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/README.EN.md @@ -0,0 +1,38 @@ +# LINGYUN.Abp.Saas.EntityFrameworkCore + +SaaS EntityFrameworkCore module, implementing the data access layer for tenants and editions. + +## Features + +* Entity Mapping Configuration + * Tenant entity mapping + * Edition entity mapping + * Tenant connection string entity mapping + +* Repository Implementation + * EfCoreTenantRepository: Tenant repository implementation + * EfCoreEditionRepository: Edition repository implementation + +* Database Tables + * AbpEditions: Edition table + * AbpTenants: Tenant table + * AbpTenantConnectionStrings: Tenant connection string table + +## Configuration + +You can modify the database table prefix and Schema through configuration: + +```json +{ + "AbpSaas": { + "EntityFrameworkCore": { + "TablePrefix": "Abp", // Database table prefix + "Schema": null // Database Schema + } + } +} +``` + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/README.md new file mode 100644 index 000000000..2528d4165 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/README.md @@ -0,0 +1,38 @@ +# LINGYUN.Abp.Saas.EntityFrameworkCore + +SaaS EntityFrameworkCore模块,实现了租户和版本的数据访问层。 + +## 功能特性 + +* 实体映射配置 + * 租户实体映射 + * 版本实体映射 + * 租户连接字符串实体映射 + +* 仓储实现 + * EfCoreTenantRepository:租户仓储实现 + * EfCoreEditionRepository:版本仓储实现 + +* 数据库表 + * AbpEditions:版本表 + * AbpTenants:租户表 + * AbpTenantConnectionStrings:租户连接字符串表 + +## 配置说明 + +可以通过配置修改数据库表前缀和Schema: + +```json +{ + "AbpSaas": { + "EntityFrameworkCore": { + "TablePrefix": "Abp", // 数据库表前缀 + "Schema": null // 数据库Schema + } + } +} +``` + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/README.EN.md new file mode 100644 index 000000000..2cab2ea79 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/README.EN.md @@ -0,0 +1,54 @@ +# LINGYUN.Abp.Saas.HttpApi.Client + +SaaS HTTP API client module, providing HTTP client proxy implementation for tenant and edition management. + +## Features + +* HTTP Client Proxy + * HTTP client implementation of ITenantAppService + * HTTP client implementation of IEditionAppService + +## Usage + +1. Install Module + +```csharp +[DependsOn(typeof(AbpSaasHttpApiClientModule))] +public class YourModule : AbpModule +{ +} +``` + +2. Configure Remote Service + +```json +{ + "RemoteServices": { + "Default": { + "BaseUrl": "http://localhost:44388/" + } + } +} +``` + +3. Inject and Use Services + +```csharp +public class YourService +{ + private readonly ITenantAppService _tenantAppService; + private readonly IEditionAppService _editionAppService; + + public YourService( + ITenantAppService tenantAppService, + IEditionAppService editionAppService) + { + _tenantAppService = tenantAppService; + _editionAppService = editionAppService; + } +} +``` + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/README.md new file mode 100644 index 000000000..43f8052e1 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/README.md @@ -0,0 +1,54 @@ +# LINGYUN.Abp.Saas.HttpApi.Client + +SaaS HTTP API客户端模块,提供了租户和版本管理的HTTP客户端代理实现。 + +## 功能特性 + +* HTTP客户端代理 + * ITenantAppService的HTTP客户端实现 + * IEditionAppService的HTTP客户端实现 + +## 使用方式 + +1. 安装模块 + +```csharp +[DependsOn(typeof(AbpSaasHttpApiClientModule))] +public class YourModule : AbpModule +{ +} +``` + +2. 配置远程服务 + +```json +{ + "RemoteServices": { + "Default": { + "BaseUrl": "http://localhost:44388/" + } + } +} +``` + +3. 注入并使用服务 + +```csharp +public class YourService +{ + private readonly ITenantAppService _tenantAppService; + private readonly IEditionAppService _editionAppService; + + public YourService( + ITenantAppService tenantAppService, + IEditionAppService editionAppService) + { + _tenantAppService = tenantAppService; + _editionAppService = editionAppService; + } +} +``` + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/README.EN.md new file mode 100644 index 000000000..334bffcb6 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/README.EN.md @@ -0,0 +1,30 @@ +# LINGYUN.Abp.Saas.HttpApi + +SaaS HTTP API module, implementing HTTP API interfaces for tenant and edition management. + +## Features + +* Tenant Management Controller (TenantController) + * GET /api/saas/tenants: Get tenant list + * GET /api/saas/tenants/{id}: Get tenant details + * POST /api/saas/tenants: Create tenant + * PUT /api/saas/tenants/{id}: Update tenant + * DELETE /api/saas/tenants/{id}: Delete tenant + * GET /api/saas/tenants/{id}/connection-strings: Get tenant connection strings + * PUT /api/saas/tenants/{id}/connection-strings: Update tenant connection strings + * DELETE /api/saas/tenants/{id}/connection-strings/{name}: Delete tenant connection string + +* Edition Management Controller (EditionController) + * GET /api/saas/editions: Get edition list + * GET /api/saas/editions/{id}: Get edition details + * POST /api/saas/editions: Create edition + * PUT /api/saas/editions/{id}: Update edition + * DELETE /api/saas/editions/{id}: Delete edition + +## API Documentation + +All API interfaces support Swagger documentation. After starting the application, you can view detailed API documentation through Swagger UI. + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/README.md new file mode 100644 index 000000000..508ae3583 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/README.md @@ -0,0 +1,30 @@ +# LINGYUN.Abp.Saas.HttpApi + +SaaS HTTP API模块,实现了租户和版本管理的HTTP API接口。 + +## 功能特性 + +* 租户管理Controller(TenantController) + * GET /api/saas/tenants:获取租户列表 + * GET /api/saas/tenants/{id}:获取租户详情 + * POST /api/saas/tenants:创建租户 + * PUT /api/saas/tenants/{id}:更新租户 + * DELETE /api/saas/tenants/{id}:删除租户 + * GET /api/saas/tenants/{id}/connection-strings:获取租户连接字符串 + * PUT /api/saas/tenants/{id}/connection-strings:更新租户连接字符串 + * DELETE /api/saas/tenants/{id}/connection-strings/{name}:删除租户连接字符串 + +* 版本管理Controller(EditionController) + * GET /api/saas/editions:获取版本列表 + * GET /api/saas/editions/{id}:获取版本详情 + * POST /api/saas/editions:创建版本 + * PUT /api/saas/editions/{id}:更新版本 + * DELETE /api/saas/editions/{id}:删除版本 + +## API文档 + +所有API接口都支持Swagger文档,启动应用后可以通过Swagger UI查看详细的API文档。 + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/README.EN.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/README.EN.md new file mode 100644 index 000000000..43768a897 --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/README.EN.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.Saas.Jobs + +SaaS background job module, providing background job implementation for tenant resource monitoring and management. + +## Features + +* Tenant Usage Monitoring Job (TenantUsageMonitoringJob) + * Monitor tenant resource usage + * Handle tenant expiration warning + * Handle expired tenant resource recycling + +## Configuration + +### Job Configuration + +```json +{ + "Hangfire": { + "TenantUsageMonitoring": { + "CronExpression": "0 0 * * *", // Run once per day + "Queue": "default", // Job queue + "Enabled": true // Whether to enable + } + } +} +``` + +### Job Parameters + +* Saas:AdminEmail: Administrator email address for receiving warning notifications +* Saas:TenantId: Tenant identifier + +## More + +[简体中文](README.md) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/README.md b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/README.md new file mode 100644 index 000000000..fa88c3b1b --- /dev/null +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/README.md @@ -0,0 +1,35 @@ +# LINGYUN.Abp.Saas.Jobs + +SaaS后台作业模块,提供租户资源监控和管理的后台作业实现。 + +## 功能特性 + +* 租户使用监控作业(TenantUsageMonitoringJob) + * 监控租户资源使用情况 + * 处理租户过期预警 + * 处理过期租户资源回收 + +## 配置说明 + +### 作业配置 + +```json +{ + "Hangfire": { + "TenantUsageMonitoring": { + "CronExpression": "0 0 * * *", // 每天执行一次 + "Queue": "default", // 作业队列 + "Enabled": true // 是否启用 + } + } +} +``` + +### 作业参数 + +* Saas:AdminEmail:管理员邮件地址,用于接收预警通知 +* Saas:TenantId:租户标识 + +## 更多 + +[English](README.EN.md) diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/README.EN.md b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/README.EN.md new file mode 100644 index 000000000..7f7d90317 --- /dev/null +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/README.EN.md @@ -0,0 +1,92 @@ +# LINGYUN.Abp.SettingManagement.Application + +## Module Description + +Setting management application service module, implementing business logic for setting management. + +### Base Modules + +* LINGYUN.Abp.SettingManagement.Application.Contracts +* Volo.Abp.SettingManagement.Application +* Volo.Abp.Ddd.Application + +### Features + +* Provides implementation of setting management application services + * SettingAppService - General setting management service implementation + * UserSettingAppService - User setting management service implementation + * SettingDefinitionAppService - Setting definition management service implementation +* Implements the following application service interfaces + * ISettingAppService + * IUserSettingAppService + * ISettingDefinitionAppService +* Provides setting cache management + * DynamicSettingDefinitionStoreCacheInvalidator - Dynamic setting definition cache invalidation handler + +### Application Services + +* SettingAppService + * GetAllForGlobalAsync - Get global settings + * GetAllForTenantAsync - Get tenant settings + * GetAllForUserAsync - Get user settings + * GetAllGroupsAsync - Get all setting groups + * UpdateAsync - Update settings +* UserSettingAppService + * GetAsync - Get user settings + * UpdateAsync - Update user settings + * DeleteAsync - Delete user settings +* SettingDefinitionAppService + * GetAsync - Get setting definition + * GetListAsync - Get setting definition list + * CreateAsync - Create setting definition + * UpdateAsync - Update setting definition + * DeleteAsync - Delete setting definition + +### Error Codes + +* SettingManagement:010001 - Setting definition name already exists +* SettingManagement:010002 - Setting definition does not exist +* SettingManagement:010003 - Setting definition is static, modification not allowed +* SettingManagement:010004 - Setting definition is static, deletion not allowed + +### How to Use + +1. Add `AbpSettingManagementApplicationModule` dependency + +```csharp +[DependsOn(typeof(AbpSettingManagementApplicationModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Inject and use setting services + +```csharp +public class YourService +{ + private readonly ISettingAppService _settingAppService; + private readonly IUserSettingAppService _userSettingAppService; + + public YourService( + ISettingAppService settingAppService, + IUserSettingAppService userSettingAppService) + { + _settingAppService = settingAppService; + _userSettingAppService = userSettingAppService; + } + + public async Task ManageSettingsAsync() + { + // Get global settings + var settings = await _settingAppService.GetAllForGlobalAsync(); + + // Update user settings + await _userSettingAppService.UpdateAsync( + "SettingName", + "NewValue"); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/README.md b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/README.md new file mode 100644 index 000000000..0ea3e61b6 --- /dev/null +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/README.md @@ -0,0 +1,92 @@ +# LINGYUN.Abp.SettingManagement.Application + +## 模块说明 + +设置管理应用服务模块,实现设置管理相关的业务逻辑。 + +### 基础模块 + +* LINGYUN.Abp.SettingManagement.Application.Contracts +* Volo.Abp.SettingManagement.Application +* Volo.Abp.Ddd.Application + +### 功能定义 + +* 提供设置管理的应用服务实现 + * SettingAppService - 通用设置管理服务实现 + * UserSettingAppService - 用户设置管理服务实现 + * SettingDefinitionAppService - 设置定义管理服务实现 +* 实现以下应用服务接口 + * ISettingAppService + * IUserSettingAppService + * ISettingDefinitionAppService +* 提供设置缓存管理 + * DynamicSettingDefinitionStoreCacheInvalidator - 动态设置定义缓存失效处理 + +### 应用服务 + +* SettingAppService + * GetAllForGlobalAsync - 获取全局设置 + * GetAllForTenantAsync - 获取租户设置 + * GetAllForUserAsync - 获取用户设置 + * GetAllGroupsAsync - 获取所有设置组 + * UpdateAsync - 更新设置 +* UserSettingAppService + * GetAsync - 获取用户设置 + * UpdateAsync - 更新用户设置 + * DeleteAsync - 删除用户设置 +* SettingDefinitionAppService + * GetAsync - 获取设置定义 + * GetListAsync - 获取设置定义列表 + * CreateAsync - 创建设置定义 + * UpdateAsync - 更新设置定义 + * DeleteAsync - 删除设置定义 + +### 错误代码 + +* SettingManagement:010001 - 设置定义名称已存在 +* SettingManagement:010002 - 设置定义不存在 +* SettingManagement:010003 - 设置定义为静态,不允许修改 +* SettingManagement:010004 - 设置定义为静态,不允许删除 + +### 如何使用 + +1. 添加 `AbpSettingManagementApplicationModule` 依赖 + +```csharp +[DependsOn(typeof(AbpSettingManagementApplicationModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 注入并使用设置服务 + +```csharp +public class YourService +{ + private readonly ISettingAppService _settingAppService; + private readonly IUserSettingAppService _userSettingAppService; + + public YourService( + ISettingAppService settingAppService, + IUserSettingAppService userSettingAppService) + { + _settingAppService = settingAppService; + _userSettingAppService = userSettingAppService; + } + + public async Task ManageSettingsAsync() + { + // 获取全局设置 + var settings = await _settingAppService.GetAllForGlobalAsync(); + + // 更新用户设置 + await _userSettingAppService.UpdateAsync( + "SettingName", + "NewValue"); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/README.EN.md b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..d855f649e --- /dev/null +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/README.EN.md @@ -0,0 +1,85 @@ +# LINGYUN.Abp.SettingManagement.HttpApi + +## Module Description + +Setting management HTTP API module, providing RESTful API interfaces for setting management. + +### Base Modules + +* LINGYUN.Abp.SettingManagement.Application.Contracts +* Volo.Abp.AspNetCore.Mvc + +### Features + +* Provides API controllers for setting management + * SettingController - General setting management controller + * UserSettingController - User setting management controller + * SettingDefinitionController - Setting definition management controller + +### API Endpoints + +* /api/setting-management/settings + * GET /by-global - Get global settings + * GET /by-tenant - Get tenant settings + * GET /by-user - Get user settings + * GET /groups - Get all setting groups + * PUT /{providerName}/{providerKey} - Update settings +* /api/setting-management/users + * GET - Get user settings + * PUT - Update user settings + * DELETE - Delete user settings +* /api/setting-management/definitions + * GET - Get setting definition list + * POST - Create setting definition + * PUT - Update setting definition + * DELETE - Delete setting definition + * GET /{name} - Get specific setting definition + +### Permission Requirements + +* SettingManagement.Settings + * Update - Update settings + * ManageGroup - Manage setting groups +* SettingManagement.ManageFeatures + * ManageHostFeatures - Manage host features + +### How to Use + +1. Add `AbpSettingManagementHttpApiModule` dependency + +```csharp +[DependsOn(typeof(AbpSettingManagementHttpApiModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Use API endpoints + +```csharp +public class YourService +{ + private readonly HttpClient _httpClient; + + public YourService(HttpClient httpClient) + { + _httpClient = httpClient; + } + + public async Task ManageSettingsAsync() + { + // Get global settings + var response = await _httpClient.GetAsync("/api/setting-management/settings/by-global"); + var settings = await response.Content.ReadFromJsonAsync>(); + + // Update user settings + await _httpClient.PutAsJsonAsync("/api/setting-management/users", new UpdateSettingDto + { + Name = "SettingName", + Value = "NewValue" + }); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/README.md b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/README.md new file mode 100644 index 000000000..5cc8277de --- /dev/null +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/README.md @@ -0,0 +1,85 @@ +# LINGYUN.Abp.SettingManagement.HttpApi + +## 模块说明 + +设置管理 HTTP API 模块,提供设置管理的 RESTful API 接口。 + +### 基础模块 + +* LINGYUN.Abp.SettingManagement.Application.Contracts +* Volo.Abp.AspNetCore.Mvc + +### 功能定义 + +* 提供设置管理的 API 控制器 + * SettingController - 通用设置管理控制器 + * UserSettingController - 用户设置管理控制器 + * SettingDefinitionController - 设置定义管理控制器 + +### API 接口 + +* /api/setting-management/settings + * GET /by-global - 获取全局设置 + * GET /by-tenant - 获取租户设置 + * GET /by-user - 获取用户设置 + * GET /groups - 获取所有设置组 + * PUT /{providerName}/{providerKey} - 更新设置 +* /api/setting-management/users + * GET - 获取用户设置 + * PUT - 更新用户设置 + * DELETE - 删除用户设置 +* /api/setting-management/definitions + * GET - 获取设置定义列表 + * POST - 创建设置定义 + * PUT - 更新设置定义 + * DELETE - 删除设置定义 + * GET /{name} - 获取指定设置定义 + +### 权限要求 + +* SettingManagement.Settings + * Update - 更新设置 + * ManageGroup - 管理设置组 +* SettingManagement.ManageFeatures + * ManageHostFeatures - 管理主机功能 + +### 如何使用 + +1. 添加 `AbpSettingManagementHttpApiModule` 依赖 + +```csharp +[DependsOn(typeof(AbpSettingManagementHttpApiModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 使用 API 接口 + +```csharp +public class YourService +{ + private readonly HttpClient _httpClient; + + public YourService(HttpClient httpClient) + { + _httpClient = httpClient; + } + + public async Task ManageSettingsAsync() + { + // 获取全局设置 + var response = await _httpClient.GetAsync("/api/setting-management/settings/by-global"); + var settings = await response.Content.ReadFromJsonAsync>(); + + // 更新用户设置 + await _httpClient.PutAsJsonAsync("/api/setting-management/users", new UpdateSettingDto + { + Name = "SettingName", + Value = "NewValue" + }); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/README.EN.md new file mode 100644 index 000000000..cbcca73f7 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/README.EN.md @@ -0,0 +1,21 @@ +# LINGYUN.Abp.BackgroundTasks.Abstractions + +Background task (queue) module abstraction layer, defining basic constructs and interfaces. + +## Feature Parameters + +* DisableJobActionAttribute: Mark this feature to disable job trigger behavior processing +* DisableJobStatusAttribute: Mark this feature to disable job status processing +* DisableAuditingAttribute: Mark this feature to disable job logging + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksAbstractionsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/README.EN.md new file mode 100644 index 000000000..ca2f3200f --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/README.EN.md @@ -0,0 +1,21 @@ +# LINGYUN.Abp.BackgroundTasks.Activities + +Background task (queue) module behavior processing module. + +## Interface Parameters + +* IJobActionStore: Implement this interface to get job management behaviors +* JobActionDefinitionProvider: Implement this interface to customize job behaviors +* JobExecutedProvider: Implement this interface to extend job behaviors + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksActivitiesModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/README.EN.md new file mode 100644 index 000000000..6c9e95dd6 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/README.EN.md @@ -0,0 +1,17 @@ +# LINGYUN.Abp.BackgroundTasks.DistributedLocking + +Background task (queue) module distributed locking module. + +See: [Distributed-Locking](https://docs.abp.io/en/abp/latest/Distributed-Locking) + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksDistributedLockingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/README.EN.md new file mode 100644 index 000000000..f7cb8a8e9 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/README.EN.md @@ -0,0 +1,26 @@ +# LINGYUN.Abp.BackgroundTasks.EventBus + +Background task (queue) module distributed event module, integrating this module enables applications to handle job events. + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksEventBusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Features + +The module provides various job event types: + +- JobEventData - Base event data for all job events +- JobStartEventData - Event data when a job starts +- JobStopEventData - Event data when a job stops +- JobPauseEventData - Event data when a job is paused +- JobResumeEventData - Event data when a job resumes +- JobTriggerEventData - Event data when a job is triggered diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/README.EN.md new file mode 100644 index 000000000..24aaf2b14 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/README.EN.md @@ -0,0 +1,40 @@ +# LINGYUN.Abp.BackgroundTasks.ExceptionHandling + +Background job execution exception notification implementation, using Email to send notifications by default. + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksExceptionHandlingModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Action Parameters + +** Specify the following parameters in the job definition to send notifications when the job execution fails: + +* to Required, recipient email address +* from Optional, sender name in email header +* body Optional, email content (required if template name is not specified) +* subject Optional, email subject +* template Optional, email template +* context Optional, context parameters when using template +* culture Optional, template culture when using template + +## Features + +- Supports email-based exception notifications for background jobs +- Customizable email templates with localization support +- Rich context information in notifications including: + - Tenant name (if applicable) + - Job group + - Job name + - Job ID + - Job type + - Trigger time + - Error message diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Hangfire/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Hangfire/README.EN.md new file mode 100644 index 000000000..169e5b35e --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Hangfire/README.EN.md @@ -0,0 +1,42 @@ +# LINGYUN.Abp.BackgroundTasks.Hangfire + +Background task module implementation based on Hangfire. + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksHangfireModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Features + +- Integrates with Hangfire for background job processing +- Supports job execution events and monitoring +- Implements distributed locking for job execution +- Provides job execution context and result handling +- Includes job parameter management +- Supports job cancellation and timeout handling + +## Components + +- `HangfireJobExecutedAttribute`: Handles job execution events and locking +- `HangfireJobSimpleAdapter`: Adapts job execution to the Hangfire infrastructure +- Job event handling with support for: + - Before execution events + - After execution events + - Execution result handling + - Error handling and logging + +## Job Execution Flow + +1. Job scheduling through Hangfire +2. Pre-execution locking (if configured) +3. Job execution with context +4. Event handling and result processing +5. Lock release and cleanup diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/README.EN.md new file mode 100644 index 000000000..a2c48aad7 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/README.EN.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.BackgroundTasks.Jobs + +Common job module for background tasks (queue). + +## Job List + +* [ConsoleJob](./LINGYUN/Abp/BackgroundTasks/Jobs/ConsoleJob): Console output +* [HttpRequestJob](./LINGYUN/Abp/BackgroundTasks/Jobs/HttpRequestJob): HTTP request +* [SendEmailJob](./LINGYUN/Abp/BackgroundTasks/Jobs/SendEmailJob): Send email +* [SendSmsJob](./LINGYUN/Abp/BackgroundTasks/Jobs/SendSmsJob): Send SMS +* [ServiceInvocationJob](./LINGYUN/Abp/BackgroundTasks/Jobs/ServiceInvocationJob): Service invocation (HTTP request extension) +* [SleepJob](./LINGYUN/Abp/BackgroundTasks/Jobs/SleepJob): Sleep, delay job execution + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksJobsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Features + +### Console Job +- Output messages to console with timestamp +- Configurable message content + +### HTTP Request Job +- Support for various HTTP methods (GET, PUT, POST, PATCH, OPTIONS, DELETE) +- Custom headers and content type +- Request data handling +- Culture support + +### Email Job +- Send emails with customizable: + - Recipients + - Subject + - From address + - Body content + - Email templates + - Template model and context + - Culture support + +### SMS Job +- Send SMS messages with: + - Phone number targeting + - Message content + - Custom properties + +### Service Invocation Job +- Extended HTTP request functionality +- Support for different providers (http, dapr) +- Multi-tenant support +- Service name configuration +- Dapr integration with App ID support + +### Sleep Job +- Delay job execution +- Configurable delay duration in milliseconds +- Default 20-second delay if not specified diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/README.EN.md new file mode 100644 index 000000000..a623e84b3 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/README.EN.md @@ -0,0 +1,54 @@ +# LINGYUN.Abp.BackgroundTasks.Notifications + +Background job execution notification events. + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksNotificationsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Action Parameters + +** Notification content formatting parameters, which will send real-time notifications after job execution: + +* push-provider Optional, specify message push provider +* use-template Optional, template name for formatting notification content +* content Optional, notification content (required if template name is not specified) +* culture Optional, template culture when using template + +## Features + +### Notification Types +- Job Success Notification +- Job Failure Notification +- Job Completion Notification + +### Supported Push Providers +- SignalR (real-time notification) +- SMS (SMS notification) +- Emailing (email notification) +- WeChat.MiniProgram (WeChat Mini Program) +- WxPusher (WxPusher WeChat push service) +- PushPlus (PushPlus multi-platform push service) + +### Notification Features +- Multi-tenant support +- Localization support +- Template-based content formatting +- Multiple push provider support +- Severity-based notifications (Info, Success, Warning, Error) +- Rich notification content with job details: + - Job ID + - Job Group + - Job Name + - Job Type + - Trigger Time + - Tenant Name (if applicable) + - Error Message (for failed jobs) diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/README.EN.md new file mode 100644 index 000000000..8af127ea5 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/README.EN.md @@ -0,0 +1,54 @@ +# LINGYUN.Abp.BackgroundTasks.Quartz + +Background task module implementation based on Quartz, with added listener functionality to notify administrators of task status. + +## Configuration and Usage + +Module reference (refer to Volo.Abp.Quartz module for detailed configuration): + +```csharp +[DependsOn(typeof(AbpBackgroundTasksQuartzModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Features + +### Job Scheduling +- Support for various job types: + - One-time jobs + - Periodic jobs (with Cron expressions) + - Persistent jobs +- Job priority management +- Start/end time scheduling +- Interval-based execution + +### Job Management +- Job queuing and execution +- Job pausing and resuming +- Job triggering on demand +- Job removal and cleanup + +### Job Execution +- Concurrent job execution support +- Job execution context management +- Job parameter passing +- Job result handling + +### Job Monitoring +- Job execution event listening +- Job status tracking +- Error handling and logging +- Multi-tenant support + +### Distributed Features +- Distributed job locking +- Node-specific job execution +- Lock timeout management + +### Adapters +- `QuartzJobSimpleAdapter`: For simple job execution +- `QuartzJobConcurrentAdapter`: For concurrent job execution +- `QuartzJobSearchJobAdapter`: For runtime job discovery diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/README.EN.md new file mode 100644 index 000000000..4a04cb649 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/README.EN.md @@ -0,0 +1,150 @@ +# LINGYUN.Abp.BackgroundTasks + +Background task (queue) module that extends ABP's background jobs and workers with Cron expression support, providing manageable background task (queue) functionality. + +Implements **Volo.Abp.BackgroundJobs.IBackgroundJobManager**, meaning you can add new jobs through the framework's background job interface. +Implements **Volo.Abp.BackgroundWorkers.IBackgroundWorkerManager**, meaning you can add new jobs through the framework's background worker interface. + +## Task Types + +* JobType.Once: One-time task, executed only once, suitable for scenarios like email notifications +* JobType.Period: Periodic task, runs according to a Cron expression, suitable for scenarios like report analysis +* JobType.Persistent: Persistent task, runs according to given repeat count and interval, suitable for scenarios like API stress testing + +## Interface Description + +* [IJobPublisher](/LINGYUN/Abp/BackgroundTasks/IJobPublisher.cs): Job publishing interface, publishes specified jobs to the current node +* [IJobDispatcher](/LINGYUN/Abp/BackgroundTasks/IJobDispatcher.cs): Job dispatching interface, dispatches specified jobs to specified nodes +* [IJobScheduler](/LINGYUN/Abp/BackgroundTasks/IJobScheduler.cs): Scheduler interface, manages job scheduler for the current running node +* [IJobLockProvider](/LINGYUN/Abp/BackgroundTasks/IJobLockProvider.cs): Job locking interface, locks specified jobs to prevent duplicate execution, lock duration is specified by **LockTimeOut** +* [IJobEventTrigger](/LINGYUN/Abp/BackgroundTasks/IJobEventTrigger.cs): Job event trigger interface, listens to events before and after job execution +* [IJobStore](/LINGYUN/Abp/BackgroundTasks/IJobStore.cs): Job persistence interface + +## Configuration and Usage + +Module reference: + +```csharp +[DependsOn(typeof(AbpBackgroundTasksModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +Example usage: + +```csharp +public class DemoClass +{ + protected IServiceProvider ServiceProvider { get; } + + public DemoClass(IServiceProvider serviceProvider) + { + ServiceProvider = serviceProvider; + } + + public async Task Some() + { + var scheduler = ServiceProvider.GetRequiredService(); + + // Add a periodic task (every 5 seconds) to the queue + await scheduler.QueueAsync(new JobInfo + { + Type = typeof(ConsoleJob).AssemblyQualifiedName, + Args = new Dictionary(), + Name = "Test-Console-Period", + Group = "Test", + Description = "Test-Console", + Id = Guid.NewGuid(), + JobType = JobType.Period, + Priority = Volo.Abp.BackgroundJobs.BackgroundJobPriority.Low, + Cron = "0/5 * * * * ? ", + TryCount = 10, + Status = JobStatus.Running, + // Define this field to handle concurrency + LockTimeOut = 120, + }); + + // Add a one-time task to the queue, to be executed after 10 seconds (Interval) + await scheduler.QueueAsync(new JobInfo + { + Type = typeof(ConsoleJob).AssemblyQualifiedName, + Args = new Dictionary(), + Name = "Test-Console-Once", + Group = "Test", + Description = "Test-Console", + Id = Guid.NewGuid(), + JobType = JobType.Once, + Priority = Volo.Abp.BackgroundJobs.BackgroundJobPriority.Low, + Interval = 10, + TryCount = 10, + Status = JobStatus.Running, + }); + + // Add a persistent task to the queue, to be executed after 10 seconds (Interval), maximum 5 executions (MaxCount) + await scheduler.QueueAsync(new JobInfo + { + Type = typeof(ConsoleJob).AssemblyQualifiedName, + Args = new Dictionary(), + Name = "Test-Console-Persistent", + Group = "Test", + Description = "Test-Console", + Id = Guid.NewGuid(), + JobType = JobType.Persistent, + Priority = Volo.Abp.BackgroundJobs.BackgroundJobPriority.Low, + Interval = 10, + TryCount = 10, + MaxCount = 5, + Status = JobStatus.Running, + }); + + // You can also add framework background jobs to the job scheduler without changing usage habits + var backgroundJobManager = ServiceProvider.GetRequiredService(); + await jobManager.EnqueueAsync( + new SmsJobArgs + { + PhoneNumber = "13800138000", + Message = "Message from framework background worker" + }, + BackgroundJobPriority.High, + TimeSpan.FromSeconds(10)); + + // Similarly, you can add framework background workers to the job scheduler without changing usage habits + var backgroundWorkManager = ServiceProvider.GetRequiredService(); + // Console output every 20 seconds + await backgroundWorkManager.AddAsync(ServiceProvider.GetRequiredService()); + } +} + +public class SmsJobArgs +{ + public string PhoneNumber { get; set; } + public string Message { get; set; } +} + +public class SmsJob : AsyncBackgroundJob, ITransientDependency +{ + public override Task ExecuteAsync(SmsJobArgs args) + { + Console.WriteLine($"Send sms message: {args.Message}"); + + return Task.CompletedTask; + } +} + +public class ConsoleWorker : AsyncPeriodicBackgroundWorkerBase, ISingletonDependency +{ + public ConsoleWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory) + : base(timer, serviceScopeFactory) + { + timer.Period = 20000; + } + + protected override Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + Console.WriteLine($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] - ConsoleWorker Do Work."); + return Task.CompletedTask; + } +} +``` diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..f45ddbca0 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.EN.md @@ -0,0 +1,72 @@ +# LINGYUN.Abp.TaskManagement.Application.Contracts + +Application contracts for task management module, defining interfaces and DTOs for application services. + +## Features + +### Application Service Interfaces +- Background Job Info Service: + - CRUD operations + - Job control operations + - Batch operations + - Query operations +- Background Job Action Service: + - Action management + - Action definitions + - Parameter handling +- Background Job Log Service: + - Log retrieval + - Log filtering + - Log deletion + +### Data Transfer Objects (DTOs) +- Background Job Info DTOs: + - Job info DTO + - Job creation DTO + - Job update DTO + - Job list DTO + - Job batch input DTO +- Background Job Action DTOs: + - Action DTO + - Action creation DTO + - Action update DTO + - Action definition DTO + - Action parameter DTO +- Background Job Log DTOs: + - Log DTO + - Log list DTO + - Log filter DTO + +### Permissions +- Background Jobs: + - Create permission + - Update permission + - Delete permission + - Trigger permission + - Pause permission + - Resume permission + - Start permission + - Stop permission +- Background Job Logs: + - View permission + - Delete permission + +### Remote Service Configuration +- Service name constants +- Service endpoint configuration +- Client proxy settings + +### Validation +- Input validation +- Data annotations +- Custom validation rules + +### Integration Features +- ABP Framework integration +- Dynamic query support +- Application service layer abstraction + +### Module Configuration +- Module dependencies +- Service registration +- Feature management diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.md new file mode 100644 index 000000000..0adce0414 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.md @@ -0,0 +1,72 @@ +# LINGYUN.Abp.TaskManagement.Application.Contracts + +任务管理模块的应用程序契约,定义应用服务的接口和DTO。 + +## 功能 + +### 应用服务接口 +- 后台作业信息服务: + - CRUD操作 + - 作业控制操作 + - 批量操作 + - 查询操作 +- 后台作业行为服务: + - 行为管理 + - 行为定义 + - 参数处理 +- 后台作业日志服务: + - 日志检索 + - 日志过滤 + - 日志删除 + +### 数据传输对象(DTOs) +- 后台作业信息DTOs: + - 作业信息DTO + - 作业创建DTO + - 作业更新DTO + - 作业列表DTO + - 作业批量输入DTO +- 后台作业行为DTOs: + - 行为DTO + - 行为创建DTO + - 行为更新DTO + - 行为定义DTO + - 行为参数DTO +- 后台作业日志DTOs: + - 日志DTO + - 日志列表DTO + - 日志过滤DTO + +### 权限 +- 后台作业: + - 创建权限 + - 更新权限 + - 删除权限 + - 触发权限 + - 暂停权限 + - 恢复权限 + - 启动权限 + - 停止权限 +- 后台作业日志: + - 查看权限 + - 删除权限 + +### 远程服务配置 +- 服务名称常量 +- 服务端点配置 +- 客户端代理设置 + +### 验证 +- 输入验证 +- 数据注解 +- 自定义验证规则 + +### 集成功能 +- ABP框架集成 +- 动态查询支持 +- 应用服务层抽象 + +### 模块配置 +- 模块依赖 +- 服务注册 +- 功能管理 diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.EN.md new file mode 100644 index 000000000..8640a74bb --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.EN.md @@ -0,0 +1,88 @@ +# LINGYUN.Abp.TaskManagement.Application + +The application layer implementation of the task management module, providing core functionality for background job management. + +## Features + +### Background Job Management Service +- Background Job Info Service (BackgroundJobInfoAppService) + - Implements CRUD operations for jobs + - Provides job control functions (start, stop, pause, resume, etc.) + - Supports batch operations + - Implements job querying and filtering + +### Background Job Action Service (BackgroundJobActionAppService) +- Action Management Features: + - Add job actions + - Update job actions + - Delete job actions + - Get list of job actions +- Action Definition Management: + - Get available action definitions + - Action parameter configuration + - Action enable/disable control + +### Background Job Log Service (BackgroundJobLogAppService) +- Log Management Features: + - Get log details + - Get log list + - Delete log records +- Log Query Features: + - Support for multiple condition queries + - Pagination + - Sorting functionality + - Advanced filtering + +### Object Mapping Configuration +- AutoMapper Profile: + - Mapping from BackgroundJobInfo to BackgroundJobInfoDto + - Mapping from BackgroundJobLog to BackgroundJobLogDto + - Mapping from BackgroundJobAction to BackgroundJobActionDto + +### Module Configuration +- Dependencies: + - AbpAutoMapper + - AbpDynamicQueryable + - TaskManagementDomain + - TaskManagementApplication.Contracts +- Service Configuration: + - Automatic object mapping configuration + - Validation configuration + +### Extended Features +- Expression Extensions: + - AndIf conditional expression + - OrIf conditional expression +- Dynamic query support +- Localization resource integration + +## Usage + +1. Add module dependency: +```csharp +[DependsOn(typeof(TaskManagementApplicationModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. Inject and use services: +```csharp +public class YourService +{ + private readonly IBackgroundJobInfoAppService _jobInfoAppService; + private readonly IBackgroundJobActionAppService _jobActionAppService; + private readonly IBackgroundJobLogAppService _jobLogAppService; + + public YourService( + IBackgroundJobInfoAppService jobInfoAppService, + IBackgroundJobActionAppService jobActionAppService, + IBackgroundJobLogAppService jobLogAppService) + { + _jobInfoAppService = jobInfoAppService; + _jobActionAppService = jobActionAppService; + _jobLogAppService = jobLogAppService; + } +} +``` diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.md new file mode 100644 index 000000000..5bb18e177 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.md @@ -0,0 +1,88 @@ +# LINGYUN.Abp.TaskManagement.Application + +任务管理模块的应用层实现,提供后台作业管理的核心功能实现。 + +## 功能实现 + +### 后台作业管理服务 +- 后台作业信息服务 (BackgroundJobInfoAppService) + - 实现作业的CRUD操作 + - 提供作业控制功能(启动、停止、暂停、恢复等) + - 支持批量操作功能 + - 实现作业查询和过滤 + +### 后台作业行为服务 (BackgroundJobActionAppService) +- 行为管理功能: + - 添加作业行为 + - 更新作业行为 + - 删除作业行为 + - 获取作业行为列表 +- 行为定义管理: + - 获取可用的行为定义 + - 行为参数配置 + - 行为启用/禁用控制 + +### 后台作业日志服务 (BackgroundJobLogAppService) +- 日志管理功能: + - 获取日志详情 + - 获取日志列表 + - 删除日志记录 +- 日志查询功能: + - 支持多条件组合查询 + - 分页查询 + - 排序功能 + - 高级过滤 + +### 对象映射配置 +- AutoMapper配置文件: + - BackgroundJobInfo到BackgroundJobInfoDto的映射 + - BackgroundJobLog到BackgroundJobLogDto的映射 + - BackgroundJobAction到BackgroundJobActionDto的映射 + +### 模块配置 +- 依赖模块: + - AbpAutoMapper + - AbpDynamicQueryable + - TaskManagementDomain + - TaskManagementApplication.Contracts +- 服务配置: + - 自动对象映射配置 + - 验证配置 + +### 扩展功能 +- 表达式扩展: + - AndIf条件表达式 + - OrIf条件表达式 +- 动态查询支持 +- 本地化资源集成 + +## 使用方式 + +1. 添加模块依赖: +```csharp +[DependsOn(typeof(TaskManagementApplicationModule))] +public class YourModule : AbpModule +{ + // ... +} +``` + +2. 注入并使用服务: +```csharp +public class YourService +{ + private readonly IBackgroundJobInfoAppService _jobInfoAppService; + private readonly IBackgroundJobActionAppService _jobActionAppService; + private readonly IBackgroundJobLogAppService _jobLogAppService; + + public YourService( + IBackgroundJobInfoAppService jobInfoAppService, + IBackgroundJobActionAppService jobActionAppService, + IBackgroundJobLogAppService jobLogAppService) + { + _jobInfoAppService = jobInfoAppService; + _jobActionAppService = jobActionAppService; + _jobLogAppService = jobLogAppService; + } +} +``` diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.EN.md new file mode 100644 index 000000000..155b3b3bb --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.EN.md @@ -0,0 +1,68 @@ +# LINGYUN.Abp.TaskManagement.Domain.Shared + +Domain shared module for task management, containing shared domain models, enums, and constants. + +## Features + +### Permission Management +- Task Management permissions +- Background job permissions +- Job action permissions +- Job log permissions + +### Job Types and Status +- Job Types: + - One-off jobs (executed once) + - Periodic jobs (executed periodically) + - Persistent jobs (executed repeatedly) +- Job Status: + - None + - Completed + - Running + - Queuing + - Paused + - Failed Retry + - Stopped + +### Priority Levels +- Low +- Below Normal +- Normal +- Above Normal +- High + +### Job Properties +- Basic Information: + - Group + - Name + - Description + - Type + - Status + - Begin/End Time +- Execution Settings: + - Interval (in seconds) + - Cron expression + - Lock timeout + - Priority + - Maximum trigger count + - Maximum retry count +- Tracking Information: + - Creation time + - Last run time + - Next run time + - Trigger count + - Try count + - Execution result + +### Localization +- Support for multiple languages +- Error code localization +- UI text localization + +### Multi-tenancy Support +- Tenant-specific job management +- System-level job management + +### Source Types +- User jobs +- System jobs diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.md new file mode 100644 index 000000000..6cfb70fb0 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.md @@ -0,0 +1,68 @@ +# LINGYUN.Abp.TaskManagement.Domain.Shared + +任务管理领域共享模块,包含共享的领域模型、枚举和常量。 + +## 功能 + +### 权限管理 +- 任务调度平台权限 +- 后台作业权限 +- 作业行为权限 +- 作业日志权限 + +### 作业类型和状态 +- 作业类型: + - 一次性作业(只执行一次) + - 周期性作业(按照给定条件周期性运行) + - 持续性作业(按照给定条件重复运行) +- 作业状态: + - 未定义 + - 已完成 + - 运行中 + - 队列中 + - 已暂停 + - 失败重试 + - 已停止 + +### 优先级别 +- 低 +- 低于正常 +- 正常 +- 高于正常 +- 高 + +### 作业属性 +- 基本信息: + - 分组 + - 名称 + - 描述 + - 类型 + - 状态 + - 开始/结束时间 +- 执行设置: + - 时间间隔(秒) + - Cron表达式 + - 锁定超时时间 + - 优先级 + - 最大触发次数 + - 最大重试次数 +- 跟踪信息: + - 创建时间 + - 上次执行时间 + - 下次预期时间 + - 触发次数 + - 尝试次数 + - 执行结果 + +### 本地化 +- 支持多语言 +- 错误代码本地化 +- UI文本本地化 + +### 多租户支持 +- 租户级作业管理 +- 系统级作业管理 + +### 来源类型 +- 用户作业 +- 系统内置作业 diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.EN.md new file mode 100644 index 000000000..f4a3fbae0 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.EN.md @@ -0,0 +1,75 @@ +# LINGYUN.Abp.TaskManagement.Domain + +Domain module for task management, implementing core business logic and domain models. + +## Features + +### Background Job Management +- Job lifecycle management (create, update, delete) +- Job status control (start, stop, pause, resume, trigger) +- Support for different job types: + - One-off jobs + - Periodic jobs (with cron expressions) + - Persistent jobs (with intervals) + +### Job Store +- Store job information and execution status +- Track job execution history +- Clean up expired jobs +- Support for multi-tenancy + +### Job Synchronization +- Synchronize job status across distributed systems +- Handle job creation, update, and deletion events +- Maintain job queue consistency + +### Job Actions +- Manage job-related actions +- Store action parameters +- Enable/disable actions + +### Job Filtering and Specifications +- Filter jobs by multiple criteria: + - Type + - Group + - Name + - Status + - Priority + - Source + - Creation time + - Last run time +- Support for complex job queries + +### Job Logging +- Log job execution details +- Track execution results and exceptions +- Support for multi-tenancy in logging + +### Domain Events +- Job status change events +- Job execution events +- Distributed event handling + +### Job Priority Management +- Support multiple priority levels: + - Low + - Below Normal + - Normal + - Above Normal + - High + +### Job Source Management +- Support different job sources: + - User jobs + - System jobs + +### Multi-tenancy Support +- Tenant-specific job management +- Cross-tenant job operations +- Tenant isolation in job execution + +### Domain Services +- Background job manager +- Job store service +- Job action service +- Job log service diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.md new file mode 100644 index 000000000..99935d933 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.md @@ -0,0 +1,75 @@ +# LINGYUN.Abp.TaskManagement.Domain + +任务管理领域模块,实现核心业务逻辑和领域模型。 + +## 功能 + +### 后台作业管理 +- 作业生命周期管理(创建、更新、删除) +- 作业状态控制(启动、停止、暂停、恢复、触发) +- 支持不同类型的作业: + - 一次性作业 + - 周期性作业(使用cron表达式) + - 持续性作业(使用时间间隔) + +### 作业存储 +- 存储作业信息和执行状态 +- 跟踪作业执行历史 +- 清理过期作业 +- 支持多租户 + +### 作业同步 +- 在分布式系统中同步作业状态 +- 处理作业创建、更新和删除事件 +- 维护作业队列一致性 + +### 作业行为 +- 管理作业相关行为 +- 存储行为参数 +- 启用/禁用行为 + +### 作业过滤和规范 +- 通过多个条件过滤作业: + - 类型 + - 分组 + - 名称 + - 状态 + - 优先级 + - 来源 + - 创建时间 + - 上次运行时间 +- 支持复杂作业查询 + +### 作业日志 +- 记录作业执行详情 +- 跟踪执行结果和异常 +- 支持多租户日志记录 + +### 领域事件 +- 作业状态变更事件 +- 作业执行事件 +- 分布式事件处理 + +### 作业优先级管理 +- 支持多个优先级别: + - 低 + - 低于正常 + - 正常 + - 高于正常 + - 高 + +### 作业来源管理 +- 支持不同的作业来源: + - 用户作业 + - 系统作业 + +### 多租户支持 +- 租户特定的作业管理 +- 跨租户作业操作 +- 作业执行中的租户隔离 + +### 领域服务 +- 后台作业管理器 +- 作业存储服务 +- 作业行为服务 +- 作业日志服务 diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..252882c2e --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.EN.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.TaskManagement.EntityFrameworkCore + +Entity Framework Core implementation for task management module, providing database access and persistence. + +## Features + +### Database Context +- TaskManagementDbContext for managing database operations +- Configurable table prefix and schema +- Support for multi-tenancy + +### Entity Configurations +- Background Job Info: + - Table name: {prefix}BackgroundJobs + - Indexes on Name and Group + - Properties with length constraints + - Extra properties support +- Background Job Log: + - Table name: {prefix}BackgroundJobLogs + - Indexes on JobGroup and JobName + - Properties with length constraints +- Background Job Action: + - Table name: {prefix}BackgroundJobActions + - Index on Name + - Extra properties support for parameters + +### Repository Implementations +- Background Job Info Repository: + - CRUD operations + - Job status management + - Job filtering and querying + - Support for job expiration + - Waiting job list management + - Period task management +- Background Job Log Repository: + - Log storage and retrieval + - Log filtering and querying + - Pagination support +- Background Job Action Repository: + - Action storage and retrieval + - Parameter management + +### Query Features +- Dynamic sorting +- Pagination +- Filtering by specifications +- Asynchronous operations +- No-tracking queries for read-only operations + +### Performance Optimizations +- Efficient indexing +- Batch operations support +- Optimized queries for job status + +### Multi-tenancy Support +- Tenant-specific data isolation +- Cross-tenant operations +- Tenant-aware repositories + +### Integration Features +- ABP Framework integration +- Entity Framework Core conventions +- Value converters for complex types +- Extra properties support diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.md new file mode 100644 index 000000000..90c9be0f7 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.TaskManagement.EntityFrameworkCore + +任务管理模块的Entity Framework Core实现,提供数据库访问和持久化。 + +## 功能 + +### 数据库上下文 +- TaskManagementDbContext用于管理数据库操作 +- 可配置的表前缀和架构 +- 支持多租户 + +### 实体配置 +- 后台作业信息: + - 表名:{prefix}BackgroundJobs + - 对Name和Group建立索引 + - 带长度约束的属性 + - 支持额外属性 +- 后台作业日志: + - 表名:{prefix}BackgroundJobLogs + - 对JobGroup和JobName建立索引 + - 带长度约束的属性 +- 后台作业行为: + - 表名:{prefix}BackgroundJobActions + - 对Name建立索引 + - 支持参数的额外属性 + +### 仓储实现 +- 后台作业信息仓储: + - CRUD操作 + - 作业状态管理 + - 作业过滤和查询 + - 支持作业过期 + - 等待作业列表管理 + - 周期性任务管理 +- 后台作业日志仓储: + - 日志存储和检索 + - 日志过滤和查询 + - 分页支持 +- 后台作业行为仓储: + - 行为存储和检索 + - 参数管理 + +### 查询功能 +- 动态排序 +- 分页 +- 按规范过滤 +- 异步操作 +- 只读操作的无跟踪查询 + +### 性能优化 +- 高效索引 +- 支持批量操作 +- 针对作业状态的优化查询 + +### 多租户支持 +- 租户特定的数据隔离 +- 跨租户操作 +- 租户感知的仓储 + +### 集成功能 +- ABP框架集成 +- Entity Framework Core约定 +- 复杂类型的值转换器 +- 额外属性支持 diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.EN.md new file mode 100644 index 000000000..7e3c139b1 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.EN.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.TaskManagement.HttpApi.Client + +HTTP API client implementation for task management module, providing client-side proxy services for remote API calls. + +## Features + +### HTTP Client Proxies +- Automatic proxy generation for application contracts +- Type-safe client interfaces +- Strongly-typed DTOs + +### Remote Service Configuration +- Remote service name configuration +- Service endpoint configuration +- Client options configuration + +### Authentication +- Token-based authentication support +- Authentication header handling +- Secure communication + +### Service Integration +- Seamless integration with ABP Framework +- Dynamic HTTP client configuration +- Automatic service registration + +### Error Handling +- Exception translation +- Error response handling +- Retry policies + +### Client Features +- Asynchronous operations +- Request/response interceptors +- Automatic content negotiation + +### Dependency Injection +- Automatic dependency registration +- Scoped service lifetime +- Service resolution + +### Module Configuration +- Module dependency management +- Service configuration +- Client proxy configuration diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.md new file mode 100644 index 000000000..f81d12ad4 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.md @@ -0,0 +1,45 @@ +# LINGYUN.Abp.TaskManagement.HttpApi.Client + +任务管理模块的HTTP API客户端实现,提供远程API调用的客户端代理服务。 + +## 功能 + +### HTTP客户端代理 +- 自动生成应用程序契约的代理 +- 类型安全的客户端接口 +- 强类型DTO + +### 远程服务配置 +- 远程服务名称配置 +- 服务端点配置 +- 客户端选项配置 + +### 身份认证 +- 基于令牌的身份认证支持 +- 认证头处理 +- 安全通信 + +### 服务集成 +- 与ABP框架的无缝集成 +- 动态HTTP客户端配置 +- 自动服务注册 + +### 错误处理 +- 异常转换 +- 错误响应处理 +- 重试策略 + +### 客户端功能 +- 异步操作 +- 请求/响应拦截器 +- 自动内容协商 + +### 依赖注入 +- 自动依赖注册 +- 作用域服务生命周期 +- 服务解析 + +### 模块配置 +- 模块依赖管理 +- 服务配置 +- 客户端代理配置 diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.EN.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..cac85730f --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.EN.md @@ -0,0 +1,80 @@ +# LINGYUN.Abp.TaskManagement.HttpApi + +HTTP API implementation for task management module, providing RESTful endpoints for managing background jobs. + +## Features + +### Background Job Info API +- CRUD operations: + - Create new jobs + - Get job details + - Update job properties + - Delete jobs +- Job control operations: + - Start jobs + - Stop jobs + - Pause jobs + - Resume jobs + - Trigger jobs +- Batch operations: + - Bulk start + - Bulk stop + - Bulk pause + - Bulk resume + - Bulk trigger + - Bulk delete +- Query operations: + - Get job list with pagination + - Get job definitions + - Filter and sort jobs + +### Background Job Action API +- Action management: + - Add actions to jobs + - Update action properties + - Delete actions + - Get action list +- Action definitions: + - Get available action definitions + - Query action definitions + +### Background Job Log API +- Log operations: + - Get log details + - Get log list with pagination + - Delete logs +- Log filtering: + - Filter by job + - Filter by time range + - Filter by status + +### Authorization +- Permission-based access control: + - Create job permission + - Update job permission + - Delete job permission + - Trigger job permission + - Pause job permission + - Resume job permission + - Start job permission + - Stop job permission + - Delete log permission + +### API Features +- RESTful endpoints +- HTTP method-based operations +- Route-based API versioning +- Standardized response formats +- Pagination support +- Dynamic filtering and sorting + +### Localization +- Multi-language support +- Localized error messages +- Localized validation messages + +### Integration +- ABP Framework integration +- MVC integration +- Dynamic query support +- Validation support diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.md b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.md new file mode 100644 index 000000000..90af5b181 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.md @@ -0,0 +1,80 @@ +# LINGYUN.Abp.TaskManagement.HttpApi + +任务管理模块的HTTP API实现,提供用于管理后台作业的RESTful接口。 + +## 功能 + +### 后台作业信息API +- CRUD操作: + - 创建新作业 + - 获取作业详情 + - 更新作业属性 + - 删除作业 +- 作业控制操作: + - 启动作业 + - 停止作业 + - 暂停作业 + - 恢复作业 + - 触发作业 +- 批量操作: + - 批量启动 + - 批量停止 + - 批量暂停 + - 批量恢复 + - 批量触发 + - 批量删除 +- 查询操作: + - 获取分页作业列表 + - 获取作业定义 + - 过滤和排序作业 + +### 后台作业行为API +- 行为管理: + - 添加作业行为 + - 更新行为属性 + - 删除行为 + - 获取行为列表 +- 行为定义: + - 获取可用行为定义 + - 查询行为定义 + +### 后台作业日志API +- 日志操作: + - 获取日志详情 + - 获取分页日志列表 + - 删除日志 +- 日志过滤: + - 按作业过滤 + - 按时间范围过滤 + - 按状态过滤 + +### 授权 +- 基于权限的访问控制: + - 创建作业权限 + - 更新作业权限 + - 删除作业权限 + - 触发作业权限 + - 暂停作业权限 + - 恢复作业权限 + - 启动作业权限 + - 停止作业权限 + - 删除日志权限 + +### API特性 +- RESTful接口 +- 基于HTTP方法的操作 +- 基于路由的API版本控制 +- 标准化的响应格式 +- 分页支持 +- 动态过滤和排序 + +### 本地化 +- 多语言支持 +- 本地化错误消息 +- 本地化验证消息 + +### 集成 +- ABP框架集成 +- MVC集成 +- 动态查询支持 +- 验证支持 diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/README.EN.md new file mode 100644 index 000000000..0002f95a5 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/README.EN.md @@ -0,0 +1,81 @@ +# LINGYUN.Abp.TextTemplating.Application.Contracts + +## Module Description + +Text templating application service contracts module, providing interface definitions and DTOs for text template management. + +### Base Modules + +* Volo.Abp.TextTemplating +* Volo.Abp.Ddd.Application.Contracts + +### Features + +* Provides application service interfaces for text template management + * ITextTemplateDefinitionAppService - Template definition management service interface + * ITextTemplateContentAppService - Template content management service interface +* Provides DTO definitions for text templates + * TextTemplateDefinitionDto - Template definition DTO + * TextTemplateContentDto - Template content DTO + * TextTemplateDefinitionCreateDto - Create template definition DTO + * TextTemplateDefinitionUpdateDto - Update template definition DTO + * TextTemplateContentUpdateDto - Update template content DTO +* Provides permission definitions for text template management + +### Permission Definitions + +* AbpTextTemplating.TextTemplateDefinitions + * Create - Create template definition + * Update - Update template definition + * Delete - Delete template definition +* AbpTextTemplating.TextTemplateContents + * Update - Update template content + * Delete - Delete template content + +### Application Service Interfaces + +* ITextTemplateDefinitionAppService + * GetAsync - Get template definition + * GetListAsync - Get template definition list + * CreateAsync - Create template definition + * UpdateAsync - Update template definition + * DeleteAsync - Delete template definition +* ITextTemplateContentAppService + * GetAsync - Get template content + * UpdateAsync - Update template content + * DeleteAsync - Delete template content + * RestoreAsync - Restore template content + +### How to Use + +1. Add `AbpTextTemplatingApplicationContractsModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Inject and use template service interfaces + +```csharp +public class YourService +{ + private readonly ITextTemplateDefinitionAppService _templateDefinitionAppService; + + public YourService(ITextTemplateDefinitionAppService templateDefinitionAppService) + { + _templateDefinitionAppService = templateDefinitionAppService; + } + + public async Task ManageTemplateAsync() + { + // Get template definition list + var templates = await _templateDefinitionAppService.GetListAsync( + new TextTemplateDefinitionGetListInput()); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/README.md new file mode 100644 index 000000000..ce6a4679d --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/README.md @@ -0,0 +1,81 @@ +# LINGYUN.Abp.TextTemplating.Application.Contracts + +## 模块说明 + +文本模板应用服务契约模块,提供文本模板管理相关的接口定义和DTO。 + +### 基础模块 + +* Volo.Abp.TextTemplating +* Volo.Abp.Ddd.Application.Contracts + +### 功能定义 + +* 提供文本模板管理的应用服务接口 + * ITextTemplateDefinitionAppService - 模板定义管理服务接口 + * ITextTemplateContentAppService - 模板内容管理服务接口 +* 提供文本模板相关的DTO定义 + * TextTemplateDefinitionDto - 模板定义DTO + * TextTemplateContentDto - 模板内容DTO + * TextTemplateDefinitionCreateDto - 创建模板定义DTO + * TextTemplateDefinitionUpdateDto - 更新模板定义DTO + * TextTemplateContentUpdateDto - 更新模板内容DTO +* 提供文本模板管理相关的权限定义 + +### 权限定义 + +* AbpTextTemplating.TextTemplateDefinitions + * Create - 创建模板定义 + * Update - 更新模板定义 + * Delete - 删除模板定义 +* AbpTextTemplating.TextTemplateContents + * Update - 更新模板内容 + * Delete - 删除模板内容 + +### 应用服务接口 + +* ITextTemplateDefinitionAppService + * GetAsync - 获取模板定义 + * GetListAsync - 获取模板定义列表 + * CreateAsync - 创建模板定义 + * UpdateAsync - 更新模板定义 + * DeleteAsync - 删除模板定义 +* ITextTemplateContentAppService + * GetAsync - 获取模板内容 + * UpdateAsync - 更新模板内容 + * DeleteAsync - 删除模板内容 + * RestoreAsync - 恢复模板内容 + +### 如何使用 + +1. 添加 `AbpTextTemplatingApplicationContractsModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 注入并使用模板服务接口 + +```csharp +public class YourService +{ + private readonly ITextTemplateDefinitionAppService _templateDefinitionAppService; + + public YourService(ITextTemplateDefinitionAppService templateDefinitionAppService) + { + _templateDefinitionAppService = templateDefinitionAppService; + } + + public async Task ManageTemplateAsync() + { + // 获取模板定义列表 + var templates = await _templateDefinitionAppService.GetListAsync( + new TextTemplateDefinitionGetListInput()); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/README.EN.md new file mode 100644 index 000000000..be2ad1c6d --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/README.EN.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.TextTemplating.Application + +## Module Description + +Text templating application service module, implementing management and operation functions for text templates. + +### Base Modules + +* LINGYUN.Abp.TextTemplating.Application.Contracts +* Volo.Abp.TextTemplating +* Volo.Abp.Ddd.Application + +### Features + +* Provides text template definition management services + * TextTemplateDefinitionAppService - Template definition management service + * TextTemplateContentAppService - Template content management service +* Implements the following application service interfaces + * ITextTemplateDefinitionAppService + * ITextTemplateContentAppService + +### Application Services + +* TextTemplateDefinitionAppService + * GetAsync - Get template definition + * GetListAsync - Get template definition list + * CreateAsync - Create template definition + * UpdateAsync - Update template definition + * DeleteAsync - Delete template definition +* TextTemplateContentAppService + * GetAsync - Get template content + * UpdateAsync - Update template content + * DeleteAsync - Delete template content + * RestoreAsync - Restore template content + +### Permissions + +* AbpTextTemplating.TextTemplateDefinitions + * Create - Create template definition + * Update - Update template definition + * Delete - Delete template definition +* AbpTextTemplating.TextTemplateContents + * Update - Update template content + * Delete - Delete template content + +### How to Use + +1. Add `AbpTextTemplatingApplicationModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingApplicationModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Inject and use template services + +```csharp +public class YourService +{ + private readonly ITextTemplateDefinitionAppService _templateDefinitionAppService; + + public YourService(ITextTemplateDefinitionAppService templateDefinitionAppService) + { + _templateDefinitionAppService = templateDefinitionAppService; + } + + public async Task ManageTemplateAsync() + { + // Create template definition + var template = await _templateDefinitionAppService.CreateAsync( + new TextTemplateDefinitionCreateDto + { + Name = "TemplateName", + DisplayName = "Template Display Name", + RenderEngine = "Razor" + }); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/README.md new file mode 100644 index 000000000..351c38835 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/README.md @@ -0,0 +1,83 @@ +# LINGYUN.Abp.TextTemplating.Application + +## 模块说明 + +文本模板应用服务模块,实现文本模板的管理和操作功能。 + +### 基础模块 + +* LINGYUN.Abp.TextTemplating.Application.Contracts +* Volo.Abp.TextTemplating +* Volo.Abp.Ddd.Application + +### 功能定义 + +* 提供文本模板定义管理服务 + * TextTemplateDefinitionAppService - 模板定义管理服务 + * TextTemplateContentAppService - 模板内容管理服务 +* 实现以下应用服务接口 + * ITextTemplateDefinitionAppService + * ITextTemplateContentAppService + +### 应用服务 + +* TextTemplateDefinitionAppService + * GetAsync - 获取模板定义 + * GetListAsync - 获取模板定义列表 + * CreateAsync - 创建模板定义 + * UpdateAsync - 更新模板定义 + * DeleteAsync - 删除模板定义 +* TextTemplateContentAppService + * GetAsync - 获取模板内容 + * UpdateAsync - 更新模板内容 + * DeleteAsync - 删除模板内容 + * RestoreAsync - 恢复模板内容 + +### 权限 + +* AbpTextTemplating.TextTemplateDefinitions + * Create - 创建模板定义 + * Update - 更新模板定义 + * Delete - 删除模板定义 +* AbpTextTemplating.TextTemplateContents + * Update - 更新模板内容 + * Delete - 删除模板内容 + +### 如何使用 + +1. 添加 `AbpTextTemplatingApplicationModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingApplicationModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 注入并使用模板服务 + +```csharp +public class YourService +{ + private readonly ITextTemplateDefinitionAppService _templateDefinitionAppService; + + public YourService(ITextTemplateDefinitionAppService templateDefinitionAppService) + { + _templateDefinitionAppService = templateDefinitionAppService; + } + + public async Task ManageTemplateAsync() + { + // 创建模板定义 + var template = await _templateDefinitionAppService.CreateAsync( + new TextTemplateDefinitionCreateDto + { + Name = "TemplateName", + DisplayName = "Template Display Name", + RenderEngine = "Razor" + }); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/README.EN.md new file mode 100644 index 000000000..fd8271454 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/README.EN.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.TextTemplating.Domain.Shared + +## Module Description + +Text templating domain shared module, providing shared definitions for text templates including constants, enums, and exceptions. + +### Base Modules + +* Volo.Abp.TextTemplating +* Volo.Abp.Validation + +### Features + +* Provides constants for text templates + * TextTemplateDefinitionConsts - Template definition related constants + * TextTemplateContentConsts - Template content related constants +* Provides error code definitions + * AbpTextTemplatingErrorCodes - Error code constants +* Provides localization resources + * AbpTextTemplatingResource - Localization resource + +### Constants + +* TextTemplateDefinitionConsts + * MaxNameLength - Maximum length for template name (64) + * MaxDisplayNameLength - Maximum length for display name (128) + * MaxLayoutLength - Maximum length for layout name (256) + * MaxDefaultCultureNameLength - Maximum length for default culture name (10) + * MaxLocalizationResourceNameLength - Maximum length for localization resource name (128) + * MaxRenderEngineLength - Maximum length for render engine name (64) + +### Error Codes + +* AbpTextTemplatingErrorCodes + * TextTemplateDefinition:NameAlreadyExists - Template name already exists + * TextTemplateDefinition:NotFound - Template definition not found + +### How to Use + +1. Add `AbpTextTemplatingDomainSharedModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingDomainSharedModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Use constants and error codes + +```csharp +public class YourService +{ + public void ValidateTemplateName(string name) + { + if (name.Length > TextTemplateDefinitionConsts.MaxNameLength) + { + throw new BusinessException(AbpTextTemplatingErrorCodes.TextTemplateDefinition.NameAlreadyExists); + } + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/README.md new file mode 100644 index 000000000..d2f1ee43c --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/README.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.TextTemplating.Domain.Shared + +## 模块说明 + +文本模板领域共享模块,提供文本模板相关的常量、枚举、异常等共享定义。 + +### 基础模块 + +* Volo.Abp.TextTemplating +* Volo.Abp.Validation + +### 功能定义 + +* 提供文本模板相关的常量定义 + * TextTemplateDefinitionConsts - 模板定义相关常量 + * TextTemplateContentConsts - 模板内容相关常量 +* 提供文本模板相关的错误代码定义 + * AbpTextTemplatingErrorCodes - 错误代码常量 +* 提供本地化资源定义 + * AbpTextTemplatingResource - 本地化资源 + +### 常量定义 + +* TextTemplateDefinitionConsts + * MaxNameLength - 模板名称最大长度 (64) + * MaxDisplayNameLength - 显示名称最大长度 (128) + * MaxLayoutLength - 布局名称最大长度 (256) + * MaxDefaultCultureNameLength - 默认文化名称最大长度 (10) + * MaxLocalizationResourceNameLength - 本地化资源名称最大长度 (128) + * MaxRenderEngineLength - 渲染引擎名称最大长度 (64) + +### 错误代码 + +* AbpTextTemplatingErrorCodes + * TextTemplateDefinition:NameAlreadyExists - 模板名称已存在 + * TextTemplateDefinition:NotFound - 模板定义不存在 + +### 如何使用 + +1. 添加 `AbpTextTemplatingDomainSharedModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingDomainSharedModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 使用常量和错误代码 + +```csharp +public class YourService +{ + public void ValidateTemplateName(string name) + { + if (name.Length > TextTemplateDefinitionConsts.MaxNameLength) + { + throw new BusinessException(AbpTextTemplatingErrorCodes.TextTemplateDefinition.NameAlreadyExists); + } + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/README.EN.md new file mode 100644 index 000000000..d61e370f0 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/README.EN.md @@ -0,0 +1,82 @@ +# LINGYUN.Abp.TextTemplating.Domain + +## Module Description + +Text templating domain module, providing core functionality for text template definition and content management. + +### Base Modules + +* Volo.Abp.TextTemplating +* Volo.Abp.Ddd.Domain + +### Features + +* Provides domain entities for text template definition + * TextTemplateDefinition - Text template definition entity + * TextTemplateContent - Text template content entity +* Provides repository interfaces for text template definition + * ITextTemplateDefinitionRepository - Text template definition repository interface + * ITextTemplateContentRepository - Text template content repository interface +* Provides domain services for text template management + * TextTemplateManager - Text template manager + * IStaticTemplateDefinitionStore - Static template definition store + * IDynamicTemplateDefinitionStore - Dynamic template definition store + +### Domain Services + +* TextTemplateManager + * Manages creation, update, and deletion of text templates + * Handles association between template definitions and content + * Supports management of both static and dynamic template definitions + +### Entity Properties + +* TextTemplateDefinition + * Name - Template name + * DisplayName - Display name + * IsLayout - Whether it is a layout template + * Layout - Layout name + * IsInlineLocalized - Whether inline localization is enabled + * DefaultCultureName - Default culture name + * LocalizationResourceName - Localization resource name + * RenderEngine - Render engine + * IsStatic - Whether it is a static template + +### How to Use + +1. Add `AbpTextTemplatingDomainModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingDomainModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Use text template manager + +```csharp +public class YourService +{ + private readonly TextTemplateManager _templateManager; + + public YourService(TextTemplateManager templateManager) + { + _templateManager = templateManager; + } + + public async Task ManageTemplateAsync() + { + // Create template definition + var template = new TextTemplateDefinition( + Guid.NewGuid(), + "TemplateName", + "Template Display Name", + renderEngine: "Razor"); + + await _templateManager.CreateAsync(template); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/README.md new file mode 100644 index 000000000..4c888abb9 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/README.md @@ -0,0 +1,82 @@ +# LINGYUN.Abp.TextTemplating.Domain + +## 模块说明 + +文本模板领域模块,提供文本模板定义和内容管理的核心功能。 + +### 基础模块 + +* Volo.Abp.TextTemplating +* Volo.Abp.Ddd.Domain + +### 功能定义 + +* 提供文本模板定义的领域实体 + * TextTemplateDefinition - 文本模板定义实体 + * TextTemplateContent - 文本模板内容实体 +* 提供文本模板定义的仓储接口 + * ITextTemplateDefinitionRepository - 文本模板定义仓储接口 + * ITextTemplateContentRepository - 文本模板内容仓储接口 +* 提供文本模板管理的领域服务 + * TextTemplateManager - 文本模板管理器 + * IStaticTemplateDefinitionStore - 静态模板定义存储 + * IDynamicTemplateDefinitionStore - 动态模板定义存储 + +### 领域服务 + +* TextTemplateManager + * 管理文本模板的创建、更新、删除 + * 处理模板定义与内容的关联 + * 支持静态和动态模板定义的管理 + +### 实体属性 + +* TextTemplateDefinition + * Name - 模板名称 + * DisplayName - 显示名称 + * IsLayout - 是否为布局模板 + * Layout - 布局名称 + * IsInlineLocalized - 是否内联本地化 + * DefaultCultureName - 默认文化名称 + * LocalizationResourceName - 本地化资源名称 + * RenderEngine - 渲染引擎 + * IsStatic - 是否为静态模板 + +### 如何使用 + +1. 添加 `AbpTextTemplatingDomainModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingDomainModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 使用文本模板管理器 + +```csharp +public class YourService +{ + private readonly TextTemplateManager _templateManager; + + public YourService(TextTemplateManager templateManager) + { + _templateManager = templateManager; + } + + public async Task ManageTemplateAsync() + { + // 创建模板定义 + var template = new TextTemplateDefinition( + Guid.NewGuid(), + "TemplateName", + "Template Display Name", + renderEngine: "Razor"); + + await _templateManager.CreateAsync(template); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/README.EN.md new file mode 100644 index 000000000..cb01afd17 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/README.EN.md @@ -0,0 +1,74 @@ +# LINGYUN.Abp.TextTemplating.EntityFrameworkCore + +## Module Description + +Text templating EntityFrameworkCore module, providing data access implementation for text templates. + +### Base Modules + +* LINGYUN.Abp.TextTemplating.Domain +* Volo.Abp.EntityFrameworkCore + +### Features + +* Implements repository interfaces for text templates + * EfCoreTextTemplateDefinitionRepository - Template definition repository implementation + * EfCoreTextTemplateContentRepository - Template content repository implementation +* Provides database context and configuration + * ITextTemplatingDbContext - Text templating database context interface + * TextTemplatingDbContext - Text templating database context + * TextTemplatingDbContextModelCreatingExtensions - Database model configuration extensions + +### Database Tables + +* AbpTextTemplateDefinitions - Template definition table + * Id - Primary key + * Name - Template name + * DisplayName - Display name + * IsLayout - Whether it is a layout template + * Layout - Layout name + * IsInlineLocalized - Whether inline localization is enabled + * DefaultCultureName - Default culture name + * LocalizationResourceName - Localization resource name + * RenderEngine - Render engine + * IsStatic - Whether it is a static template +* AbpTextTemplateContents - Template content table + * Id - Primary key + * Name - Template name + * CultureName - Culture name + * Content - Template content + +### How to Use + +1. Add `AbpTextTemplatingEntityFrameworkCoreModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Configure database context + +```csharp +public class YourDbContext : AbpDbContext, ITextTemplatingDbContext +{ + public DbSet TextTemplateDefinitions { get; set; } + public DbSet TextTemplateContents { get; set; } + + public YourDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureTextTemplating(); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/README.md new file mode 100644 index 000000000..06d67ccc4 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/README.md @@ -0,0 +1,74 @@ +# LINGYUN.Abp.TextTemplating.EntityFrameworkCore + +## 模块说明 + +文本模板 EntityFrameworkCore 模块,提供文本模板的数据访问实现。 + +### 基础模块 + +* LINGYUN.Abp.TextTemplating.Domain +* Volo.Abp.EntityFrameworkCore + +### 功能定义 + +* 实现文本模板的仓储接口 + * EfCoreTextTemplateDefinitionRepository - 模板定义仓储实现 + * EfCoreTextTemplateContentRepository - 模板内容仓储实现 +* 提供数据库上下文和配置 + * ITextTemplatingDbContext - 文本模板数据库上下文接口 + * TextTemplatingDbContext - 文本模板数据库上下文 + * TextTemplatingDbContextModelCreatingExtensions - 数据库模型配置扩展 + +### 数据库表 + +* AbpTextTemplateDefinitions - 模板定义表 + * Id - 主键 + * Name - 模板名称 + * DisplayName - 显示名称 + * IsLayout - 是否为布局模板 + * Layout - 布局名称 + * IsInlineLocalized - 是否内联本地化 + * DefaultCultureName - 默认文化名称 + * LocalizationResourceName - 本地化资源名称 + * RenderEngine - 渲染引擎 + * IsStatic - 是否为静态模板 +* AbpTextTemplateContents - 模板内容表 + * Id - 主键 + * Name - 模板名称 + * CultureName - 文化名称 + * Content - 模板内容 + +### 如何使用 + +1. 添加 `AbpTextTemplatingEntityFrameworkCoreModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingEntityFrameworkCoreModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 配置数据库上下文 + +```csharp +public class YourDbContext : AbpDbContext, ITextTemplatingDbContext +{ + public DbSet TextTemplateDefinitions { get; set; } + public DbSet TextTemplateContents { get; set; } + + public YourDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureTextTemplating(); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/README.EN.md new file mode 100644 index 000000000..9723afdca --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/README.EN.md @@ -0,0 +1,66 @@ +# LINGYUN.Abp.TextTemplating.HttpApi.Client + +## Module Description + +Text templating HTTP API client module, providing HTTP client proxy implementation for text template management. + +### Base Modules + +* LINGYUN.Abp.TextTemplating.Application.Contracts +* Volo.Abp.Http.Client + +### Features + +* Provides HTTP client proxies for text template management + * TextTemplateDefinitionClientProxy - Template definition management client proxy + * TextTemplateContentClientProxy - Template content management client proxy +* Implements the following application service interfaces + * ITextTemplateDefinitionAppService + * ITextTemplateContentAppService + +### Configuration + +* AbpTextTemplatingRemoteServiceConsts + * RemoteServiceName - Remote service name (default: "AbpTextTemplating") + +### How to Use + +1. Add `AbpTextTemplatingHttpApiClientModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingHttpApiClientModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // Configure remote service + Configure(options => + { + options.RemoteServices.Default.BaseUrl = "http://localhost:44315/"; + }); + } +} +``` + +2. Inject and use client proxies + +```csharp +public class YourService +{ + private readonly ITextTemplateDefinitionAppService _templateDefinitionAppService; + + public YourService(ITextTemplateDefinitionAppService templateDefinitionAppService) + { + _templateDefinitionAppService = templateDefinitionAppService; + } + + public async Task ManageTemplateAsync() + { + // Get template definition list + var templates = await _templateDefinitionAppService.GetListAsync( + new TextTemplateDefinitionGetListInput()); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/README.md new file mode 100644 index 000000000..ccefe2aed --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/README.md @@ -0,0 +1,66 @@ +# LINGYUN.Abp.TextTemplating.HttpApi.Client + +## 模块说明 + +文本模板 HTTP API 客户端模块,提供文本模板管理的 HTTP 客户端代理实现。 + +### 基础模块 + +* LINGYUN.Abp.TextTemplating.Application.Contracts +* Volo.Abp.Http.Client + +### 功能定义 + +* 提供文本模板管理的 HTTP 客户端代理 + * TextTemplateDefinitionClientProxy - 模板定义管理客户端代理 + * TextTemplateContentClientProxy - 模板内容管理客户端代理 +* 实现以下应用服务接口 + * ITextTemplateDefinitionAppService + * ITextTemplateContentAppService + +### 配置项 + +* AbpTextTemplatingRemoteServiceConsts + * RemoteServiceName - 远程服务名称 (默认: "AbpTextTemplating") + +### 如何使用 + +1. 添加 `AbpTextTemplatingHttpApiClientModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingHttpApiClientModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // 配置远程服务 + Configure(options => + { + options.RemoteServices.Default.BaseUrl = "http://localhost:44315/"; + }); + } +} +``` + +2. 注入并使用客户端代理 + +```csharp +public class YourService +{ + private readonly ITextTemplateDefinitionAppService _templateDefinitionAppService; + + public YourService(ITextTemplateDefinitionAppService templateDefinitionAppService) + { + _templateDefinitionAppService = templateDefinitionAppService; + } + + public async Task ManageTemplateAsync() + { + // 获取模板定义列表 + var templates = await _templateDefinitionAppService.GetListAsync( + new TextTemplateDefinitionGetListInput()); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/README.EN.md new file mode 100644 index 000000000..52d99fc10 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/README.EN.md @@ -0,0 +1,74 @@ +# LINGYUN.Abp.TextTemplating.HttpApi + +## Module Description + +Text templating HTTP API module, providing RESTful API interfaces for text template management. + +### Base Modules + +* LINGYUN.Abp.TextTemplating.Application.Contracts +* Volo.Abp.AspNetCore.Mvc + +### Features + +* Provides API controllers for text template management + * TextTemplateDefinitionController - Template definition management controller + * TextTemplateContentController - Template content management controller + +### API Endpoints + +* /api/text-templating/template-definitions + * GET - Get template definition list + * POST - Create template definition + * PUT - Update template definition + * DELETE - Delete template definition + * GET /{name} - Get specific template definition +* /api/text-templating/template-contents + * GET - Get template content + * PUT - Update template content + * DELETE - Delete template content + * POST /restore - Restore template content + +### Permission Requirements + +* AbpTextTemplating.TextTemplateDefinitions + * Create - Create template definition + * Update - Update template definition + * Delete - Delete template definition +* AbpTextTemplating.TextTemplateContents + * Update - Update template content + * Delete - Delete template content + +### How to Use + +1. Add `AbpTextTemplatingHttpApiModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingHttpApiModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Use API endpoints + +```csharp +public class YourService +{ + private readonly HttpClient _httpClient; + + public YourService(HttpClient httpClient) + { + _httpClient = httpClient; + } + + public async Task ManageTemplateAsync() + { + // Get template definition list + var response = await _httpClient.GetAsync("/api/text-templating/template-definitions"); + var templates = await response.Content.ReadFromJsonAsync>(); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/README.md new file mode 100644 index 000000000..5bf3d9d09 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/README.md @@ -0,0 +1,74 @@ +# LINGYUN.Abp.TextTemplating.HttpApi + +## 模块说明 + +文本模板 HTTP API 模块,提供文本模板管理的 RESTful API 接口。 + +### 基础模块 + +* LINGYUN.Abp.TextTemplating.Application.Contracts +* Volo.Abp.AspNetCore.Mvc + +### 功能定义 + +* 提供文本模板管理的 API 控制器 + * TextTemplateDefinitionController - 模板定义管理控制器 + * TextTemplateContentController - 模板内容管理控制器 + +### API 接口 + +* /api/text-templating/template-definitions + * GET - 获取模板定义列表 + * POST - 创建模板定义 + * PUT - 更新模板定义 + * DELETE - 删除模板定义 + * GET /{name} - 获取指定模板定义 +* /api/text-templating/template-contents + * GET - 获取模板内容 + * PUT - 更新模板内容 + * DELETE - 删除模板内容 + * POST /restore - 恢复模板内容 + +### 权限要求 + +* AbpTextTemplating.TextTemplateDefinitions + * Create - 创建模板定义 + * Update - 更新模板定义 + * Delete - 删除模板定义 +* AbpTextTemplating.TextTemplateContents + * Update - 更新模板内容 + * Delete - 删除模板内容 + +### 如何使用 + +1. 添加 `AbpTextTemplatingHttpApiModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingHttpApiModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 使用 API 接口 + +```csharp +public class YourService +{ + private readonly HttpClient _httpClient; + + public YourService(HttpClient httpClient) + { + _httpClient = httpClient; + } + + public async Task ManageTemplateAsync() + { + // 获取模板定义列表 + var response = await _httpClient.GetAsync("/api/text-templating/template-definitions"); + var templates = await response.Content.ReadFromJsonAsync>(); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Razor/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Razor/README.EN.md new file mode 100644 index 000000000..135b56eb9 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Razor/README.EN.md @@ -0,0 +1,87 @@ +# LINGYUN.Abp.TextTemplating.Razor + +## Module Description + +Text templating Razor engine module, providing template rendering implementation based on Razor syntax. + +### Base Modules + +* Volo.Abp.TextTemplating.Razor +* LINGYUN.Abp.TextTemplating.Domain + +### Features + +* Provides Razor template rendering engine + * RazorTemplateRenderingEngine - Razor template rendering engine implementation +* Supports the following features + * Write templates using Razor syntax + * Support model binding and strongly-typed views + * Support layout templates + * Support partial views + * Support HTML encoding and decoding + * Support conditional statements and loops + * Support C# expressions + +### How to Use + +1. Add `AbpTextTemplatingRazorModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingRazorModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Create and use Razor templates + +```csharp +// Create template definition +var template = new TextTemplateDefinition( + Guid.NewGuid(), + "Welcome", + "Welcome Email Template", + renderEngine: "Razor"); + +// Template content example +@model WelcomeEmailModel + + + + +

Welcome @Model.UserName!

+

Thank you for joining us.

+ @if (Model.IsFirstTime) + { +

Here are some tips to get started...

+ } + + + +// Use template +public class YourService +{ + private readonly ITemplateRenderer _templateRenderer; + + public YourService(ITemplateRenderer templateRenderer) + { + _templateRenderer = templateRenderer; + } + + public async Task RenderWelcomeEmailAsync(string userName, bool isFirstTime) + { + var model = new WelcomeEmailModel + { + UserName = userName, + IsFirstTime = isFirstTime + }; + + return await _templateRenderer.RenderAsync( + "Welcome", + model + ); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Razor/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Razor/README.md new file mode 100644 index 000000000..63626670d --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Razor/README.md @@ -0,0 +1,87 @@ +# LINGYUN.Abp.TextTemplating.Razor + +## 模块说明 + +文本模板 Razor 引擎模块,提供基于 Razor 语法的模板渲染实现。 + +### 基础模块 + +* Volo.Abp.TextTemplating.Razor +* LINGYUN.Abp.TextTemplating.Domain + +### 功能定义 + +* 提供 Razor 模板渲染引擎 + * RazorTemplateRenderingEngine - Razor 模板渲染引擎实现 +* 支持以下功能 + * 使用 Razor 语法编写模板 + * 支持模型绑定和强类型视图 + * 支持布局模板 + * 支持部分视图 + * 支持 HTML 编码和解码 + * 支持条件语句和循环 + * 支持 C# 表达式 + +### 如何使用 + +1. 添加 `AbpTextTemplatingRazorModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingRazorModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 创建和使用 Razor 模板 + +```csharp +// 创建模板定义 +var template = new TextTemplateDefinition( + Guid.NewGuid(), + "Welcome", + "Welcome Email Template", + renderEngine: "Razor"); + +// 模板内容示例 +@model WelcomeEmailModel + + + + +

Welcome @Model.UserName!

+

Thank you for joining us.

+ @if (Model.IsFirstTime) + { +

Here are some tips to get started...

+ } + + + +// 使用模板 +public class YourService +{ + private readonly ITemplateRenderer _templateRenderer; + + public YourService(ITemplateRenderer templateRenderer) + { + _templateRenderer = templateRenderer; + } + + public async Task RenderWelcomeEmailAsync(string userName, bool isFirstTime) + { + var model = new WelcomeEmailModel + { + UserName = userName, + IsFirstTime = isFirstTime + }; + + return await _templateRenderer.RenderAsync( + "Welcome", + model + ); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/README.EN.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/README.EN.md new file mode 100644 index 000000000..058aace8d --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/README.EN.md @@ -0,0 +1,93 @@ +# LINGYUN.Abp.TextTemplating.Scriban + +## Module Description + +Text templating Scriban engine module, providing template rendering implementation based on Scriban syntax. + +### Base Modules + +* Volo.Abp.TextTemplating.Scriban +* LINGYUN.Abp.TextTemplating.Domain + +### Features + +* Provides Scriban template rendering engine + * ScribanTemplateRenderingEngine - Scriban template rendering engine implementation +* Supports the following features + * Write templates using Scriban syntax + * Support model binding + * Support layout templates + * Support conditional statements and loops + * Support custom functions and filters + * Support string operations and formatting + * Support array and object operations + +### How to Use + +1. Add `AbpTextTemplatingScribanModule` dependency + +```csharp +[DependsOn(typeof(AbpTextTemplatingScribanModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. Create and use Scriban templates + +```csharp +// Create template definition +var template = new TextTemplateDefinition( + Guid.NewGuid(), + "Welcome", + "Welcome Email Template", + renderEngine: "Scriban"); + +// Template content example + + + +

Welcome {{ user.name }}!

+

Thank you for joining us.

+ {{ if is_first_time }} +

Here are some tips to get started...

+ {{ end }} +
    + {{ for item in items }} +
  • {{ item.name }}: {{ item.description }}
  • + {{ end }} +
+ + + +// Use template +public class YourService +{ + private readonly ITemplateRenderer _templateRenderer; + + public YourService(ITemplateRenderer templateRenderer) + { + _templateRenderer = templateRenderer; + } + + public async Task RenderWelcomeEmailAsync( + string userName, + bool isFirstTime, + List items) + { + var model = new Dictionary + { + ["user"] = new { name = userName }, + ["is_first_time"] = isFirstTime, + ["items"] = items + }; + + return await _templateRenderer.RenderAsync( + "Welcome", + model + ); + } +} +``` + +[查看中文](README.md) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/README.md b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/README.md new file mode 100644 index 000000000..e215dfd19 --- /dev/null +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/README.md @@ -0,0 +1,93 @@ +# LINGYUN.Abp.TextTemplating.Scriban + +## 模块说明 + +文本模板 Scriban 引擎模块,提供基于 Scriban 语法的模板渲染实现。 + +### 基础模块 + +* Volo.Abp.TextTemplating.Scriban +* LINGYUN.Abp.TextTemplating.Domain + +### 功能定义 + +* 提供 Scriban 模板渲染引擎 + * ScribanTemplateRenderingEngine - Scriban 模板渲染引擎实现 +* 支持以下功能 + * 使用 Scriban 语法编写模板 + * 支持模型绑定 + * 支持布局模板 + * 支持条件语句和循环 + * 支持自定义函数和过滤器 + * 支持字符串操作和格式化 + * 支持数组和对象操作 + +### 如何使用 + +1. 添加 `AbpTextTemplatingScribanModule` 依赖 + +```csharp +[DependsOn(typeof(AbpTextTemplatingScribanModule))] +public class YouProjectModule : AbpModule +{ +} +``` + +2. 创建和使用 Scriban 模板 + +```csharp +// 创建模板定义 +var template = new TextTemplateDefinition( + Guid.NewGuid(), + "Welcome", + "Welcome Email Template", + renderEngine: "Scriban"); + +// 模板内容示例 + + + +

Welcome {{ user.name }}!

+

Thank you for joining us.

+ {{ if is_first_time }} +

Here are some tips to get started...

+ {{ end }} +
    + {{ for item in items }} +
  • {{ item.name }}: {{ item.description }}
  • + {{ end }} +
+ + + +// 使用模板 +public class YourService +{ + private readonly ITemplateRenderer _templateRenderer; + + public YourService(ITemplateRenderer templateRenderer) + { + _templateRenderer = templateRenderer; + } + + public async Task RenderWelcomeEmailAsync( + string userName, + bool isFirstTime, + List items) + { + var model = new Dictionary + { + ["user"] = new { name = userName }, + ["is_first_time"] = isFirstTime, + ["items"] = items + }; + + return await _templateRenderer.RenderAsync( + "Welcome", + model + ); + } +} +``` + +[查看英文](README.EN.md) diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/README.EN.md new file mode 100644 index 000000000..793541b71 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/README.EN.md @@ -0,0 +1,73 @@ +# LINGYUN.Abp.Webhooks.ClientProxies + +Webhook client proxy module that provides proxy implementation for webhook clients. + +[简体中文](README.md) + +## Features + +* Webhook client proxy +* HTTP client configuration +* Automatic retry mechanism +* Error handling + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksClientProxiesModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Webhooks": { + "ClientProxies": { + "RetryCount": 3, // Number of retry attempts + "RetryInterval": "00:00:05", // Retry interval + "HttpTimeout": "00:00:30" // HTTP request timeout + } + } +} +``` + +## Basic Usage + +1. Configure Client Proxy +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.RetryCount = 5; + options.RetryInterval = TimeSpan.FromSeconds(10); + }); +} +``` + +2. Use Client Proxy +```csharp +public class YourService +{ + private readonly IWebhookClientProxy _webhookClientProxy; + + public YourService(IWebhookClientProxy webhookClientProxy) + { + _webhookClientProxy = webhookClientProxy; + } + + public async Task SendWebhook() + { + await _webhookClientProxy.SendAsync( + new WebhookSendArgs + { + WebhookUri = "https://your-webhook-endpoint", + Data = new { /* webhook data */ } + }); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/README.md new file mode 100644 index 000000000..36a485905 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/README.md @@ -0,0 +1,73 @@ +# LINGYUN.Abp.Webhooks.ClientProxies + +Webhook客户端代理模块,提供Webhook客户端的代理实现。 + +[English](README.EN.md) + +## 功能特性 + +* Webhook客户端代理 +* HTTP客户端配置 +* 自动重试机制 +* 错误处理 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksClientProxiesModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Webhooks": { + "ClientProxies": { + "RetryCount": 3, // 重试次数 + "RetryInterval": "00:00:05", // 重试间隔 + "HttpTimeout": "00:00:30" // HTTP请求超时时间 + } + } +} +``` + +## 基本用法 + +1. 配置客户端代理 +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.RetryCount = 5; + options.RetryInterval = TimeSpan.FromSeconds(10); + }); +} +``` + +2. 使用客户端代理 +```csharp +public class YourService +{ + private readonly IWebhookClientProxy _webhookClientProxy; + + public YourService(IWebhookClientProxy webhookClientProxy) + { + _webhookClientProxy = webhookClientProxy; + } + + public async Task SendWebhook() + { + await _webhookClientProxy.SendAsync( + new WebhookSendArgs + { + WebhookUri = "https://your-webhook-endpoint", + Data = new { /* webhook data */ } + }); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/README.EN.md new file mode 100644 index 000000000..ae8970b73 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/README.EN.md @@ -0,0 +1,70 @@ +# LINGYUN.Abp.Webhooks.Core + +Core webhook module that provides webhook definition, configuration and basic functionality support. + +[简体中文](README.md) + +## Features + +* Webhook definition management +* Configurable webhook timeout and retry mechanism +* Automatic subscription deactivation protection +* Customizable HTTP headers +* Support for multiple webhook providers + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "Webhooks": { + "TimeoutDuration": "00:01:00", // Default timeout duration, 60 seconds by default + "MaxSendAttemptCount": 5, // Maximum number of send attempts + "IsAutomaticSubscriptionDeactivationEnabled": true, // Whether to automatically deactivate subscription when reaching maximum consecutive failures + "MaxConsecutiveFailCountBeforeDeactivateSubscription": 15, // Maximum consecutive failures before subscription deactivation, default is MaxSendAttemptCount * 3 + "DefaultAgentIdentifier": "Abp-Webhooks", // Default sender identifier + "DefaultHttpHeaders": { // Default HTTP headers + "_AbpDontWrapResult": "true", + "X-Requested-From": "abp-webhooks" + } + } +} +``` + +## Basic Usage + +1. Define a Webhook +```csharp +public class YourWebhookDefinitionProvider : WebhookDefinitionProvider +{ + public override void Define(IWebhookDefinitionContext context) + { + context.Add( + new WebhookDefinition( + name: "TestWebhook", + displayName: L("DisplayName:TestWebhook"), + description: L("Description:TestWebhook") + ) + ); + } +} +``` + +2. Configure Webhook Options +```csharp +Configure(options => +{ + options.TimeoutDuration = TimeSpan.FromMinutes(2); + options.MaxSendAttemptCount = 3; + options.AddHeader("Custom-Header", "Value"); +}); +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/README.md new file mode 100644 index 000000000..9a99ec60d --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/README.md @@ -0,0 +1,70 @@ +# LINGYUN.Abp.Webhooks.Core + +Webhook核心模块,提供Webhook定义、配置和基础功能支持。 + +[English](README.EN.md) + +## 功能特性 + +* Webhook定义管理 +* 可配置的Webhook超时和重试机制 +* 自动订阅失效保护 +* 可自定义HTTP请求头 +* 支持多Webhook提供者 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "Webhooks": { + "TimeoutDuration": "00:01:00", // 默认超时时间,默认60秒 + "MaxSendAttemptCount": 5, // 默认最大发送次数 + "IsAutomaticSubscriptionDeactivationEnabled": true, // 是否在达到最大连续失败次数时自动取消订阅 + "MaxConsecutiveFailCountBeforeDeactivateSubscription": 15, // 取消订阅前最大连续失败次数,默认为MaxSendAttemptCount * 3 + "DefaultAgentIdentifier": "Abp-Webhooks", // 默认发送方标识 + "DefaultHttpHeaders": { // 默认请求头 + "_AbpDontWrapResult": "true", + "X-Requested-From": "abp-webhooks" + } + } +} +``` + +## 基本用法 + +1. 定义Webhook +```csharp +public class YourWebhookDefinitionProvider : WebhookDefinitionProvider +{ + public override void Define(IWebhookDefinitionContext context) + { + context.Add( + new WebhookDefinition( + name: "TestWebhook", + displayName: L("DisplayName:TestWebhook"), + description: L("Description:TestWebhook") + ) + ); + } +} +``` + +2. 配置Webhook选项 +```csharp +Configure(options => +{ + options.TimeoutDuration = TimeSpan.FromMinutes(2); + options.MaxSendAttemptCount = 3; + options.AddHeader("Custom-Header", "Value"); +}); +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/README.EN.md new file mode 100644 index 000000000..4b5a152f3 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Webhooks.EventBus + +Webhook event bus integration module that provides integration with the ABP event bus. + +[简体中文](README.md) + +## Features + +* Support for publishing webhook events to the event bus +* Seamless integration with ABP event bus +* Support for distributed event bus + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksEventBusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Define Webhook Event Handler +```csharp +public class YourWebhookEventHandler : + IDistributedEventHandler, + ITransientDependency +{ + public async Task HandleEventAsync(WebhookEventData eventData) + { + // Handle webhook event + } +} +``` + +2. Publish Webhook Event +```csharp +public class YourService +{ + private readonly IDistributedEventBus _eventBus; + + public YourService(IDistributedEventBus eventBus) + { + _eventBus = eventBus; + } + + public async Task PublishWebhook() + { + await _eventBus.PublishAsync(new WebhookEventData + { + WebhookName = "YourWebhook", + Data = new { /* webhook data */ } + }); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/README.md new file mode 100644 index 000000000..e204e8551 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Webhooks.EventBus + +Webhook事件总线集成模块,提供与ABP事件总线的集成支持。 + +[English](README.EN.md) + +## 功能特性 + +* 支持将Webhook事件发布到事件总线 +* 与ABP事件总线无缝集成 +* 支持分布式事件总线 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksEventBusModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 定义Webhook事件处理器 +```csharp +public class YourWebhookEventHandler : + IDistributedEventHandler, + ITransientDependency +{ + public async Task HandleEventAsync(WebhookEventData eventData) + { + // 处理webhook事件 + } +} +``` + +2. 发布Webhook事件 +```csharp +public class YourService +{ + private readonly IDistributedEventBus _eventBus; + + public YourService(IDistributedEventBus eventBus) + { + _eventBus = eventBus; + } + + public async Task PublishWebhook() + { + await _eventBus.PublishAsync(new WebhookEventData + { + WebhookName = "YourWebhook", + Data = new { /* webhook data */ } + }); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/README.EN.md new file mode 100644 index 000000000..a04ba71ec --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Webhooks.Identity + +Webhook identity integration module that provides integration with ABP identity system. + +[简体中文](README.md) + +## Features + +* Integration with ABP identity system +* Support for user and tenant level webhooks +* Identity-related webhook events + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksIdentityModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Handle Identity-related Webhooks +```csharp +public class YourIdentityWebhookHandler : IWebhookHandler, ITransientDependency +{ + public async Task HandleWebhookAsync(WebhookPayload webhook) + { + if (webhook.WebhookName == "User.Created") + { + // Handle user creation event + } + } +} +``` + +2. Publish Identity-related Webhooks +```csharp +public class YourService +{ + private readonly IWebhookPublisher _webhookPublisher; + + public YourService(IWebhookPublisher webhookPublisher) + { + _webhookPublisher = webhookPublisher; + } + + public async Task PublishIdentityWebhook() + { + await _webhookPublisher.PublishAsync( + webhookName: "User.Created", + data: new { /* user data */ } + ); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/README.md new file mode 100644 index 000000000..c9867c6f2 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Webhooks.Identity + +Webhook身份集成模块,提供与ABP身份系统的集成支持。 + +[English](README.EN.md) + +## 功能特性 + +* 与ABP身份系统集成 +* 支持用户和租户级别的Webhook +* 身份相关的Webhook事件 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksIdentityModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 处理身份相关的Webhook +```csharp +public class YourIdentityWebhookHandler : IWebhookHandler, ITransientDependency +{ + public async Task HandleWebhookAsync(WebhookPayload webhook) + { + if (webhook.WebhookName == "User.Created") + { + // 处理用户创建事件 + } + } +} +``` + +2. 发布身份相关的Webhook +```csharp +public class YourService +{ + private readonly IWebhookPublisher _webhookPublisher; + + public YourService(IWebhookPublisher webhookPublisher) + { + _webhookPublisher = webhookPublisher; + } + + public async Task PublishIdentityWebhook() + { + await _webhookPublisher.PublishAsync( + webhookName: "User.Created", + data: new { /* user data */ } + ); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/README.EN.md new file mode 100644 index 000000000..0172a10fd --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/README.EN.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Webhooks.Saas + +Webhook SaaS integration module that provides integration with ABP SaaS system. + +[简体中文](README.md) + +## Features + +* Integration with ABP SaaS system +* Support for multi-tenant webhooks +* SaaS-related webhook events + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksSaasModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Handle SaaS-related Webhooks +```csharp +public class YourSaasWebhookHandler : IWebhookHandler, ITransientDependency +{ + public async Task HandleWebhookAsync(WebhookPayload webhook) + { + if (webhook.WebhookName == "Tenant.Created") + { + // Handle tenant creation event + } + } +} +``` + +2. Publish SaaS-related Webhooks +```csharp +public class YourService +{ + private readonly IWebhookPublisher _webhookPublisher; + + public YourService(IWebhookPublisher webhookPublisher) + { + _webhookPublisher = webhookPublisher; + } + + public async Task PublishSaasWebhook() + { + await _webhookPublisher.PublishAsync( + webhookName: "Tenant.Created", + data: new { /* tenant data */ } + ); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/README.md new file mode 100644 index 000000000..8304cc6ef --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/README.md @@ -0,0 +1,58 @@ +# LINGYUN.Abp.Webhooks.Saas + +Webhook SaaS集成模块,提供与ABP SaaS系统的集成支持。 + +[English](README.EN.md) + +## 功能特性 + +* 与ABP SaaS系统集成 +* 支持多租户Webhook +* SaaS相关的Webhook事件 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksSaasModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 处理SaaS相关的Webhook +```csharp +public class YourSaasWebhookHandler : IWebhookHandler, ITransientDependency +{ + public async Task HandleWebhookAsync(WebhookPayload webhook) + { + if (webhook.WebhookName == "Tenant.Created") + { + // 处理租户创建事件 + } + } +} +``` + +2. 发布SaaS相关的Webhook +```csharp +public class YourService +{ + private readonly IWebhookPublisher _webhookPublisher; + + public YourService(IWebhookPublisher webhookPublisher) + { + _webhookPublisher = webhookPublisher; + } + + public async Task PublishSaasWebhook() + { + await _webhookPublisher.PublishAsync( + webhookName: "Tenant.Created", + data: new { /* tenant data */ } + ); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/README.EN.md new file mode 100644 index 000000000..c694b3e66 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/README.EN.md @@ -0,0 +1,73 @@ +# LINGYUN.Abp.Webhooks + +Base webhook module that provides basic webhook definitions and functionality. + +[简体中文](README.md) + +## Features + +* Basic webhook definitions +* Webhook publishing and subscription +* Webhook event data handling +* Webhook configuration management + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Basic Usage + +1. Define a Webhook +```csharp +public class YourWebhookDefinitionProvider : WebhookDefinitionProvider +{ + public override void Define(IWebhookDefinitionContext context) + { + context.Add( + new WebhookDefinition( + name: "YourWebhook", + displayName: L("DisplayName:YourWebhook"), + description: L("Description:YourWebhook") + ) + ); + } +} +``` + +2. Publish a Webhook +```csharp +public class YourService +{ + private readonly IWebhookPublisher _webhookPublisher; + + public YourService(IWebhookPublisher webhookPublisher) + { + _webhookPublisher = webhookPublisher; + } + + public async Task PublishWebhook() + { + await _webhookPublisher.PublishAsync( + webhookName: "YourWebhook", + data: new { /* webhook data */ } + ); + } +} +``` + +3. Handle Webhook Events +```csharp +public class YourWebhookHandler : IWebhookHandler, ITransientDependency +{ + public async Task HandleWebhookAsync(WebhookPayload webhook) + { + // Handle webhook event + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/README.md new file mode 100644 index 000000000..d8dc5ab5c --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/README.md @@ -0,0 +1,73 @@ +# LINGYUN.Abp.Webhooks + +Webhook基础模块,提供Webhook的基本定义和功能。 + +[English](README.EN.md) + +## 功能特性 + +* 基本Webhook定义 +* Webhook发布和订阅 +* Webhook事件数据处理 +* Webhook配置管理 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 基本用法 + +1. 定义Webhook +```csharp +public class YourWebhookDefinitionProvider : WebhookDefinitionProvider +{ + public override void Define(IWebhookDefinitionContext context) + { + context.Add( + new WebhookDefinition( + name: "YourWebhook", + displayName: L("DisplayName:YourWebhook"), + description: L("Description:YourWebhook") + ) + ); + } +} +``` + +2. 发布Webhook +```csharp +public class YourService +{ + private readonly IWebhookPublisher _webhookPublisher; + + public YourService(IWebhookPublisher webhookPublisher) + { + _webhookPublisher = webhookPublisher; + } + + public async Task PublishWebhook() + { + await _webhookPublisher.PublishAsync( + webhookName: "YourWebhook", + data: new { /* webhook data */ } + ); + } +} +``` + +3. 处理Webhook事件 +```csharp +public class YourWebhookHandler : IWebhookHandler, ITransientDependency +{ + public async Task HandleWebhookAsync(WebhookPayload webhook) + { + // 处理webhook事件 + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/README.EN.md new file mode 100644 index 000000000..acead8844 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/README.EN.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.WebhooksManagement.Application.Contracts + +Webhook management application service contracts module that defines application service interfaces and DTOs for webhook management. + +[简体中文](README.md) + +## Features + +* Webhook subscription service interfaces +* Webhook group service interfaces +* Webhook definition service interfaces +* Webhook log service interfaces +* Webhook permission definitions +* Webhook DTO definitions + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksManagementApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Service Interfaces + +* IWebhookSubscriptionAppService - Webhook subscription management service +* IWebhookGroupAppService - Webhook group management service +* IWebhookDefinitionAppService - Webhook definition management service +* IWebhookSendAttemptAppService - Webhook send attempt log service + +## Basic Usage + +1. Implement Webhook Subscription Service +```csharp +public class WebhookSubscriptionAppService : + ApplicationService, + IWebhookSubscriptionAppService +{ + public async Task CreateAsync( + WebhookSubscriptionCreateDto input) + { + // Implement subscription creation logic + } + + public async Task> GetListAsync( + WebhookSubscriptionGetListInput input) + { + // Implement subscription query logic + } +} +``` + +2. Use Webhook DTOs +```csharp +public class YourDto +{ + public WebhookSubscriptionDto Subscription { get; set; } + public WebhookGroupDto Group { get; set; } + public WebhookDefinitionDto Definition { get; set; } + public WebhookSendAttemptDto SendAttempt { get; set; } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/README.md new file mode 100644 index 000000000..ad0816e49 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/README.md @@ -0,0 +1,64 @@ +# LINGYUN.Abp.WebhooksManagement.Application.Contracts + +Webhook管理应用服务契约模块,定义Webhook管理的应用服务接口和DTO。 + +[English](README.EN.md) + +## 功能特性 + +* Webhook订阅服务接口 +* Webhook组服务接口 +* Webhook定义服务接口 +* Webhook日志服务接口 +* Webhook权限定义 +* Webhook DTO定义 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksManagementApplicationContractsModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 服务接口 + +* IWebhookSubscriptionAppService - Webhook订阅管理服务 +* IWebhookGroupAppService - Webhook组管理服务 +* IWebhookDefinitionAppService - Webhook定义管理服务 +* IWebhookSendAttemptAppService - Webhook发送日志服务 + +## 基本用法 + +1. 实现Webhook订阅服务 +```csharp +public class WebhookSubscriptionAppService : + ApplicationService, + IWebhookSubscriptionAppService +{ + public async Task CreateAsync( + WebhookSubscriptionCreateDto input) + { + // 实现创建订阅逻辑 + } + + public async Task> GetListAsync( + WebhookSubscriptionGetListInput input) + { + // 实现查询订阅逻辑 + } +} +``` + +2. 使用Webhook DTO +```csharp +public class YourDto +{ + public WebhookSubscriptionDto Subscription { get; set; } + public WebhookGroupDto Group { get; set; } + public WebhookDefinitionDto Definition { get; set; } + public WebhookSendAttemptDto SendAttempt { get; set; } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/README.EN.md new file mode 100644 index 000000000..4d2ccef13 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/README.EN.md @@ -0,0 +1,89 @@ +# LINGYUN.Abp.WebhooksManagement.Application + +Webhook management application service module that provides application layer implementation for webhook management. + +[简体中文](README.md) + +## Features + +* Webhook subscription management +* Webhook group management +* Webhook definition management +* Webhook log querying +* Webhook permission management + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksManagementApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Permission Definitions + +* WebhooksManagement.Webhooks + * WebhooksManagement.Webhooks.Create + * WebhooksManagement.Webhooks.Update + * WebhooksManagement.Webhooks.Delete + * WebhooksManagement.Webhooks.ManagePermissions +* WebhooksManagement.Groups + * WebhooksManagement.Groups.Create + * WebhooksManagement.Groups.Update + * WebhooksManagement.Groups.Delete +* WebhooksManagement.Subscriptions + * WebhooksManagement.Subscriptions.Create + * WebhooksManagement.Subscriptions.Update + * WebhooksManagement.Subscriptions.Delete +* WebhooksManagement.Logs + * WebhooksManagement.Logs.Default + +## Basic Usage + +1. Manage Webhook Subscriptions +```csharp +public class YourService +{ + private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService; + + public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService) + { + _webhookSubscriptionAppService = webhookSubscriptionAppService; + } + + public async Task ManageSubscription() + { + // Create subscription + await _webhookSubscriptionAppService.CreateAsync(new WebhookSubscriptionCreateDto + { + WebhookUri = "https://your-webhook-endpoint", + Webhooks = new[] { "YourWebhook" } + }); + + // Query subscriptions + var subscriptions = await _webhookSubscriptionAppService.GetListAsync( + new WebhookSubscriptionGetListInput()); + } +} +``` + +2. Query Webhook Logs +```csharp +public class YourService +{ + private readonly IWebhookSendAttemptAppService _webhookSendAttemptAppService; + + public YourService(IWebhookSendAttemptAppService webhookSendAttemptAppService) + { + _webhookSendAttemptAppService = webhookSendAttemptAppService; + } + + public async Task QueryLogs() + { + var logs = await _webhookSendAttemptAppService.GetListAsync( + new WebhookSendAttemptGetListInput()); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/README.md new file mode 100644 index 000000000..45f5fc6c3 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/README.md @@ -0,0 +1,89 @@ +# LINGYUN.Abp.WebhooksManagement.Application + +Webhook管理应用服务模块,提供Webhook管理的应用层实现。 + +[English](README.EN.md) + +## 功能特性 + +* Webhook订阅管理 +* Webhook组管理 +* Webhook定义管理 +* Webhook日志查询 +* Webhook权限管理 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksManagementApplicationModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 权限定义 + +* WebhooksManagement.Webhooks + * WebhooksManagement.Webhooks.Create + * WebhooksManagement.Webhooks.Update + * WebhooksManagement.Webhooks.Delete + * WebhooksManagement.Webhooks.ManagePermissions +* WebhooksManagement.Groups + * WebhooksManagement.Groups.Create + * WebhooksManagement.Groups.Update + * WebhooksManagement.Groups.Delete +* WebhooksManagement.Subscriptions + * WebhooksManagement.Subscriptions.Create + * WebhooksManagement.Subscriptions.Update + * WebhooksManagement.Subscriptions.Delete +* WebhooksManagement.Logs + * WebhooksManagement.Logs.Default + +## 基本用法 + +1. 管理Webhook订阅 +```csharp +public class YourService +{ + private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService; + + public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService) + { + _webhookSubscriptionAppService = webhookSubscriptionAppService; + } + + public async Task ManageSubscription() + { + // 创建订阅 + await _webhookSubscriptionAppService.CreateAsync(new WebhookSubscriptionCreateDto + { + WebhookUri = "https://your-webhook-endpoint", + Webhooks = new[] { "YourWebhook" } + }); + + // 查询订阅 + var subscriptions = await _webhookSubscriptionAppService.GetListAsync( + new WebhookSubscriptionGetListInput()); + } +} +``` + +2. 查询Webhook日志 +```csharp +public class YourService +{ + private readonly IWebhookSendAttemptAppService _webhookSendAttemptAppService; + + public YourService(IWebhookSendAttemptAppService webhookSendAttemptAppService) + { + _webhookSendAttemptAppService = webhookSendAttemptAppService; + } + + public async Task QueryLogs() + { + var logs = await _webhookSendAttemptAppService.GetListAsync( + new WebhookSendAttemptGetListInput()); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/README.EN.md new file mode 100644 index 000000000..439f43270 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/README.EN.md @@ -0,0 +1,67 @@ +# LINGYUN.Abp.WebhooksManagement.Dapr.Client + +Webhook management Dapr client integration module that provides integration with Dapr service invocation building block. + +[简体中文](README.md) + +## Features + +* Support for accessing webhook management service through Dapr service invocation +* Seamless integration with Dapr service invocation building block +* Support for distributed service invocation + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksManagementDaprClientModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WebhooksManagement": { + "Dapr": { + "AppId": "webhooks-management", // Dapr application ID for webhook management service + "HttpEndpoint": "http://localhost:3500" // Dapr sidecar HTTP endpoint + } + } +} +``` + +## Basic Usage + +1. Configure Dapr Client +```csharp +Configure(options => +{ + options.AppId = "webhooks-management"; + options.HttpEndpoint = "http://localhost:3500"; +}); +``` + +2. Use Webhook Management Client +```csharp +public class YourService +{ + private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService; + + public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService) + { + _webhookSubscriptionAppService = webhookSubscriptionAppService; + } + + public async Task SubscribeWebhook() + { + await _webhookSubscriptionAppService.SubscribeAsync(new WebhookSubscriptionCreateDto + { + WebhookUri = "https://your-webhook-endpoint", + Webhooks = new[] { "YourWebhook" } + }); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/README.md new file mode 100644 index 000000000..c7d06bfb1 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/README.md @@ -0,0 +1,67 @@ +# LINGYUN.Abp.WebhooksManagement.Dapr.Client + +Webhook管理Dapr客户端集成模块,提供与Dapr服务调用构建块的集成支持。 + +[English](README.EN.md) + +## 功能特性 + +* 支持通过Dapr服务调用访问Webhook管理服务 +* 与Dapr服务调用构建块无缝集成 +* 支持分布式服务调用 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksManagementDaprClientModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WebhooksManagement": { + "Dapr": { + "AppId": "webhooks-management", // Webhook管理服务的Dapr应用ID + "HttpEndpoint": "http://localhost:3500" // Dapr sidecar HTTP端点 + } + } +} +``` + +## 基本用法 + +1. 配置Dapr客户端 +```csharp +Configure(options => +{ + options.AppId = "webhooks-management"; + options.HttpEndpoint = "http://localhost:3500"; +}); +``` + +2. 使用Webhook管理客户端 +```csharp +public class YourService +{ + private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService; + + public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService) + { + _webhookSubscriptionAppService = webhookSubscriptionAppService; + } + + public async Task SubscribeWebhook() + { + await _webhookSubscriptionAppService.SubscribeAsync(new WebhookSubscriptionCreateDto + { + WebhookUri = "https://your-webhook-endpoint", + Webhooks = new[] { "YourWebhook" } + }); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/README.EN.md new file mode 100644 index 000000000..b39a2f2f6 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/README.EN.md @@ -0,0 +1,67 @@ +# LINGYUN.Abp.WebhooksManagement.Domain + +Webhook management domain module that provides webhook storage and management functionality. + +[简体中文](README.md) + +## Features + +* Support for storing static webhooks in database +* Support for dynamic webhook storage +* Webhook cache management +* Timestamp expiration mechanism + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksManagementDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "WebhooksManagement": { + "SaveStaticWebhooksToDatabase": true, // Whether to save static webhooks to database, default true + "IsDynamicWebhookStoreEnabled": false, // Whether to enable dynamic webhook storage, default false + "WebhooksCacheRefreshInterval": "00:00:30", // Cache refresh interval, default 30 seconds + "WebhooksCacheStampTimeOut": "00:02:00", // Timestamp request timeout, default 2 minutes + "WebhooksCacheStampExpiration": "00:30:00" // Timestamp expiration time, default 30 minutes + } +} +``` + +## Basic Usage + +1. Configure Webhook Management Options +```csharp +Configure(options => +{ + options.SaveStaticWebhooksToDatabase = true; + options.IsDynamicWebhookStoreEnabled = true; + options.WebhooksCacheRefreshInterval = TimeSpan.FromMinutes(1); +}); +``` + +2. Using Webhook Storage +```csharp +public class YourService +{ + private readonly IWebhookDefinitionManager _webhookDefinitionManager; + + public YourService(IWebhookDefinitionManager webhookDefinitionManager) + { + _webhookDefinitionManager = webhookDefinitionManager; + } + + public async Task DoSomething() + { + var webhooks = await _webhookDefinitionManager.GetAllAsync(); + // Process webhooks + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/README.md new file mode 100644 index 000000000..db0dd1999 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/README.md @@ -0,0 +1,67 @@ +# LINGYUN.Abp.WebhooksManagement.Domain + +Webhook管理领域模块,提供Webhook的存储和管理功能。 + +[English](README.EN.md) + +## 功能特性 + +* 支持静态Webhook存储到数据库 +* 支持动态Webhook存储 +* Webhook缓存管理 +* 时间戳过期机制 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksManagementDomainModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "WebhooksManagement": { + "SaveStaticWebhooksToDatabase": true, // 是否保存静态Webhook到数据库,默认true + "IsDynamicWebhookStoreEnabled": false, // 是否启用动态Webhook存储,默认false + "WebhooksCacheRefreshInterval": "00:00:30", // 缓存刷新时间,默认30秒 + "WebhooksCacheStampTimeOut": "00:02:00", // 申请时间戳超时时间,默认2分钟 + "WebhooksCacheStampExpiration": "00:30:00" // 时间戳过期时间,默认30分钟 + } +} +``` + +## 基本用法 + +1. 配置Webhook管理选项 +```csharp +Configure(options => +{ + options.SaveStaticWebhooksToDatabase = true; + options.IsDynamicWebhookStoreEnabled = true; + options.WebhooksCacheRefreshInterval = TimeSpan.FromMinutes(1); +}); +``` + +2. 使用Webhook存储 +```csharp +public class YourService +{ + private readonly IWebhookDefinitionManager _webhookDefinitionManager; + + public YourService(IWebhookDefinitionManager webhookDefinitionManager) + { + _webhookDefinitionManager = webhookDefinitionManager; + } + + public async Task DoSomething() + { + var webhooks = await _webhookDefinitionManager.GetAllAsync(); + // 处理webhook + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/README.EN.md new file mode 100644 index 000000000..e7a9413c4 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/README.EN.md @@ -0,0 +1,77 @@ +# LINGYUN.Abp.WebhooksManagement.HttpApi.Client + +Webhook management HTTP API client module that provides dynamic proxy client for webhook management HTTP API. + +[简体中文](README.md) + +## Features + +* Dynamic API client proxy +* Automatic HTTP client configuration +* Support for remote service calls +* Integration with ABP dynamic C# API client + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksManagementHttpApiClientModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration + +```json +{ + "RemoteServices": { + "WebhooksManagement": { + "BaseUrl": "http://localhost:44315/" // Base URL for webhook management service + } + } +} +``` + +## Basic Usage + +1. Configure Remote Service +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.RemoteServices.Default = new RemoteServiceConfiguration( + configuration["RemoteServices:WebhooksManagement:BaseUrl"]); + }); +} +``` + +2. Use HTTP Client +```csharp +public class YourService +{ + private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService; + + public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService) + { + _webhookSubscriptionAppService = webhookSubscriptionAppService; + } + + public async Task CallRemoteApi() + { + // Create subscription + await _webhookSubscriptionAppService.CreateAsync(new WebhookSubscriptionCreateDto + { + WebhookUri = "https://your-webhook-endpoint", + Webhooks = new[] { "YourWebhook" } + }); + + // Query subscriptions + var subscriptions = await _webhookSubscriptionAppService.GetListAsync( + new WebhookSubscriptionGetListInput()); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/README.md new file mode 100644 index 000000000..1d636a2c5 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/README.md @@ -0,0 +1,77 @@ +# LINGYUN.Abp.WebhooksManagement.HttpApi.Client + +Webhook管理HTTP API客户端模块,提供对Webhook管理HTTP API的动态代理客户端。 + +[English](README.EN.md) + +## 功能特性 + +* 动态API客户端代理 +* 自动HTTP客户端配置 +* 支持远程服务调用 +* 集成ABP动态C# API客户端 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksManagementHttpApiClientModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## 配置项 + +```json +{ + "RemoteServices": { + "WebhooksManagement": { + "BaseUrl": "http://localhost:44315/" // Webhook管理服务的基础URL + } + } +} +``` + +## 基本用法 + +1. 配置远程服务 +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.RemoteServices.Default = new RemoteServiceConfiguration( + configuration["RemoteServices:WebhooksManagement:BaseUrl"]); + }); +} +``` + +2. 使用HTTP客户端 +```csharp +public class YourService +{ + private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService; + + public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService) + { + _webhookSubscriptionAppService = webhookSubscriptionAppService; + } + + public async Task CallRemoteApi() + { + // 创建订阅 + await _webhookSubscriptionAppService.CreateAsync(new WebhookSubscriptionCreateDto + { + WebhookUri = "https://your-webhook-endpoint", + Webhooks = new[] { "YourWebhook" } + }); + + // 查询订阅 + var subscriptions = await _webhookSubscriptionAppService.GetListAsync( + new WebhookSubscriptionGetListInput()); + } +} +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/README.EN.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/README.EN.md new file mode 100644 index 000000000..a360d3667 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/README.EN.md @@ -0,0 +1,65 @@ +# LINGYUN.Abp.WebhooksManagement.HttpApi + +Webhook management HTTP API module that provides REST API interfaces for webhook management. + +[简体中文](README.md) + +## Features + +* Webhook subscription REST API +* Webhook group REST API +* Webhook definition REST API +* Webhook log REST API +* Automatic API routing +* API permission control + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpWebhooksManagementHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API Routes + +* /api/webhooks-management/subscriptions - Webhook subscription management +* /api/webhooks-management/groups - Webhook group management +* /api/webhooks-management/definitions - Webhook definition management +* /api/webhooks-management/logs - Webhook log querying + +## Basic Usage + +1. Configure API Routing +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.ConventionalControllers.Create( + typeof(AbpWebhooksManagementHttpApiModule).Assembly, + opts => + { + opts.RootPath = "webhooks-management"; + }); + }); +} +``` + +2. API Call Examples +```http +### Create Webhook Subscription +POST /api/webhooks-management/subscriptions +{ + "webhookUri": "https://your-webhook-endpoint", + "webhooks": ["YourWebhook"] +} + +### Query Webhook Subscriptions +GET /api/webhooks-management/subscriptions?maxResultCount=10&skipCount=0 + +### Query Webhook Logs +GET /api/webhooks-management/logs?maxResultCount=10&skipCount=0 +``` diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/README.md b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/README.md new file mode 100644 index 000000000..1818a5849 --- /dev/null +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/README.md @@ -0,0 +1,65 @@ +# LINGYUN.Abp.WebhooksManagement.HttpApi + +Webhook管理HTTP API模块,提供Webhook管理的REST API接口。 + +[English](README.EN.md) + +## 功能特性 + +* Webhook订阅REST API +* Webhook组REST API +* Webhook定义REST API +* Webhook日志REST API +* 自动API路由 +* API权限控制 + +## 模块引用 + +```csharp +[DependsOn(typeof(AbpWebhooksManagementHttpApiModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## API路由 + +* /api/webhooks-management/subscriptions - Webhook订阅管理 +* /api/webhooks-management/groups - Webhook组管理 +* /api/webhooks-management/definitions - Webhook定义管理 +* /api/webhooks-management/logs - Webhook日志查询 + +## 基本用法 + +1. 配置API路由 +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + options.ConventionalControllers.Create( + typeof(AbpWebhooksManagementHttpApiModule).Assembly, + opts => + { + opts.RootPath = "webhooks-management"; + }); + }); +} +``` + +2. 调用API示例 +```http +### 创建Webhook订阅 +POST /api/webhooks-management/subscriptions +{ + "webhookUri": "https://your-webhook-endpoint", + "webhooks": ["YourWebhook"] +} + +### 查询Webhook订阅 +GET /api/webhooks-management/subscriptions?maxResultCount=10&skipCount=0 + +### 查询Webhook日志 +GET /api/webhooks-management/logs?maxResultCount=10&skipCount=0 +``` diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json deleted file mode 100644 index cf15e11f7..000000000 --- a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json +++ /dev/null @@ -1,246 +0,0 @@ -{ - "App": { - "ShowPii": true, - "SelfUrl": "http://127.0.0.1:30001/", - "CorsOrigins": "http://127.0.0.1:3100,http://127.0.0.1:30001", - "Urls": { - "Applications": { - "MVC": { - "RootUrl": "http://127.0.0.1:30001/", - "Urls": { - "Abp.Account.EmailConfirm": "Account/EmailConfirm", - "Abp.Account.EmailVerifyLogin": "Account/VerifyCode" - } - }, - "STS": { - "RootUrl": "http://127.0.0.1:30001/" - }, - "VueVbenAdmin": { - "RootUrl": "http://127.0.0.1:3100", - "Urls": { - "Abp.Account.EmailConfirm": "account/email-confirm" - } - } - } - } - }, - "Auditing": { - "AllEntitiesSelector": true - }, - "DistributedCache": { - "HideErrors": true, - "KeyPrefix": "LINGYUN.Abp.Application", - "GlobalCacheEntryOptions": { - "SlidingExpiration": "30:00:00", - "AbsoluteExpirationRelativeToNow": "60:00:00" - } - }, - "ConnectionStrings": { - "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer" - }, - "DistributedLock": { - "IsEnabled": true, - "Redis": { - "Configuration": "127.0.0.1,defaultDatabase=14" - } - }, - "Elsa": { - "Features": { - "DefaultPersistence": { - "Enabled": false, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "PostgreSql": { - "Enabled": true - } - } - }, - "Console": true, - "Http": true, - "Email": true, - "TemporalQuartz": true, - "JavaScriptActivities": true, - "UserTask": true, - "Conductor": true, - "Telnyx": true, - "BlobStoring": true, - "Emailing": true, - "Notification": true, - "Sms": true, - "IM": true, - "PublishWebhook": true, - "Webhooks": { - "Enabled": false, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "PostgreSql": { - "Enabled": true - } - } - }, - "WorkflowSettings": { - "Enabled": false, - "ConnectionStringIdentifier": "Default", - "EntityFrameworkCore": { - "PostgreSql": { - "Enabled": true - } - } - } - }, - "Server": { - "BaseUrl": "http://127.0.0.1:30000" - } - }, - "Quartz": { - "UsePersistentStore": false, - "Properties": { - "quartz.jobStore.dataSource": "tkm", - "quartz.jobStore.useProperties": "true", - "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX,Quartz", - "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate,Quartz", - "quartz.dataSource.tkm.connectionString": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer", - "quartz.dataSource.tkm.provider": "Npgsql", - "quartz.dataSource.tkm.connectionStringName": "Default", - "quartz.jobStore.clustered": "true", - "quartz.serializer.type": "json" - } - }, - "Redis": { - "IsEnabled": true, - "Configuration": "127.0.0.1,defaultDatabase=15", - "InstanceName": "LINGYUN.Abp.Application" - }, - "Features": { - "Validation": { - "Redis": { - "Configuration": "127.0.0.1,defaultDatabase=13", - "InstanceName": "LINGYUN.Abp.Application" - } - } - }, - "AuthServer": { - "UseOpenIddict": true, - "Authority": "http://127.0.0.1:30001/", - "Audience": "lingyun-abp-application", - "RequireHttpsMetadata": false, - "SwaggerClientId": "InternalServiceClient", - "SwaggerClientSecret": "1q2w3E*" - }, - "IdentityServer": { - "Clients": { - "VueAdmin": { - "ClientId": "vue-admin-client", - "RootUrl": "http://127.0.0.1:3100/" - }, - "InternalService": { - "ClientId": "InternalServiceClient" - } - } - }, - "OpenIddict": { - "Applications": { - "VueAdmin": { - "ClientId": "vue-admin-client", - "RootUrl": "http://127.0.0.1:3100/" - }, - "InternalService": { - "ClientId": "InternalServiceClient" - } - }, - "Lifetime": { - "AuthorizationCode": "00:05:00", - "AccessToken": "14:00:00", - "DeviceCode": "00:10:00", - "IdentityToken": "00:20:00", - "RefreshToken": "14:00:00", - "RefreshTokenReuseLeeway": "00:00:30", - "UserCode": "00:10:00" - } - }, - "Identity": { - "Password": { - "RequiredLength": 6, - "RequiredUniqueChars": 0, - "RequireNonAlphanumeric": false, - "RequireLowercase": false, - "RequireUppercase": false, - "RequireDigit": false - }, - "Lockout": { - "AllowedForNewUsers": false, - "LockoutDuration": 5, - "MaxFailedAccessAttempts": 5 - }, - "SignIn": { - "RequireConfirmedEmail": false, - "RequireConfirmedPhoneNumber": false - } - }, - "FeatureManagement": { - "IsDynamicStoreEnabled": true - }, - "SettingManagement": { - "IsDynamicStoreEnabled": true - }, - "PermissionManagement": { - "IsDynamicStoreEnabled": true - }, - "TextTemplating": { - "IsDynamicStoreEnabled": true - }, - "WebhooksManagement": { - "IsDynamicStoreEnabled": true - }, - "Logging": { - "Serilog": { - "Elasticsearch": { - "IndexFormat": "abp.dev.logging-{0:yyyy.MM.dd}" - } - } - }, - "AuditLogging": { - "Elasticsearch": { - "IndexPrefix": "abp.dev.auditing" - } - }, - "Elasticsearch": { - "NodeUris": "http://127.0.0.1:9200" - }, - "Minio": { - "WithSSL": false, - "BucketName": "blobs", - "EndPoint": "127.0.0.1:19000", - "AccessKey": "ZD43kNpimiJf9mCuomTP", - "SecretKey": "w8IqMgi4Tnz0DGzN8jZ7IJWq7OEdbUnAU0jlZxQK", - "CreateBucketIfNotExists": false - }, - "Serilog": { - "MinimumLevel": { - "Default": "Information", - "Override": { - "System": "Warning", - "Microsoft": "Warning", - "DotNetCore": "Warning" - } - }, - "WriteTo": [ - { - "Name": "Console", - "Args": { - "restrictedToMinimumLevel": "Debug", - "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" - } - }, - { - "Name": "Elasticsearch", - "Args": { - "nodeUris": "http://127.0.0.1:9200", - "indexFormat": "abp.dev.logging-{0:yyyy.MM.dd}", - "autoRegisterTemplate": true, - "autoRegisterTemplateVersion": "ESv7" - } - } - ] - } -} diff --git a/common.props b/common.props index 9af819310..119cc175a 100644 --- a/common.props +++ b/common.props @@ -11,7 +11,6 @@ git https://github.com/colinin/abp-next-admin true - Debug;Release @@ -36,9 +35,4 @@ $(SolutionDir)LocalNuget - - POSTGRESQL - $(SolutionDir)LocalNuget - - \ No newline at end of file