From 9e9a41f9fce91e852d012b0db5f56c81c0fcc5ad Mon Sep 17 00:00:00 2001 From: feijie Date: Fri, 13 Dec 2024 21:14:59 +0800 Subject: [PATCH 001/170] =?UTF-8?q?=E2=9C=A8=20feat(README):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20LINGYUN.Abp.Aliyun=20=E5=92=8C=20LINGYUN.Abp.Tencen?= =?UTF-8?q?t=20=E6=A8=A1=E5=9D=97=E7=9A=84=E6=96=87=E6=A1=A3=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E4=B8=8E=E5=8A=9F=E8=83=BD=E6=A6=82=E8=BF=B0=E3=80=82?= =?UTF-8?q?=20=E2=9C=A8=20feat(README):=20=E6=96=B0=E5=A2=9E=20common=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9A=84=E5=9F=BA=E7=A1=80=E4=BB=8B=E7=BB=8D?= =?UTF-8?q?=E4=B8=8E=E5=8C=85=E5=90=AB=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aspnet-core/framework/cloud-aliyun/README.md | 33 +++++++++++ aspnet-core/framework/cloud-tencent/README.md | 42 +++++++++++++ aspnet-core/framework/common/README.md | 59 +++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 aspnet-core/framework/cloud-aliyun/README.md create mode 100644 aspnet-core/framework/cloud-tencent/README.md create mode 100644 aspnet-core/framework/common/README.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/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/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。 From b5c990cf737aab0a14772401c0c66dd8e07a1a24 Mon Sep 17 00:00:00 2001 From: feijie Date: Fri, 13 Dec 2024 21:16:01 +0800 Subject: [PATCH 002/170] =?UTF-8?q?=F0=9F=93=9A=20docs:=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E4=BD=93=E6=9C=8D=E5=8A=A1=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=8C=87=E5=8D=97=E6=96=87=E6=A1=A3=EF=BC=8C=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E8=AF=A6=E7=BB=86=E7=9A=84=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=92=8C=E6=95=B0=E6=8D=AE=E5=BA=93=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LINGYUN.MicroService.SingleProject.sln | 5 +- .../appsettings.json | 3 +- .../SingleDbMigrationService.cs | 200 +++++----- docs/startup-aio-readme.en.md | 348 ++++++++++++++++++ docs/startup-aio-readme.md | 348 ++++++++++++++++++ 5 files changed, 801 insertions(+), 103 deletions(-) create mode 100644 docs/startup-aio-readme.en.md create mode 100644 docs/startup-aio-readme.md diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.sln b/aspnet-core/LINGYUN.MicroService.SingleProject.sln index 2f5af7160..219e3f2f7 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.sln +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.sln @@ -428,6 +428,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\NuGet.Config = ..\NuGet.Config ..\README.en.md = ..\README.en.md ..\README.md = ..\README.md + ..\docs\startup-aio-readme.md = ..\docs\startup-aio-readme.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dapr", "dapr", "{FD9F5933-FDE5-4504-99BF-9050E0435C6D}" @@ -1288,10 +1289,10 @@ Global {F94E77C1-61E0-4FE8-9ECD-10A0102342E9}.Debug|Any CPU.Build.0 = Debug|Any CPU {F94E77C1-61E0-4FE8-9ECD-10A0102342E9}.Release|Any CPU.ActiveCfg = Release|Any CPU {F94E77C1-61E0-4FE8-9ECD-10A0102342E9}.Release|Any CPU.Build.0 = Release|Any CPU - {83D2F8F2-82C7-4919-9B65-D0FBF0B5324C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83D2F8F2-82C7-4919-9B65-D0FBF0B5324C}.Release|Any CPU.Build.0 = Release|Any CPU {83D2F8F2-82C7-4919-9B65-D0FBF0B5324C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {83D2F8F2-82C7-4919-9B65-D0FBF0B5324C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83D2F8F2-82C7-4919-9B65-D0FBF0B5324C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83D2F8F2-82C7-4919-9B65-D0FBF0B5324C}.Release|Any CPU.Build.0 = Release|Any CPU {CAEF3248-527D-48B7-9C98-929AC573C381}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CAEF3248-527D-48B7-9C98-929AC573C381}.Debug|Any CPU.Build.0 = Debug|Any CPU {CAEF3248-527D-48B7-9C98-929AC573C381}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json index 2b17de592..daded80e0 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json @@ -3,7 +3,8 @@ "Kind": "Local" }, "ConnectionStrings": { - "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" + // "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"//MySql + "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer"//PostgreSql }, "StringEncryption": { "DefaultPassPhrase": "s46c5q55nxpeS8Ra", diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationService.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationService.cs index a02a8e3aa..1247b3499 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationService.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationService.cs @@ -1,101 +1,101 @@ -using LINGYUN.Abp.Saas.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using System; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.DistributedLocking; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.Migrations; -using Volo.Abp.EventBus.Distributed; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Uow; - -namespace LY.MicroService.Applications.Single.EntityFrameworkCore; - -public class SingleDbMigrationService : EfCoreRuntimeDatabaseMigratorBase, ITransientDependency -{ - protected IDataSeeder DataSeeder { get; } - protected ITenantRepository TenantRepository { get; } - public SingleDbMigrationService( - IUnitOfWorkManager unitOfWorkManager, - IServiceProvider serviceProvider, - ICurrentTenant currentTenant, - IAbpDistributedLock abpDistributedLock, - IDistributedEventBus distributedEventBus, - ILoggerFactory loggerFactory, - IDataSeeder dataSeeder, - ITenantRepository tenantRepository) - : base("SingleDbMigrator", unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory) - { - DataSeeder = dataSeeder; - TenantRepository = tenantRepository; - } - protected async override Task LockAndApplyDatabaseMigrationsAsync() - { - await base.LockAndApplyDatabaseMigrationsAsync(); - - var tenants = await TenantRepository.GetListAsync(); - foreach (var tenant in tenants.Where(x => x.IsActive)) - { - Logger.LogInformation($"Trying to acquire the distributed lock for database migration: {DatabaseName} with tenant: {tenant.Name}."); - - var schemaMigrated = false; - - await using (var handle = await DistributedLock.TryAcquireAsync("DatabaseMigration_" + DatabaseName + "_Tenant" + tenant.Id.ToString())) - { - if (handle is null) - { - Logger.LogInformation($"Distributed lock could not be acquired for database migration: {DatabaseName} with tenant: {tenant.Name}. Operation cancelled."); - return; - } - - Logger.LogInformation($"Distributed lock is acquired for database migration: {DatabaseName} with tenant: {tenant.Name}..."); - - using (CurrentTenant.Change(tenant.Id)) - { - // Create database tables if needed - using var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: false); - var dbContext = await ServiceProvider - .GetRequiredService>() - .GetDbContextAsync(); - - var pendingMigrations = await dbContext - .Database - .GetPendingMigrationsAsync(); - - if (pendingMigrations.Any()) - { - await dbContext.Database.MigrateAsync(); - schemaMigrated = true; - } - - await uow.CompleteAsync(); - - await SeedAsync(); - - if (schemaMigrated || AlwaysSeedTenantDatabases) - { - await DistributedEventBus.PublishAsync( - new AppliedDatabaseMigrationsEto - { - DatabaseName = DatabaseName, - TenantId = tenant.Id - } - ); - } - } - } - - Logger.LogInformation($"Distributed lock has been released for database migration: {DatabaseName} with tenant: {tenant.Name}..."); - } - } - - protected async override Task SeedAsync() - { - await DataSeeder.SeedAsync(CurrentTenant.Id); - } +using LINGYUN.Abp.Saas.Tenants; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.DistributedLocking; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Migrations; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Uow; + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore; + +public class SingleDbMigrationService : EfCoreRuntimeDatabaseMigratorBase, ITransientDependency +{ + protected IDataSeeder DataSeeder { get; } + protected ITenantRepository TenantRepository { get; } + public SingleDbMigrationService( + IUnitOfWorkManager unitOfWorkManager, + IServiceProvider serviceProvider, + ICurrentTenant currentTenant, + IAbpDistributedLock abpDistributedLock, + IDistributedEventBus distributedEventBus, + ILoggerFactory loggerFactory, + IDataSeeder dataSeeder, + ITenantRepository tenantRepository) + : base("SingleDbMigrator", unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory) + { + DataSeeder = dataSeeder; + TenantRepository = tenantRepository; + } + protected async override Task LockAndApplyDatabaseMigrationsAsync() + { + await base.LockAndApplyDatabaseMigrationsAsync(); + + var tenants = await TenantRepository.GetListAsync(); + foreach (var tenant in tenants.Where(x => x.IsActive)) + { + Logger.LogInformation($"Trying to acquire the distributed lock for database migration: {DatabaseName} with tenant: {tenant.Name}."); + + var schemaMigrated = false; + + await using (var handle = await DistributedLock.TryAcquireAsync("DatabaseMigration_" + DatabaseName + "_Tenant" + tenant.Id.ToString())) + { + if (handle is null) + { + Logger.LogInformation($"Distributed lock could not be acquired for database migration: {DatabaseName} with tenant: {tenant.Name}. Operation cancelled."); + return; + } + + Logger.LogInformation($"Distributed lock is acquired for database migration: {DatabaseName} with tenant: {tenant.Name}..."); + + using (CurrentTenant.Change(tenant.Id)) + { + // Create database tables if needed + using var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: false); + var dbContext = await ServiceProvider + .GetRequiredService>() + .GetDbContextAsync(); + + var pendingMigrations = await dbContext + .Database + .GetPendingMigrationsAsync(); + + if (pendingMigrations.Any()) + { + await dbContext.Database.MigrateAsync(); + schemaMigrated = true; + } + + await uow.CompleteAsync(); + + await SeedAsync(); + + if (schemaMigrated || AlwaysSeedTenantDatabases) + { + await DistributedEventBus.PublishAsync( + new AppliedDatabaseMigrationsEto + { + DatabaseName = DatabaseName, + TenantId = tenant.Id + } + ); + } + } + } + + Logger.LogInformation($"Distributed lock has been released for database migration: {DatabaseName} with tenant: {tenant.Name}..."); + } + } + + protected async override Task SeedAsync() + { + await DataSeeder.SeedAsync(CurrentTenant.Id); + } } \ No newline at end of file diff --git a/docs/startup-aio-readme.en.md b/docs/startup-aio-readme.en.md new file mode 100644 index 000000000..baa9bb741 --- /dev/null +++ b/docs/startup-aio-readme.en.md @@ -0,0 +1,348 @@ +# Monolithic Service Startup Guide + +English | [简体中文](startup-aio-readme.md) + +## Table of Contents + +- [Requirements](#requirements) +- [Project Compilation](#project-compilation) +- [Environment Configuration](#environment-configuration) + - [Required Configuration](#required-configuration) + - [Optional Configuration](#optional-configuration) +- [Database Initialization](#database-initialization) +- [Service Startup](#service-startup) +- [Configuration Details](#configuration-details) + +## Requirements + +- .NET 8.0 SDK +- Database (support any of the following): + - PostgreSQL + - MySQL + - SQL Server (coming soon) +- Redis +- Docker (optional) + +## Project Compilation + +1. Ensure .NET 8.0 SDK is installed +2. Execute the following command in the project root directory to compile the entire project: + +```shell +./build/build-aspnetcore-release.ps1 +``` + +3. Open the `LY.MicroService.Applications.Single` solution in your IDE for debugging or publishing + +## Environment Configuration + +### Required Configuration + +#### 1. Database Configuration + +Multiple databases are supported. Here are configuration examples for each: + +##### PostgreSQL + +```shell +# Start PostgreSQL using Docker +docker run -d --name postgres \ + -p 5432:5432 \ + -e POSTGRES_PASSWORD=postgres \ + -e PGDATA=/var/lib/postgresql/data \ + postgres:latest +``` + +##### MySQL + +```shell +# Start MySQL using Docker +docker run -d --name mysql \ + -p 3306:3306 \ + -e MYSQL_ROOT_PASSWORD=mysql \ + mysql:latest +``` + +Create database: + +```sql +CREATE DATABASE `Platform-V70`; +``` + +##### SQL Server (coming soon) + +```shell +# Start SQL Server using Docker +docker run -d --name sqlserver \ + -p 1433:1433 \ + -e "ACCEPT_EULA=Y" \ + -e "SA_PASSWORD=yourStrong(!)Password" \ + mcr.microsoft.com/mssql/server:latest +``` + +#### 2. Configuration File Modification + +Modify the database connection strings in the following configuration files according to your chosen database: + +- `migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json` +- `LY.MicroService.Applications.Single/appsettings.Development.json` + +Database connection string examples: + +PostgreSQL: + +```json +{ + "ConnectionStrings": { + "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;" + } +} +``` + +MySQL: + +```json +{ + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" + } +} +``` + +SQL Server (coming soon): + +```json +{ + "ConnectionStrings": { + "Default": "Server=localhost,1433;Database=Platform-V70;User Id=sa;Password=yourStrong(!)Password;TrustServerCertificate=True" + } +} +``` + +#### 3. Redis Service + +```shell +# Start Redis using Docker +docker run -d --name redis -p 6379:6379 redis:latest +``` + +Redis configuration example: + +```json +{ + "DistributedLock": { + "IsEnabled": true, + "Redis": { + "Configuration": "127.0.0.1,defaultDatabase=14" + } + }, + "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" + } + } + } +} +``` + +### Optional Configuration + +The following configurations are applicable for monolithic distributed architecture: + +#### 1. MinIO Distributed File Storage + +```json +{ + "Minio": { + "WithSSL": false, + "BucketName": "blobs", + "EndPoint": "127.0.0.1:19000", + "AccessKey": "{AccessKey}", + "SecretKey": "{SecretKey}", + "CreateBucketIfNotExists": false + } +} +``` + +#### 2. Elasticsearch Distributed Audit Logging + +```json +{ + "Elasticsearch": { + "NodeUris": "http://127.0.0.1:9200" + } +} +``` + +## Database Initialization + +1. Run database migration script: + +Option 1 (Recommended): + +```shell +./aspnet-core/migrations/Migrate.ps1 +``` + +Follow the command line prompts to generate migration files and SQL scripts, then execute the SQL scripts to create database tables + +Option 2: +Taking PostgreSQL as an example: + +- Modify database connection information in `LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json` +- Navigate to `LY.MicroService.Applications.Single.EntityFrameworkCore.PostgreSql` project +- Run `dotnet ef database update` +- Wait for migration completion + +2. Configure data initialization: + + - Modify database connection information in `LY.MicroService.Applications.Single.DbMigrator/appsettings.json` + - Ensure the correct database provider is selected + +3. Execute data migration: + - Run the `LY.MicroService.Applications.Single.DbMigrator` project + - Wait for migration to complete, basic table data will be initialized + +## Service Startup + +1. Run the `LY.MicroService.Applications.Single` project +2. Access Swagger API documentation in your browser: + - URL: http://127.0.0.1:30000/swagger + +## Configuration Details + +### 1. Basic Configuration + +#### Application Configuration + +```json +{ + "App": { + "ShowPii": true, + "SelfUrl": "http://127.0.0.1:30001/", + "CorsOrigins": "http://127.0.0.1:3100,http://127.0.0.1:30001" + } +} +``` + +#### Distributed Cache Configuration + +```json +{ + "DistributedCache": { + "HideErrors": true, + "KeyPrefix": "LINGYUN.Abp.Application", + "GlobalCacheEntryOptions": { + "SlidingExpiration": "30:00:00", + "AbsoluteExpirationRelativeToNow": "60:00:00" + } + } +} +``` + +### 2. Authentication Configuration + +#### OpenIddict Configuration + +```json +{ + "OpenIddict": { + "Applications": { + "VueAdmin": { + "ClientId": "vue-admin-client", + "RootUrl": "http://127.0.0.1:3100/" + } + }, + "Lifetime": { + "AccessToken": "14:00:00", + "IdentityToken": "00:20:00", + "RefreshToken": "14:00:00" + } + } +} +``` + +#### Identity Authentication Configuration + +```json +{ + "Identity": { + "Password": { + "RequiredLength": 6, + "RequireNonAlphanumeric": false, + "RequireLowercase": false, + "RequireUppercase": false, + "RequireDigit": false + }, + "Lockout": { + "AllowedForNewUsers": false, + "LockoutDuration": 5, + "MaxFailedAccessAttempts": 5 + }, + "SignIn": { + "RequireConfirmedEmail": false, + "RequireConfirmedPhoneNumber": false + } + } +} +``` + +### 3. Feature Management Configuration + +```json +{ + "FeatureManagement": { + "IsDynamicStoreEnabled": true + }, + "SettingManagement": { + "IsDynamicStoreEnabled": true + }, + "PermissionManagement": { + "IsDynamicStoreEnabled": true + } +} +``` + +### 4. Logging Configuration + +```json +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning" + } + }, + "WriteTo": [ + { + "Name": "File", + "Args": { + "path": "Logs/Info-.log", + "rollingInterval": "Day" + } + } + ] + } +} +``` + +## Common Issues + +If you encounter problems, please check: + +1. Database connection string is correct +2. Correct database provider is selected +3. Redis connection is working +4. Required ports are not occupied +5. Database migration completed successfully +6. Authentication server configuration is correct +7. CORS configuration is correct (if frontend access has cross-origin issues) diff --git a/docs/startup-aio-readme.md b/docs/startup-aio-readme.md new file mode 100644 index 000000000..3f1feb0c9 --- /dev/null +++ b/docs/startup-aio-readme.md @@ -0,0 +1,348 @@ +# 单体服务启动指南 + +[English](startup-aio-readme.en.md) | 简体中文 + +## 目录 + +- [环境要求](#环境要求) +- [项目编译](#项目编译) +- [环境配置](#环境配置) + - [必选配置](#必选配置) + - [可选配置](#可选配置) +- [数据库初始化](#数据库初始化) +- [服务启动](#服务启动) +- [配置说明](#配置说明) + +## 环境要求 + +- .NET 8.0 SDK +- 数据库(支持以下任一种): + - PostgreSQL + - MySQL + - SQL Server(即将支持) +- Redis +- Docker(可选) + +## 项目编译 + +1. 确保已安装 .NET 8.0 SDK +2. 在项目根目录执行以下命令编译整个项目: + +```shell +./build/build-aspnetcore-release.ps1 +``` + +3. 使用 IDE 打开 `LY.MicroService.Applications.Single` 解决方案进行调试或发布 + +## 环境配置 + +### 必选配置 + +#### 1. 数据库配置 + +支持多种数据库,以下是各种数据库的配置示例: + +##### PostgreSQL + +```shell +# 使用Docker启动PostgreSQL +docker run -d --name postgres \ + -p 5432:5432 \ + -e POSTGRES_PASSWORD=postgres \ + -e PGDATA=/var/lib/postgresql/data \ + postgres:latest +``` + +##### MySQL + +```shell +# 使用Docker启动MySQL +docker run -d --name mysql \ + -p 3306:3306 \ + -e MYSQL_ROOT_PASSWORD=mysql \ + mysql:latest +``` + +创建数据库: + +```sql +CREATE DATABASE `Platform-V70`; +``` + +##### SQL Server(即将支持) + +```shell +# 使用Docker启动SQL Server +docker run -d --name sqlserver \ + -p 1433:1433 \ + -e "ACCEPT_EULA=Y" \ + -e "SA_PASSWORD=yourStrong(!)Password" \ + mcr.microsoft.com/mssql/server:latest +``` + +#### 2. 配置文件修改 + +需要根据选择的数据库类型修改以下配置文件中的数据库连接字符串: + +- `migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json` +- `LY.MicroService.Applications.Single/appsettings.Development.json` + +数据库连接字符串示例: + +PostgreSQL: + +```json +{ + "ConnectionStrings": { + "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;" + } +} +``` + +MySQL: + +```json +{ + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" + } +} +``` + +SQL Server(即将支持): + +```json +{ + "ConnectionStrings": { + "Default": "Server=localhost,1433;Database=Platform-V70;User Id=sa;Password=yourStrong(!)Password;TrustServerCertificate=True" + } +} +``` + +#### 3. Redis 服务 + +```shell +# 使用Docker启动Redis +docker run -d --name redis -p 6379:6379 redis:latest +``` + +Redis 配置示例: + +```json +{ + "DistributedLock": { + "IsEnabled": true, + "Redis": { + "Configuration": "127.0.0.1,defaultDatabase=14" + } + }, + "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" + } + } + } +} +``` + +### 可选配置 + +以下配置适用于单体分布式架构: + +#### 1. MinIO 分布式文件存储 + +```json +{ + "Minio": { + "WithSSL": false, + "BucketName": "blobs", + "EndPoint": "127.0.0.1:19000", + "AccessKey": "{AccessKey}", + "SecretKey": "{SecretKey}", + "CreateBucketIfNotExists": false + } +} +``` + +#### 2. Elasticsearch 分布式审计日志 + +```json +{ + "Elasticsearch": { + "NodeUris": "http://127.0.0.1:9200" + } +} +``` + +## 数据库初始化 + +1. 运行数据库迁移脚本: + +方案一(推荐): + +```shell +./aspnet-core/migrations/Migrate.ps1 +``` + +根据命令行提示生成迁移文件和 sql 脚本,然后执行 sql 脚本来创建数据表 + +方案二: +以 pgsql 为例 + +- 修改 `LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json` 中的数据库连接信息 +- 进入`LY.MicroService.Applications.Single.EntityFrameworkCore.PostgreSql`项目 +- 运行 `dotnet ef database update` +- 等待数据迁移完成 + +2. 配置数据初始化: + + - 修改 `LY.MicroService.Applications.Single.DbMigrator/appsettings.json` 中的数据库连接信息 + - 确保选择了正确的数据库提供程序 + +3. 执行数据迁移: + - 运行 `LY.MicroService.Applications.Single.DbMigrator` 项目 + - 等待数据迁移完成,基础表数据将被初始化 + +## 服务启动 + +1. 运行 `LY.MicroService.Applications.Single` 项目 +2. 在浏览器中访问 Swagger 接口文档: + - URL: http://127.0.0.1:30000/swagger + +## 配置说明 + +### 1. 基础配置 + +#### 应用程序配置 + +```json +{ + "App": { + "ShowPii": true, + "SelfUrl": "http://127.0.0.1:30001/", + "CorsOrigins": "http://127.0.0.1:3100,http://127.0.0.1:30001" + } +} +``` + +#### 分布式缓存配置 + +```json +{ + "DistributedCache": { + "HideErrors": true, + "KeyPrefix": "LINGYUN.Abp.Application", + "GlobalCacheEntryOptions": { + "SlidingExpiration": "30:00:00", + "AbsoluteExpirationRelativeToNow": "60:00:00" + } + } +} +``` + +### 2. 认证配置 + +#### OpenIddict 配置 + +```json +{ + "OpenIddict": { + "Applications": { + "VueAdmin": { + "ClientId": "vue-admin-client", + "RootUrl": "http://127.0.0.1:3100/" + } + }, + "Lifetime": { + "AccessToken": "14:00:00", + "IdentityToken": "00:20:00", + "RefreshToken": "14:00:00" + } + } +} +``` + +#### 身份认证配置 + +```json +{ + "Identity": { + "Password": { + "RequiredLength": 6, + "RequireNonAlphanumeric": false, + "RequireLowercase": false, + "RequireUppercase": false, + "RequireDigit": false + }, + "Lockout": { + "AllowedForNewUsers": false, + "LockoutDuration": 5, + "MaxFailedAccessAttempts": 5 + }, + "SignIn": { + "RequireConfirmedEmail": false, + "RequireConfirmedPhoneNumber": false + } + } +} +``` + +### 3. 功能开关配置 + +```json +{ + "FeatureManagement": { + "IsDynamicStoreEnabled": true + }, + "SettingManagement": { + "IsDynamicStoreEnabled": true + }, + "PermissionManagement": { + "IsDynamicStoreEnabled": true + } +} +``` + +### 4. 日志配置 + +```json +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning" + } + }, + "WriteTo": [ + { + "Name": "File", + "Args": { + "path": "Logs/Info-.log", + "rollingInterval": "Day" + } + } + ] + } +} +``` + +## 常见问题 + +如果遇到问题,请检查: + +1. 数据库连接字符串是否正确 +2. 是否选择了正确的数据库提供程序 +3. Redis 连接是否正常 +4. 必要的端口是否被占用 +5. 数据库迁移是否成功完成 +6. 认证服务器配置是否正确 +7. CORS 配置是否正确(如果前端访问出现跨域问题) From 4534bad4c901a9da20aa74c0c381ece75e9e5686 Mon Sep 17 00:00:00 2001 From: feijie Date: Fri, 13 Dec 2024 21:20:18 +0800 Subject: [PATCH 003/170] =?UTF-8?q?=F0=9F=93=9A=20docs(README):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E7=BD=B2=E9=80=89=E9=A1=B9=EF=BC=8C?= =?UTF-8?q?=E4=BB=8B=E7=BB=8D=E5=8D=95=E4=BD=93=E6=9C=8D=E5=8A=A1=E4=B8=8E?= =?UTF-8?q?=E5=BE=AE=E6=9C=8D=E5=8A=A1=E7=9A=84=E9=83=A8=E7=BD=B2=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 13 +++++++++++++ README.md | 13 ++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index 74883c04b..fb79ea7d0 100644 --- a/README.en.md +++ b/README.en.md @@ -10,6 +10,19 @@ This is a [vue-vben-admin](https://github.com/anncwb/vue-vben-admin) -based Abp [![Build](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml/badge.svg)](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml) +## Deployment Options + +### Monolithic Service Deployment + +If you don't need a microservices architecture, you can choose the monolithic service deployment option. Monolithic services are characterized by simple deployment and easy maintenance. + +- [Monolithic Service Startup Guide](./docs/startup-aio-readme.en.md) +- [单体服务启动说明](./docs/startup-aio-readme.md) + +### Microservices Deployment + +If you need higher scalability and a more flexible service architecture, you can choose the microservices deployment option. + ## Quick Start ### 0、Configurate hosts diff --git a/README.md b/README.md index 9f0c91c39..dbcc172d0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - [English](./README.en.md) | 简体中文 [更新说明](./RELEASE.md) 更新说明 @@ -11,6 +10,18 @@ [![Build](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml/badge.svg)](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml) +## 部署方案 + +### 单体服务部署 + +如果您不需要微服务架构,可以选择单体服务部署方案。单体服务具有部署简单、维护方便的特点。 + +- [单体服务启动说明](./docs/startup-aio-readme.md) +- [Monolithic Service Startup Guide](./docs/startup-aio-readme.en.md) + +### 微服务部署 + +如果您需要更高的可扩展性和更灵活的服务架构,可以选择微服务部署方案。 ## 快速搭建微服务启动项目 From 618e4d959995068392de299132f457fe8095b073 Mon Sep 17 00:00:00 2001 From: feijie Date: Sat, 14 Dec 2024 22:27:06 +0800 Subject: [PATCH 004/170] =?UTF-8?q?=F0=9F=8E=89=20feat(aspnet-core/migrati?= =?UTF-8?q?ons):=20=E6=96=B0=E5=A2=9E=20Entity=20Framework=20Core=20SQL=20?= =?UTF-8?q?Server=20=E6=A8=A1=E5=9D=97=E5=8F=8A=E7=9B=B8=E5=85=B3=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LINGYUN.MicroService.SingleProject.sln | 7 + ...vice.Applications.Single.DbMigrator.csproj | 1 + .../appsettings.SqlServer.json | 228 ++++++++++++++++++ ...ingle.EntityFrameworkCore.SqlServer.csproj | 16 ++ .../README.en.md | 59 +++++ .../README.md | 59 +++++ .../SingleMigrationsDbContextFactory.cs | 35 +++ ...tionsEntityFrameworkCoreSqlServerModule.cs | 26 ++ aspnet-core/migrations/Migrate.ps1 | 5 + aspnet-core/migrations/MigrateEn.ps1 | 5 + docs/startup-aio-readme.md | 4 +- 11 files changed, 443 insertions(+), 2 deletions(-) create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.SqlServer.json create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer.csproj create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/README.en.md create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/README.md create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/SingleMigrationsDbContextFactory.cs create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/SingleMigrationsEntityFrameworkCoreSqlServerModule.cs diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.sln b/aspnet-core/LINGYUN.MicroService.SingleProject.sln index 219e3f2f7..3dde071c9 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.sln +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.sln @@ -615,6 +615,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.Application EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.Applications.Single.EntityFrameworkCore.MySql", "migrations\LY.MicroService.Applications.Single.EntityFrameworkCore.MySql\LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.csproj", "{2B167D92-2327-4679-9096-49F274FABE0C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer", "migrations\LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer\LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer.csproj", "{30EEF879-CFF7-4661-89CB-9CB68328D008}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1613,6 +1615,10 @@ Global {2B167D92-2327-4679-9096-49F274FABE0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {2B167D92-2327-4679-9096-49F274FABE0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {2B167D92-2327-4679-9096-49F274FABE0C}.Release|Any CPU.Build.0 = Release|Any CPU + {30EEF879-CFF7-4661-89CB-9CB68328D008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {30EEF879-CFF7-4661-89CB-9CB68328D008}.Debug|Any CPU.Build.0 = Debug|Any CPU + {30EEF879-CFF7-4661-89CB-9CB68328D008}.Release|Any CPU.ActiveCfg = Release|Any CPU + {30EEF879-CFF7-4661-89CB-9CB68328D008}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1909,6 +1915,7 @@ Global {AA742577-63B0-4188-AA36-AC6E0ED99BB6} = {07DFEB1E-ED92-4E97-A801-FAB2D70F4F35} {5A07FFDF-F979-44F9-BE24-81D6A25BEADB} = {0D69B63D-F082-4D57-9FF0-355642C56993} {2B167D92-2327-4679-9096-49F274FABE0C} = {0D69B63D-F082-4D57-9FF0-355642C56993} + {30EEF879-CFF7-4661-89CB-9CB68328D008} = {0D69B63D-F082-4D57-9FF0-355642C56993} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1} 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 d2195682d..1f39486bc 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 @@ -59,6 +59,7 @@ + diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.SqlServer.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.SqlServer.json new file mode 100644 index 000000000..555dab9fb --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.SqlServer.json @@ -0,0 +1,228 @@ +{ + "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": "Server=127.0.0.1;Database=Platform-V70;User Id=sa;Password=yourStrong(!)Password;TrustServerCertificate=True" + }, + "DistributedLock": { + "IsEnabled": true, + "Redis": { + "Configuration": "127.0.0.1,defaultDatabase=14" + } + }, + "Elsa": { + "Features": { + "DefaultPersistence": { + "Enabled": true, + "ConnectionStringIdentifier": "Default", + "EntityFrameworkCore": { + "SqlServer": { + "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": true, + "ConnectionStringIdentifier": "Default", + "EntityFrameworkCore": { + "SqlServer": { + "Enabled": true + } + } + }, + "WorkflowSettings": { + "Enabled": true, + "ConnectionStringIdentifier": "Default", + "EntityFrameworkCore": { + "SqlServer": { + "Enabled": true + } + } + } + }, + "Server": { + "BaseUrl": "http://127.0.0.1:30000" + } + }, + "Quartz": { + "UsePersistentStore": false, + "Properties": { + "quartz.jobStore.dataSource": "tkm", + "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz", + "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz", + "quartz.dataSource.tkm.connectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=sa;Password=yourStrong(!)Password;", + "quartz.dataSource.tkm.provider": "SqlServer", + "quartz.jobStore.clustered": "true", + "quartz.serializer.type": "json", + "quartz.dataSource.tkm.connectionStringName": "TaskManagement" + } + }, + "Redis": { + "IsEnabled": true, + "Configuration": "127.0.0.1,defaultDatabase=15", + "InstanceName": "LINGYUN.Abp.Application" + }, + "AuthServer": { + "UseOpenIddict": true, + "Authority": "http://127.0.0.1:30001/", + "ApiName": "lingyun-abp-application", + "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" + }, + "Serilog": { + "MinimumLevel": { + "Default": "Debug", + "Override": { + "System": "Warning", + "Microsoft": "Warning", + "DotNetCore": "Debug" + } + }, + "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/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer.csproj b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer.csproj new file mode 100644 index 000000000..8f0eab1d8 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer.csproj @@ -0,0 +1,16 @@ + + + net8.0 + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/README.en.md b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/README.en.md new file mode 100644 index 000000000..06cf0b61a --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/README.en.md @@ -0,0 +1,59 @@ +# SQL Server Database Migration Guide + +This guide will help you manage SQL Server database migrations using the migration scripts. + +## Prerequisites + +1. Ensure .NET Core SDK is installed +2. Ensure Entity Framework Core tools are installed + ```powershell + dotnet tool install --global dotnet-ef + ``` +3. Ensure SQL Server connection string is properly configured + +## Usage Instructions + +### 1. Create New Migration + +1. Run the migration script in the `aspnet-core/migrations` directory: + ```powershell + # Use English version + .\MigrateEn.ps1 + + # Or use Chinese version + .\Migrate.ps1 + ``` + +2. Select SQL Server database context from the menu: + ``` + [3] LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer + ``` + +3. Enter migration name (optional): + - Press Enter to use default name: `AddNewMigration_yyyyMMdd_HHmmss` + - Or enter custom name, e.g.: `AddNewFeature` + +### 2. Generate SQL Script + +After creating the migration, the script will ask if you want to generate SQL script: + +1. Choose whether to generate SQL script (Y/N) +2. If Y is selected, following options will be available: + - `[A]` - Generate SQL script for all migrations + - `[L]` - Generate SQL script for latest migration only + - `[0-9]` - Generate from specified migration version + +Generated SQL scripts will be saved in: +``` +aspnet-core/InitSql/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/ +``` + +### 3. Apply Migration + +Generated SQL scripts can be applied to database through: + +1. Using SQL Server Management Studio or other SQL Server client tools to execute SQL script +2. Or using command line: + ```bash + sqlcmd -S your_server -d your_database -i your_script.sql + ``` diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/README.md b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/README.md new file mode 100644 index 000000000..e086b650a --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/README.md @@ -0,0 +1,59 @@ +# SQL Server 数据库迁移指南 + +本指南将帮助您使用迁移脚本来管理 SQL Server 数据库的迁移操作。 + +## 前置条件 + +1. 确保已安装 .NET Core SDK +2. 确保已安装 Entity Framework Core 工具 + ```powershell + dotnet tool install --global dotnet-ef + ``` +3. 确保已正确配置 SQL Server 连接字符串 + +## 使用说明 + +### 1. 创建新的迁移 + +1. 在 `aspnet-core/migrations` 目录下运行迁移脚本: + ```powershell + # 使用中文版本 + .\Migrate.ps1 + + # 或使用英文版本 + .\MigrateEn.ps1 + ``` + +2. 在菜单中选择 SQL Server 数据库上下文: + ``` + [3] LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer + ``` + +3. 输入迁移名称(可选): + - 直接回车将使用默认名称:`AddNewMigration_yyyyMMdd_HHmmss` + - 或输入自定义名称,如:`AddNewFeature` + +### 2. 生成 SQL 脚本 + +在创建迁移后,脚本会询问是否需要生成 SQL 脚本: + +1. 选择是否生成 SQL 脚本 (Y/N) +2. 如果选择 Y,将提供以下选项: + - `[A]` - 生成所有迁移的 SQL 脚本 + - `[L]` - 仅生成最新迁移的 SQL 脚本 + - `[0-9]` - 从指定的迁移版本开始生成 + +生成的 SQL 脚本将保存在: +``` +aspnet-core/InitSql/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/ +``` + +### 3. 应用迁移 + +生成的 SQL 脚本可以通过以下方式应用到数据库: + +1. 使用 SQL Server Management Studio 或其他 SQL Server 客户端工具执行 SQL 脚本 +2. 或使用命令行: + ```bash + sqlcmd -S your_server -d your_database -i your_script.sql + ``` diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/SingleMigrationsDbContextFactory.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/SingleMigrationsDbContextFactory.cs new file mode 100644 index 000000000..0d6919c93 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/SingleMigrationsDbContextFactory.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; +using System; +using System.IO; + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer; + +public class SingleMigrationsDbContextFactory : IDesignTimeDbContextFactory +{ + public SingleMigrationsDbContext CreateDbContext(string[] args) + { + var configuration = BuildConfiguration(); + var connectionString = configuration.GetConnectionString("Default"); + + var builder = new DbContextOptionsBuilder() + .UseSqlServer(connectionString, + b => b.MigrationsAssembly("LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer")); + + return new SingleMigrationsDbContext(builder!.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), + "../LY.MicroService.Applications.Single.DbMigrator/")) + .AddJsonFile("appsettings.json", optional: false) + .AddJsonFile( + "appsettings.SqlServer.json", + optional: false); + + return builder.Build(); + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/SingleMigrationsEntityFrameworkCoreSqlServerModule.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/SingleMigrationsEntityFrameworkCoreSqlServerModule.cs new file mode 100644 index 000000000..e08840d28 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer/SingleMigrationsEntityFrameworkCoreSqlServerModule.cs @@ -0,0 +1,26 @@ +using LINGYUN.Abp.Elsa.EntityFrameworkCore.SqlServer; +using Microsoft.Extensions.DependencyInjection; +using System; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.SqlServer; +using Volo.Abp.Modularity; + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer; + +[DependsOn( + typeof(AbpEntityFrameworkCoreSqlServerModule), + typeof(AbpElsaEntityFrameworkCoreSqlServerModule), + typeof(SingleMigrationsEntityFrameworkCoreModule) + )] +public class SingleMigrationsEntityFrameworkCoreSqlServerModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(); + + Configure(options => + { + options.UseSqlServer(); + }); + } +} diff --git a/aspnet-core/migrations/Migrate.ps1 b/aspnet-core/migrations/Migrate.ps1 index f52891443..3d6486b9b 100755 --- a/aspnet-core/migrations/Migrate.ps1 +++ b/aspnet-core/migrations/Migrate.ps1 @@ -21,6 +21,11 @@ $dbContexts = @{ Context = "SingleMigrationsDbContext" Factory = "SingleMigrationsDbContextFactory" } + “3” = @{ + Name = "LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer" + Context = "SingleMigrationsDbContext" + Factory = "SingleMigrationsDbContextFactory" + } } # 显示DbContext选择菜单 diff --git a/aspnet-core/migrations/MigrateEn.ps1 b/aspnet-core/migrations/MigrateEn.ps1 index 348910a43..3ae0df556 100644 --- a/aspnet-core/migrations/MigrateEn.ps1 +++ b/aspnet-core/migrations/MigrateEn.ps1 @@ -21,6 +21,11 @@ $dbContexts = @{ Context = "SingleMigrationsDbContext" Factory = "SingleMigrationsDbContextFactory" } + "3" = @{ + Name = "LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer" + Context = "SingleMigrationsDbContext" + Factory = "SingleMigrationsDbContextFactory" + } } # Display DbContext selection menu diff --git a/docs/startup-aio-readme.md b/docs/startup-aio-readme.md index 3f1feb0c9..605585796 100644 --- a/docs/startup-aio-readme.md +++ b/docs/startup-aio-readme.md @@ -69,7 +69,7 @@ docker run -d --name mysql \ CREATE DATABASE `Platform-V70`; ``` -##### SQL Server(即将支持) +##### SQL Server ```shell # 使用Docker启动SQL Server @@ -109,7 +109,7 @@ MySQL: } ``` -SQL Server(即将支持): +SQL Server: ```json { From aae7c90320a23d98c4df5dc70f793ce20e9815b2 Mon Sep 17 00:00:00 2001 From: feijie Date: Tue, 17 Dec 2024 22:27:54 +0800 Subject: [PATCH 005/170] =?UTF-8?q?=E2=9C=A8=20feat(AIO):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20LY.AIO.Applications.Single=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E4=BE=9D=E8=B5=96=E6=BA=90=E7=A0=81=E5=BC=95?= =?UTF-8?q?=E7=94=A8=EF=BC=8C=E5=8F=AF=E5=BF=AB=E8=BD=BB=E9=87=8F=E5=8C=96?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E6=95=B4=E5=A5=97=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LINGYUN.MicroService.SingleProject.sln | 7 + aspnet-core/services/Directory.Packages.props | 263 +++++ .../.config/dotnet-tools.json | 12 + .../LY.AIO.Applications.Single/.gitignore | 2 + .../AbpCookieAuthenticationHandler.cs | 89 ++ .../BackgroundJobs/NotificationPublishJob.cs | 38 + .../NotificationPublishJobArgs.cs | 22 + .../Controllers/HomeController.cs | 11 + .../Controllers/SettingMergeController.cs | 70 ++ .../Controllers/UserSettingMergeController.cs | 45 + .../LY.AIO.Applications.Single/Dockerfile | 19 + .../Distributed/ChatMessageEventHandler.cs | 59 ++ .../Distributed/NotificationEventHandler.cs | 470 +++++++++ .../Distributed/TenantSynchronizer.cs | 53 + .../Distributed/UserCreateEventHandler.cs | 30 + .../Distributed/WebhooksEventHandler.cs | 112 +++ .../Local/UserCreateJoinIMEventHandler.cs | 58 ++ .../UserCreateSendWelcomeEventHandler.cs | 69 ++ .../CustomIdentityResources.cs | 19 + .../LY.AIO.Applications.Single.csproj | 272 +++++ ...rviceApplicationsSingleModule.Configure.cs | 935 ++++++++++++++++++ .../MicroServiceApplicationsSingleModule.cs | 394 ++++++++ ...eSiteCookiesServiceCollectionExtensions.cs | 67 ++ .../MultiTenancy/ITenantConfigurationCache.cs | 10 + .../MultiTenancy/TenantConfigurationCache.cs | 59 ++ .../TenantConfigurationCacheItem.cs | 19 + .../PersonalInfo/Default.cshtml | 103 ++ .../PersonalInfo/Default.js | 28 + .../Pages/Account/EmailConfirm.cshtml | 17 + .../Pages/Account/EmailConfirm.cshtml.cs | 72 ++ .../Account/EmailConfirmConfirmation.cshtml | 13 + .../EmailConfirmConfirmation.cshtml.cs | 22 + .../Pages/Account/SendCode.cshtml | 26 + .../Pages/Account/SendCode.cshtml.cs | 125 +++ .../Pages/Account/SendEmailConfirm.cshtml | 16 + .../Pages/Account/SendEmailConfirm.cshtml.cs | 73 ++ .../Account/TwoFactorSupportedLoginModel.cs | 63 ++ .../Pages/Account/UseRecoveryCode.cshtml | 4 + .../Pages/Account/UseRecoveryCode.cshtml.cs | 11 + .../Account/VerifyAuthenticatorCode.cshtml | 26 + .../Account/VerifyAuthenticatorCode.cshtml.cs | 59 ++ .../Pages/Account/VerifyCode.cshtml | 29 + .../Pages/Account/VerifyCode.cshtml.cs | 90 ++ .../Pages/Index.cshtml | 36 + .../Pages/Index.cshtml.cs | 11 + .../Pages/_ViewImports.cshtml | 4 + .../LY.AIO.Applications.Single/Program.cs | 82 ++ .../Properties/launchSettings.json | 30 + .../TenantHeaderParamter.cs | 35 + .../Messages/TextMessageReplyContributor.cs | 21 + .../Messages/UserSubscribeEventContributor.cs | 21 + .../Messages/TextMessageReplyContributor.cs | 24 + .../appsettings.Development.json | 249 +++++ .../appsettings.PostgreSql.json | 246 +++++ .../appsettings.json | 89 ++ .../LY.AIO.Applications.Single/gulpfile.js | 10 + common.props | 2 +- 57 files changed, 4840 insertions(+), 1 deletion(-) create mode 100644 aspnet-core/services/Directory.Packages.props create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/.config/dotnet-tools.json create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/.gitignore create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Authentication/AbpCookieAuthenticationHandler.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/BackgroundJobs/NotificationPublishJob.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/BackgroundJobs/NotificationPublishJobArgs.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Controllers/HomeController.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Controllers/SettingMergeController.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Controllers/UserSettingMergeController.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Dockerfile create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/ChatMessageEventHandler.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/NotificationEventHandler.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/TenantSynchronizer.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/UserCreateEventHandler.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/WebhooksEventHandler.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/EventBus/Local/UserCreateJoinIMEventHandler.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/EventBus/Local/UserCreateSendWelcomeEventHandler.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/IdentityResources/CustomIdentityResources.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Microsoft/Extensions/DependencyInjection/SameSiteCookiesServiceCollectionExtensions.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/ITenantConfigurationCache.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/TenantConfigurationCache.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/TenantConfigurationCacheItem.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirm.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirm.cshtml.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirmConfirmation.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirmConfirmation.cshtml.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendCode.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendCode.cshtml.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendEmailConfirm.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendEmailConfirm.cshtml.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/TwoFactorSupportedLoginModel.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/UseRecoveryCode.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/UseRecoveryCode.cshtml.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyAuthenticatorCode.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyAuthenticatorCode.cshtml.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyCode.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyCode.cshtml.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Index.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/Index.cshtml.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Pages/_ViewImports.cshtml create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Program.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/Properties/launchSettings.json create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/TenantHeaderParamter.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/WeChat/Official/Messages/TextMessageReplyContributor.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/WeChat/Official/Messages/UserSubscribeEventContributor.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/WeChat/Work/Messages/TextMessageReplyContributor.cs create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/appsettings.Development.json create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/appsettings.PostgreSql.json create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/appsettings.json create mode 100644 aspnet-core/services/LY.AIO.Applications.Single/gulpfile.js diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.sln b/aspnet-core/LINGYUN.MicroService.SingleProject.sln index 3dde071c9..a850d1539 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.sln +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.sln @@ -617,6 +617,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.Application EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer", "migrations\LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer\LY.MicroService.Applications.Single.EntityFrameworkCore.SqlServer.csproj", "{30EEF879-CFF7-4661-89CB-9CB68328D008}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.AIO.Applications.Single", "services\LY.AIO.Applications.Single\LY.AIO.Applications.Single.csproj", "{37740138-D088-46F5-83A8-8A8180FE65D8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1619,6 +1621,10 @@ Global {30EEF879-CFF7-4661-89CB-9CB68328D008}.Debug|Any CPU.Build.0 = Debug|Any CPU {30EEF879-CFF7-4661-89CB-9CB68328D008}.Release|Any CPU.ActiveCfg = Release|Any CPU {30EEF879-CFF7-4661-89CB-9CB68328D008}.Release|Any CPU.Build.0 = Release|Any CPU + {37740138-D088-46F5-83A8-8A8180FE65D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {37740138-D088-46F5-83A8-8A8180FE65D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37740138-D088-46F5-83A8-8A8180FE65D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {37740138-D088-46F5-83A8-8A8180FE65D8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1916,6 +1922,7 @@ Global {5A07FFDF-F979-44F9-BE24-81D6A25BEADB} = {0D69B63D-F082-4D57-9FF0-355642C56993} {2B167D92-2327-4679-9096-49F274FABE0C} = {0D69B63D-F082-4D57-9FF0-355642C56993} {30EEF879-CFF7-4661-89CB-9CB68328D008} = {0D69B63D-F082-4D57-9FF0-355642C56993} + {37740138-D088-46F5-83A8-8A8180FE65D8} = {B4247B78-34BC-4A3F-91A4-661F7DCD6E10} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1} diff --git a/aspnet-core/services/Directory.Packages.props b/aspnet-core/services/Directory.Packages.props new file mode 100644 index 000000000..84f4c0737 --- /dev/null +++ b/aspnet-core/services/Directory.Packages.props @@ -0,0 +1,263 @@ + + + + 8.3.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aspnet-core/services/LY.AIO.Applications.Single/.config/dotnet-tools.json b/aspnet-core/services/LY.AIO.Applications.Single/.config/dotnet-tools.json new file mode 100644 index 000000000..6b93cca86 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "7.0.3", + "commands": [ + "dotnet-ef" + ] + } + } +} \ No newline at end of file diff --git a/aspnet-core/services/LY.AIO.Applications.Single/.gitignore b/aspnet-core/services/LY.AIO.Applications.Single/.gitignore new file mode 100644 index 000000000..7b6f60857 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/.gitignore @@ -0,0 +1,2 @@ +wwwroot +package*.json \ No newline at end of file diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Authentication/AbpCookieAuthenticationHandler.cs b/aspnet-core/services/LY.AIO.Applications.Single/Authentication/AbpCookieAuthenticationHandler.cs new file mode 100644 index 000000000..2cf43e1f2 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Authentication/AbpCookieAuthenticationHandler.cs @@ -0,0 +1,89 @@ +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.Extensions.Options; +using System.Text.Encodings.Web; + +namespace LY.AIO.Applications.Single.Authentication; + +public class AbpCookieAuthenticationHandler : CookieAuthenticationHandler +{ + public AbpCookieAuthenticationHandler( + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder) : base(options, logger, encoder) + { + } + + public AbpCookieAuthenticationHandler( + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder, + ISystemClock clock) : base(options, logger, encoder, clock) + { + } + + protected const string XRequestFromHeader = "X-Request-From"; + protected const string DontRedirectRequestFromHeader = "vben"; + protected override Task InitializeEventsAsync() + { + var events = new CookieAuthenticationEvents + { + OnRedirectToLogin = ctx => + { + if (string.Equals(ctx.Request.Headers[XRequestFromHeader], DontRedirectRequestFromHeader, StringComparison.Ordinal)) + { + // ctx.Response.Headers.Location = ctx.RedirectUri; + ctx.Response.StatusCode = 401; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToAccessDenied = ctx => + { + if (string.Equals(ctx.Request.Headers[XRequestFromHeader], DontRedirectRequestFromHeader, StringComparison.Ordinal)) + { + // ctx.Response.Headers.Location = ctx.RedirectUri; + ctx.Response.StatusCode = 401; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToLogout = ctx => + { + if (string.Equals(ctx.Request.Headers[XRequestFromHeader], DontRedirectRequestFromHeader, StringComparison.Ordinal)) + { + // ctx.Response.Headers.Location = ctx.RedirectUri; + ctx.Response.StatusCode = 401; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToReturnUrl = ctx => + { + if (string.Equals(ctx.Request.Headers[XRequestFromHeader], DontRedirectRequestFromHeader, StringComparison.Ordinal)) + { + // ctx.Response.Headers.Location = ctx.RedirectUri; + ctx.Response.StatusCode = 401; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + } + }; + + Events = events; + + return Task.CompletedTask; + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/BackgroundJobs/NotificationPublishJob.cs b/aspnet-core/services/LY.AIO.Applications.Single/BackgroundJobs/NotificationPublishJob.cs new file mode 100644 index 000000000..e1bbef7c2 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/BackgroundJobs/NotificationPublishJob.cs @@ -0,0 +1,38 @@ +using LINGYUN.Abp.Notifications; +using Microsoft.Extensions.Options; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.DependencyInjection; + +namespace LY.AIO.Applications.Single.BackgroundJobs; + +public class NotificationPublishJob : AsyncBackgroundJob, ITransientDependency +{ + protected AbpNotificationsPublishOptions Options { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } + protected INotificationDataSerializer NotificationDataSerializer { get; } + public NotificationPublishJob( + IOptions options, + IServiceScopeFactory serviceScopeFactory, + INotificationDataSerializer notificationDataSerializer) + { + Options = options.Value; + ServiceScopeFactory = serviceScopeFactory; + NotificationDataSerializer = notificationDataSerializer; + } + + public override async Task ExecuteAsync(NotificationPublishJobArgs args) + { + var providerType = Type.GetType(args.ProviderType); + using (var scope = ServiceScopeFactory.CreateScope()) + { + if (scope.ServiceProvider.GetRequiredService(providerType) is INotificationPublishProvider publishProvider) + { + var store = scope.ServiceProvider.GetRequiredService(); + var notification = await store.GetNotificationOrNullAsync(args.TenantId, args.NotificationId); + notification.Data = NotificationDataSerializer.Serialize(notification.Data); + + await publishProvider.PublishAsync(notification, args.UserIdentifiers); + } + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/BackgroundJobs/NotificationPublishJobArgs.cs b/aspnet-core/services/LY.AIO.Applications.Single/BackgroundJobs/NotificationPublishJobArgs.cs new file mode 100644 index 000000000..8d721981c --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/BackgroundJobs/NotificationPublishJobArgs.cs @@ -0,0 +1,22 @@ +using LINGYUN.Abp.Notifications; + +namespace LY.AIO.Applications.Single.BackgroundJobs; + +public class NotificationPublishJobArgs +{ + public Guid? TenantId { get; set; } + public long NotificationId { get; set; } + public string ProviderType { get; set; } + public List UserIdentifiers { get; set; } + public NotificationPublishJobArgs() + { + UserIdentifiers = new List(); + } + public NotificationPublishJobArgs(long id, string providerType, List userIdentifiers, Guid? tenantId = null) + { + NotificationId = id; + ProviderType = providerType; + UserIdentifiers = userIdentifiers; + TenantId = tenantId; + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Controllers/HomeController.cs b/aspnet-core/services/LY.AIO.Applications.Single/Controllers/HomeController.cs new file mode 100644 index 000000000..c154b5098 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Controllers/HomeController.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNetCore.Mvc; + +namespace LY.AIO.Applications.Single.Controllers; + +public class HomeController : Controller +{ + public IActionResult Index() + { + return Redirect("/swagger"); + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Controllers/SettingMergeController.cs b/aspnet-core/services/LY.AIO.Applications.Single/Controllers/SettingMergeController.cs new file mode 100644 index 000000000..dd64e4201 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Controllers/SettingMergeController.cs @@ -0,0 +1,70 @@ +using LINGYUN.Abp.SettingManagement; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace LY.AIO.Applications.Single.Controllers; + +[ExposeServices( + typeof(SettingController), + typeof(SettingMergeController))] +public class SettingMergeController : SettingController +{ + private readonly SettingManagementMergeOptions _mergeOptions; + public SettingMergeController( + ISettingAppService settingAppService, + ISettingTestAppService settingTestAppService, + IOptions mergeOptions) + : base(settingAppService, settingTestAppService) + { + _mergeOptions = mergeOptions.Value; + } + + [HttpGet] + [Route("by-current-tenant")] + public async override Task GetAllForCurrentTenantAsync() + { + var result = new SettingGroupResult(); + var markTypeMap = new List + { + typeof(SettingMergeController), + }; + foreach (var serviceType in _mergeOptions.GlobalSettingProviders + .Where(type => !markTypeMap.Any(markType => type.IsAssignableFrom(markType)))) + { + var settingService = LazyServiceProvider.LazyGetRequiredService(serviceType).As(); + var currentResult = await settingService.GetAllForCurrentTenantAsync(); + foreach (var group in currentResult.Items) + { + result.AddGroup(group); + } + markTypeMap.Add(serviceType); + } + + return result; + } + + [HttpGet] + [Route("by-global")] + public async override Task GetAllForGlobalAsync() + { + var result = new SettingGroupResult(); + var markTypeMap = new List + { + typeof(SettingMergeController), + }; + foreach (var serviceType in _mergeOptions.GlobalSettingProviders + .Where(type => !markTypeMap.Any(markType => type.IsAssignableFrom(markType)))) + { + var settingService = LazyServiceProvider.LazyGetRequiredService(serviceType).As(); + var currentResult = await settingService.GetAllForGlobalAsync(); + foreach (var group in currentResult.Items) + { + result.AddGroup(group); + } + markTypeMap.Add(serviceType); + } + + return result; + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Controllers/UserSettingMergeController.cs b/aspnet-core/services/LY.AIO.Applications.Single/Controllers/UserSettingMergeController.cs new file mode 100644 index 000000000..ab8428491 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Controllers/UserSettingMergeController.cs @@ -0,0 +1,45 @@ +using LINGYUN.Abp.SettingManagement; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace LY.AIO.Applications.Single.Controllers; + +[ExposeServices( + typeof(UserSettingController), + typeof(UserSettingMergeController))] +public class UserSettingMergeController : UserSettingController +{ + private readonly SettingManagementMergeOptions _mergeOptions; + public UserSettingMergeController( + IUserSettingAppService service, + IOptions mergeOptions) + : base(service) + { + _mergeOptions = mergeOptions.Value; + } + + [HttpGet] + [Route("by-current-user")] + public async override Task GetAllForCurrentUserAsync() + { + var result = new SettingGroupResult(); + var markTypeMap = new List + { + typeof(UserSettingMergeController), + }; + foreach (var serviceType in _mergeOptions.UserSettingProviders + .Where(type => !markTypeMap.Any(markType => type.IsAssignableFrom(markType)))) + { + var settingService = LazyServiceProvider.LazyGetRequiredService(serviceType).As(); + var currentResult = await settingService.GetAllForCurrentUserAsync(); + foreach (var group in currentResult.Items) + { + result.AddGroup(group); + } + markTypeMap.Add(serviceType); + } + + return result; + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Dockerfile b/aspnet-core/services/LY.AIO.Applications.Single/Dockerfile new file mode 100644 index 000000000..aee09fd66 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 +LABEL maintainer="colin.in@foxmail.com" +WORKDIR /app + +COPY . /app + +#东8区 +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +EXPOSE 80/tcp +VOLUME [ "./app/blobs" ] +VOLUME [ "./app/Logs" ] +VOLUME [ "./app/Modules" ] + +RUN apt update +RUN apt install wget -y + +ENTRYPOINT ["dotnet", "LY.MicroService.Applications.Single.dll"] diff --git a/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/ChatMessageEventHandler.cs b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/ChatMessageEventHandler.cs new file mode 100644 index 000000000..52cf0d875 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/ChatMessageEventHandler.cs @@ -0,0 +1,59 @@ +using LINGYUN.Abp.IM; +using LINGYUN.Abp.IM.Messages; +using LINGYUN.Abp.RealTime; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; + +namespace LY.AIO.Applications.Single.EventBus.Distributed +{ + public class ChatMessageEventHandler : IDistributedEventHandler>, ITransientDependency + { + /// + /// Reference to . + /// + public ILogger Logger { get; set; } + /// + /// Reference to . + /// + protected AbpIMOptions Options { get; } + + protected IMessageStore MessageStore { get; } + protected IMessageBlocker MessageBlocker { get; } + protected IMessageSenderProviderManager MessageSenderProviderManager { get; } + + public ChatMessageEventHandler( + IOptions options, + IMessageStore messageStore, + IMessageBlocker messageBlocker, + IMessageSenderProviderManager messageSenderProviderManager) + { + Options = options.Value; + MessageStore = messageStore; + MessageBlocker = messageBlocker; + MessageSenderProviderManager = messageSenderProviderManager; + + Logger = NullLogger.Instance; + } + + public async virtual Task HandleEventAsync(RealTimeEto eventData) + { + Logger.LogDebug($"Persistent chat message."); + + var message = eventData.Data; + // 消息拦截 + // 扩展敏感词汇过滤 + await MessageBlocker.InterceptAsync(message); + + await MessageStore.StoreMessageAsync(message); + + // 发送消息 + foreach (var provider in MessageSenderProviderManager.Providers) + { + Logger.LogDebug($"Sending message with provider {provider.Name}"); + await provider.SendMessageAsync(message); + } + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/NotificationEventHandler.cs b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/NotificationEventHandler.cs new file mode 100644 index 000000000..275ba0a4d --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/NotificationEventHandler.cs @@ -0,0 +1,470 @@ +using LINGYUN.Abp.Notifications; +using LY.AIO.Applications.Single.BackgroundJobs; +using LY.AIO.Applications.Single.MultiTenancy; +using Microsoft.Extensions.Localization; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; +using System.Globalization; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Json; +using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; +using Volo.Abp.TextTemplating; +using Volo.Abp.Uow; + +namespace LY.AIO.Applications.Single.EventBus.Distributed +{ + /// + /// 订阅通知发布事件,统一发布消息 + /// + /// + /// 作用在于SignalR客户端只会与一台服务器建立连接, + /// 只有启用了SignlR服务端的才能真正将消息发布到客户端 + /// + public class NotificationEventHandler : + IDistributedEventHandler>, + IDistributedEventHandler>, + ITransientDependency + { + /// + /// Reference to . + /// + public ILogger Logger { get; set; } + /// + /// Reference to . + /// + protected AbpNotificationsPublishOptions Options { get; } + /// + /// Reference to . + /// + protected ICurrentTenant CurrentTenant { get; } + /// + /// Reference to . + /// + protected ITenantConfigurationCache TenantConfigurationCache { get; } + /// + /// Reference to . + /// + protected IJsonSerializer JsonSerializer { get; } + /// + /// Reference to . + /// + protected IBackgroundJobManager BackgroundJobManager { get; } + /// + /// Reference to . + /// + protected ITemplateRenderer TemplateRenderer { get; } + /// + /// Reference to . + /// + protected INotificationStore NotificationStore { get; } + /// + /// Reference to . + /// + protected IStringLocalizerFactory StringLocalizerFactory { get; } + /// + /// Reference to . + /// + protected INotificationDataSerializer NotificationDataSerializer { get; } + /// + /// Reference to . + /// + protected INotificationDefinitionManager NotificationDefinitionManager { get; } + /// + /// Reference to . + /// + protected INotificationSubscriptionManager NotificationSubscriptionManager { get; } + /// + /// Reference to . + /// + protected INotificationPublishProviderManager NotificationPublishProviderManager { get; } + + /// + /// Initializes a new instance of the class. + /// + public NotificationEventHandler( + ICurrentTenant currentTenant, + ITenantConfigurationCache tenantConfigurationCache, + IJsonSerializer jsonSerializer, + ITemplateRenderer templateRenderer, + IBackgroundJobManager backgroundJobManager, + IStringLocalizerFactory stringLocalizerFactory, + IOptions options, + INotificationStore notificationStore, + INotificationDataSerializer notificationDataSerializer, + INotificationDefinitionManager notificationDefinitionManager, + INotificationSubscriptionManager notificationSubscriptionManager, + INotificationPublishProviderManager notificationPublishProviderManager) + { + Options = options.Value; + TenantConfigurationCache = tenantConfigurationCache; + CurrentTenant = currentTenant; + JsonSerializer = jsonSerializer; + TemplateRenderer = templateRenderer; + BackgroundJobManager = backgroundJobManager; + StringLocalizerFactory = stringLocalizerFactory; + NotificationStore = notificationStore; + NotificationDataSerializer = notificationDataSerializer; + NotificationDefinitionManager = notificationDefinitionManager; + NotificationSubscriptionManager = notificationSubscriptionManager; + NotificationPublishProviderManager = notificationPublishProviderManager; + + Logger = NullLogger.Instance; + } + + [UnitOfWork] + public async virtual Task HandleEventAsync(NotificationEto eventData) + { + var notification = await NotificationDefinitionManager.GetOrNullAsync(eventData.Name); + if (notification == null) + { + return; + } + + var culture = eventData.Data.Culture; + if (culture.IsNullOrWhiteSpace()) + { + culture = CultureInfo.CurrentCulture.Name; + } + using (CultureHelper.Use(culture, culture)) + { + if (notification.NotificationType == NotificationType.System) + { + using (CurrentTenant.Change(null)) + { + await SendToTenantAsync(null, notification, eventData); + + var allActiveTenants = await TenantConfigurationCache.GetTenantsAsync(); + + foreach (var activeTenant in allActiveTenants) + { + await SendToTenantAsync(activeTenant.Id, notification, eventData); + } + } + } + else + { + await SendToTenantAsync(eventData.TenantId, notification, eventData); + } + } + } + + [UnitOfWork] + public async virtual Task HandleEventAsync(NotificationEto eventData) + { + var notification = await NotificationDefinitionManager.GetOrNullAsync(eventData.Name); + if (notification == null) + { + return; + } + + if (notification.NotificationType == NotificationType.System) + { + using (CurrentTenant.Change(null)) + { + await SendToTenantAsync(null, notification, eventData); + + var allActiveTenants = await TenantConfigurationCache.GetTenantsAsync(); + + foreach (var activeTenant in allActiveTenants) + { + await SendToTenantAsync(activeTenant.Id, notification, eventData); + } + } + } + else + { + await SendToTenantAsync(eventData.TenantId, notification, eventData); + } + } + + protected async virtual Task SendToTenantAsync( + Guid? tenantId, + NotificationDefinition notification, + NotificationEto eventData) + { + using (CurrentTenant.Change(tenantId)) + { + var providers = Enumerable.Reverse(NotificationPublishProviderManager.Providers); + + // 过滤用户指定提供者 + if (eventData.UseProviders.Any()) + { + providers = providers.Where(p => eventData.UseProviders.Contains(p.Name)); + } + else if (notification.Providers.Any()) + { + providers = providers.Where(p => notification.Providers.Contains(p.Name)); + } + + var notificationInfo = new NotificationInfo + { + Name = notification.Name, + TenantId = tenantId, + Severity = eventData.Severity, + Type = notification.NotificationType, + ContentType = notification.ContentType, + CreationTime = eventData.CreationTime, + Lifetime = notification.NotificationLifetime, + }; + notificationInfo.SetId(eventData.Id); + + var title = notification.DisplayName.Localize(StringLocalizerFactory); + var message = ""; + + try + { + // 由于模板通知受租户影响, 格式化失败的消息将被丢弃. + message = await TemplateRenderer.RenderAsync( + templateName: eventData.Data.Name, + model: eventData.Data.ExtraProperties, + cultureName: eventData.Data.Culture, + globalContext: new Dictionary + { + // 模板不支持 $ 字符, 改为普通关键字 + { NotificationKeywords.Name, notification.Name }, + { NotificationKeywords.FormUser, eventData.Data.FormUser }, + { NotificationKeywords.Id, eventData.Id }, + { NotificationKeywords.Title, title.ToString() }, + { NotificationKeywords.CreationTime, eventData.CreationTime.ToString(Options.DateTimeFormat) }, + }); + } + catch(Exception ex) + { + Logger.LogWarning("Formatting template notification failed, message will be discarded, cause :{message}", ex.Message); + return; + } + + var notificationData = new NotificationData(); + notificationData.WriteStandardData( + title: title.ToString(), + message: message, + createTime: eventData.CreationTime, + formUser: eventData.Data.FormUser); + notificationData.ExtraProperties.AddIfNotContains(eventData.Data.ExtraProperties); + + notificationInfo.Data = notificationData; + + var subscriptionUsers = await GerSubscriptionUsersAsync( + notificationInfo.Name, + eventData.Users, + tenantId); + + await PersistentNotificationAsync( + notificationInfo, + subscriptionUsers, + providers); + + if (subscriptionUsers.Any()) + { + // 发布通知 + foreach (var provider in providers) + { + await PublishToSubscriberAsync(provider, notificationInfo, subscriptionUsers); + } + } + } + } + + protected async virtual Task SendToTenantAsync( + Guid? tenantId, + NotificationDefinition notification, + NotificationEto eventData) + { + using (CurrentTenant.Change(tenantId)) + { + var providers = Enumerable.Reverse(NotificationPublishProviderManager.Providers); + + // 过滤用户指定提供者 + if (eventData.UseProviders.Any()) + { + providers = providers.Where(p => eventData.UseProviders.Contains(p.Name)); + } + else if (notification.Providers.Any()) + { + providers = providers.Where(p => notification.Providers.Contains(p.Name)); + } + + var notificationInfo = new NotificationInfo + { + Name = notification.Name, + CreationTime = eventData.CreationTime, + Data = eventData.Data, + Severity = eventData.Severity, + Lifetime = notification.NotificationLifetime, + TenantId = tenantId, + Type = notification.NotificationType, + ContentType = notification.ContentType, + }; + notificationInfo.SetId(eventData.Id); + + notificationInfo.Data = NotificationDataSerializer.Serialize(notificationInfo.Data); + + // 获取用户订阅 + var subscriptionUsers = await GerSubscriptionUsersAsync( + notificationInfo.Name, + eventData.Users, + tenantId); + + // 持久化通知 + await PersistentNotificationAsync( + notificationInfo, + subscriptionUsers, + providers); + + if (subscriptionUsers.Any()) + { + // 发布订阅通知 + foreach (var provider in providers) + { + await PublishToSubscriberAsync(provider, notificationInfo, subscriptionUsers); + } + } + } + } + /// + /// 获取用户订阅列表 + /// + /// 通知名称 + /// 接收用户列表 + /// 租户标识 + /// 用户订阅列表 + protected async Task> GerSubscriptionUsersAsync( + string notificationName, + IEnumerable sendToUsers, + Guid? tenantId = null) + { + try + { + // 获取用户订阅列表 + var userSubscriptions = await NotificationSubscriptionManager.GetUsersSubscriptionsAsync( + tenantId, + notificationName, + sendToUsers); + + return userSubscriptions.Select(us => new UserIdentifier(us.UserId, us.UserName)); + } + catch(Exception ex) + { + Logger.LogWarning("Failed to get user subscription, message will not be received by the user, reason: {message}", ex.Message); + } + + return new List(); + } + /// + /// 持久化通知并返回订阅用户列表 + /// + /// 通知实体 + /// 订阅用户列表 + /// 通知发送提供者 + /// 返回订阅者列表 + protected async Task PersistentNotificationAsync( + NotificationInfo notificationInfo, + IEnumerable subscriptionUsers, + IEnumerable sendToProviders) + { + try + { + // 持久化通知 + await NotificationStore.InsertNotificationAsync(notificationInfo); + + if (!subscriptionUsers.Any()) + { + return; + } + + // 持久化用户通知 + await NotificationStore.InsertUserNotificationsAsync(notificationInfo, subscriptionUsers.Select(u => u.UserId)); + + if (notificationInfo.Lifetime == NotificationLifetime.OnlyOne) + { + // 一次性通知取消用户订阅 + await NotificationStore.DeleteUserSubscriptionAsync( + notificationInfo.TenantId, + subscriptionUsers, + notificationInfo.Name); + } + } + catch (Exception ex) + { + Logger.LogWarning("Failed to persistent notification failed, reason: {message}", ex.Message); + + foreach (var provider in sendToProviders) + { + // 处理持久化失败进入后台队列 + await ProcessingFailedToQueueAsync(provider, notificationInfo, subscriptionUsers); + } + } + } + /// + /// 发布订阅者通知 + /// + /// 通知发布者 + /// 通知信息 + /// 订阅用户列表 + /// + protected async Task PublishToSubscriberAsync( + INotificationPublishProvider provider, + NotificationInfo notificationInfo, + IEnumerable subscriptionUsers) + { + try + { + Logger.LogDebug($"Sending notification with provider {provider.Name}"); + + // 2024-10-10: 框架层面应该取消通知数据转换,而是交给提供商来实现 + //var notifacationDataMapping = Options.NotificationDataMappings + // .GetMapItemOrDefault(provider.Name, notificationInfo.Name); + //if (notifacationDataMapping != null) + //{ + // notificationInfo.Data = notifacationDataMapping.MappingFunc(notificationInfo.Data); + //} + + // 发布 + await provider.PublishAsync(notificationInfo, subscriptionUsers); + + Logger.LogDebug($"Send notification {notificationInfo.Name} with provider {provider.Name} was successful"); + } + catch (Exception ex) + { + Logger.LogWarning($"Send notification error with provider {provider.Name}"); + Logger.LogWarning($"Error message:{ex.Message}"); + Logger.LogDebug($"Failed to send notification {notificationInfo.Name}. Try to push notification to background job"); + // 发送失败的消息进入后台队列 + await ProcessingFailedToQueueAsync(provider, notificationInfo, subscriptionUsers); + } + } + /// + /// 处理失败的消息进入后台队列 + /// + /// + /// 注: 如果入队失败,消息将被丢弃. + /// + /// + /// + /// + /// + protected async Task ProcessingFailedToQueueAsync( + INotificationPublishProvider provider, + NotificationInfo notificationInfo, + IEnumerable subscriptionUsers) + { + try + { + // 发送失败的消息进入后台队列 + await BackgroundJobManager.EnqueueAsync( + new NotificationPublishJobArgs( + notificationInfo.GetId(), + provider.GetType().AssemblyQualifiedName, + subscriptionUsers.ToList(), + notificationInfo.TenantId)); + } + catch(Exception ex) + { + Logger.LogWarning("Failed to push to background job, notification will be discarded, error cause: {message}", ex.Message); + } + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/TenantSynchronizer.cs b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/TenantSynchronizer.cs new file mode 100644 index 000000000..7a33a9cae --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/TenantSynchronizer.cs @@ -0,0 +1,53 @@ +using LINGYUN.Abp.Saas.Tenants; +using LY.AIO.Applications.Single.MultiTenancy; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Uow; + +namespace LY.AIO.Applications.Single.EventBus.Distributed +{ + public class TenantSynchronizer : + IDistributedEventHandler>, + IDistributedEventHandler>, + IDistributedEventHandler>, + IDistributedEventHandler, + ITransientDependency + { + protected IDataSeeder DataSeeder { get; } + protected ITenantConfigurationCache TenantConfigurationCache { get; } + + public TenantSynchronizer( + IDataSeeder dataSeeder, + ITenantConfigurationCache tenantConfigurationCache) + { + DataSeeder = dataSeeder; + TenantConfigurationCache = tenantConfigurationCache; + } + + [UnitOfWork] + public async virtual Task HandleEventAsync(EntityCreatedEto eventData) + { + await TenantConfigurationCache.RefreshAsync(); + + await DataSeeder.SeedAsync(eventData.Entity.Id); + } + + public async virtual Task HandleEventAsync(EntityUpdatedEto eventData) + { + await TenantConfigurationCache.RefreshAsync(); + } + + public async virtual Task HandleEventAsync(EntityDeletedEto eventData) + { + await TenantConfigurationCache.RefreshAsync(); + } + + public async virtual Task HandleEventAsync(TenantConnectionStringUpdatedEto eventData) + { + await TenantConfigurationCache.RefreshAsync(); + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/UserCreateEventHandler.cs b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/UserCreateEventHandler.cs new file mode 100644 index 000000000..11684352e --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/UserCreateEventHandler.cs @@ -0,0 +1,30 @@ +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.EventBus.Local; +using Volo.Abp.Users; + +namespace LY.AIO.Applications.Single.EventBus.Distributed +{ + public class UserCreateEventHandler : IDistributedEventHandler>, ITransientDependency + { + private readonly ILocalEventBus _localEventBus; + public UserCreateEventHandler( + ILocalEventBus localEventBus) + { + _localEventBus = localEventBus; + } + /// + /// 接收添加用户事件,发布本地事件 + /// + /// + /// + public async Task HandleEventAsync(EntityCreatedEto eventData) + { + var localUserCreateEventData = new EntityCreatedEventData(eventData.Entity); + + await _localEventBus.PublishAsync(localUserCreateEventData); + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/WebhooksEventHandler.cs b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/WebhooksEventHandler.cs new file mode 100644 index 000000000..3681560cb --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Distributed/WebhooksEventHandler.cs @@ -0,0 +1,112 @@ +using LINGYUN.Abp.Webhooks; +using LINGYUN.Abp.Webhooks.EventBus; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.MultiTenancy; + +namespace LY.AIO.Applications.Single.EventBus.Distributed; + +public class WebhooksEventHandler : + IDistributedEventHandler, + ITransientDependency +{ + public IWebhookEventStore WebhookEventStore { get; set; } + + private readonly ICurrentTenant _currentTenant; + private readonly IBackgroundJobManager _backgroundJobManager; + private readonly IWebhookSubscriptionManager _webhookSubscriptionManager; + + public WebhooksEventHandler( + IWebhookSubscriptionManager webhookSubscriptionManager, + ICurrentTenant currentTenant, + IBackgroundJobManager backgroundJobManager) + { + _currentTenant = currentTenant; + _backgroundJobManager = backgroundJobManager; + _webhookSubscriptionManager = webhookSubscriptionManager; + + WebhookEventStore = NullWebhookEventStore.Instance; + } + + public async virtual Task HandleEventAsync(WebhooksEventData eventData) + { + var subscriptions = await _webhookSubscriptionManager + .GetAllSubscriptionsOfTenantsIfFeaturesGrantedAsync( + eventData.TenantIds, + eventData.WebhookName); + + await PublishAsync(eventData.WebhookName, eventData.Data, subscriptions, eventData.SendExactSameData, eventData.Headers); + } + + protected async virtual Task PublishAsync( + string webhookName, + string data, + List webhookSubscriptions, + bool sendExactSameData = false, + WebhookHeader headers = null) + { + if (webhookSubscriptions.IsNullOrEmpty()) + { + return; + } + + var subscriptionsGroupedByTenant = webhookSubscriptions.GroupBy(x => x.TenantId); + + foreach (var subscriptionGroupedByTenant in subscriptionsGroupedByTenant) + { + var webhookInfo = await SaveAndGetWebhookAsync(subscriptionGroupedByTenant.Key, webhookName, data); + + foreach (var webhookSubscription in subscriptionGroupedByTenant) + { + var headersToSend = webhookSubscription.Headers; + if (headers != null) + { + if (headers.UseOnlyGivenHeaders)//do not use the headers defined in subscription + { + headersToSend = headers.Headers; + } + else + { + //use the headers defined in subscription. If additional headers has same header, use additional headers value. + foreach (var additionalHeader in headers.Headers) + { + headersToSend[additionalHeader.Key] = additionalHeader.Value; + } + } + } + + await _backgroundJobManager.EnqueueAsync(new WebhookSenderArgs + { + TenantId = webhookSubscription.TenantId, + WebhookEventId = webhookInfo.Id, + Data = webhookInfo.Data, + WebhookName = webhookInfo.WebhookName, + WebhookSubscriptionId = webhookSubscription.Id, + Headers = headersToSend, + Secret = webhookSubscription.Secret, + WebhookUri = webhookSubscription.WebhookUri, + SendExactSameData = sendExactSameData + }); + } + } + } + + protected async virtual Task SaveAndGetWebhookAsync( + Guid? tenantId, + string webhookName, + string data) + { + var webhookInfo = new WebhookEvent + { + WebhookName = webhookName, + Data = data, + TenantId = tenantId + }; + + var webhookId = await WebhookEventStore.InsertAndGetIdAsync(webhookInfo); + webhookInfo.Id = webhookId; + + return webhookInfo; + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Local/UserCreateJoinIMEventHandler.cs b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Local/UserCreateJoinIMEventHandler.cs new file mode 100644 index 000000000..822e1220d --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Local/UserCreateJoinIMEventHandler.cs @@ -0,0 +1,58 @@ +using LINGYUN.Abp.MessageService.Chat; +using LINGYUN.Abp.MessageService.Notifications; +using LINGYUN.Abp.Notifications; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Volo.Abp.Users; + +namespace LY.AIO.Applications.Single.EventBus.Local +{ + public class UserCreateJoinIMEventHandler : ILocalEventHandler>, ITransientDependency + { + private readonly IChatDataSeeder _chatDataSeeder; + private readonly INotificationSubscriptionManager _notificationSubscriptionManager; + public UserCreateJoinIMEventHandler( + IChatDataSeeder chatDataSeeder, + INotificationSubscriptionManager notificationSubscriptionManager) + { + _chatDataSeeder = chatDataSeeder; + _notificationSubscriptionManager = notificationSubscriptionManager; + } + /// + /// 接收添加用户事件,初始化IM用户种子 + /// + /// + /// + [UnitOfWork] + public async virtual Task HandleEventAsync(EntityCreatedEventData eventData) + { + await SeedChatDataAsync(eventData.Entity); + + await SeedUserSubscriptionNotifiersAsync(eventData.Entity); + } + + protected async virtual Task SeedChatDataAsync(IUserData user) + { + await _chatDataSeeder.SeedAsync(user); + } + + protected async virtual Task SeedUserSubscriptionNotifiersAsync(IUserData user) + { + var userIdentifier = new UserIdentifier(user.Id, user.UserName); + + await _notificationSubscriptionManager + .SubscribeAsync( + user.TenantId, + userIdentifier, + MessageServiceNotificationNames.IM.FriendValidation); + + await _notificationSubscriptionManager + .SubscribeAsync( + user.TenantId, + userIdentifier, + MessageServiceNotificationNames.IM.NewFriend); + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Local/UserCreateSendWelcomeEventHandler.cs b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Local/UserCreateSendWelcomeEventHandler.cs new file mode 100644 index 000000000..c430f94c0 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/EventBus/Local/UserCreateSendWelcomeEventHandler.cs @@ -0,0 +1,69 @@ +using LINGYUN.Abp.Notifications; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events; +using Volo.Abp.EventBus; +using Volo.Abp.Users; + +namespace LY.AIO.Applications.Single.EventBus.Local +{ + public class UserCreateSendWelcomeEventHandler : ILocalEventHandler>, ITransientDependency + { + private readonly INotificationSender _notificationSender; + private readonly INotificationSubscriptionManager _notificationSubscriptionManager; + public UserCreateSendWelcomeEventHandler( + INotificationSender notificationSender, + INotificationSubscriptionManager notificationSubscriptionManager + ) + { + _notificationSender = notificationSender; + _notificationSubscriptionManager = notificationSubscriptionManager; + } + + public async Task HandleEventAsync(EntityCreatedEventData eventData) + { + var userIdentifer = new UserIdentifier(eventData.Entity.Id, eventData.Entity.UserName); + // 订阅用户欢迎消息 + await SubscribeInternalNotifers(userIdentifer, eventData.Entity.TenantId); + + await _notificationSender.SendNofiterAsync( + UserNotificationNames.WelcomeToApplication, + new NotificationTemplate( + UserNotificationNames.WelcomeToApplication, + formUser: eventData.Entity.UserName, + data: new Dictionary + { + { "name", eventData.Entity.UserName }, + }), + userIdentifer, + eventData.Entity.TenantId, + NotificationSeverity.Info); + } + + private async Task SubscribeInternalNotifers(UserIdentifier userIdentifer, Guid? tenantId = null) + { + // 订阅内置通知 + await _notificationSubscriptionManager + .SubscribeAsync( + tenantId, + userIdentifer, + DefaultNotifications.SystemNotice); + await _notificationSubscriptionManager + .SubscribeAsync( + tenantId, + userIdentifer, + DefaultNotifications.OnsideNotice); + await _notificationSubscriptionManager + .SubscribeAsync( + tenantId, + userIdentifer, + DefaultNotifications.ActivityNotice); + + // 订阅用户欢迎消息 + await _notificationSubscriptionManager + .SubscribeAsync( + tenantId, + userIdentifer, + UserNotificationNames.WelcomeToApplication); + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/IdentityResources/CustomIdentityResources.cs b/aspnet-core/services/LY.AIO.Applications.Single/IdentityResources/CustomIdentityResources.cs new file mode 100644 index 000000000..feefc80df --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/IdentityResources/CustomIdentityResources.cs @@ -0,0 +1,19 @@ +using LINGYUN.Abp.Identity; +using IdentityServer4.Models; + +namespace LY.AIO.Applications.Single.IdentityResources; + +public class CustomIdentityResources +{ + public class AvatarUrl : IdentityResource + { + public AvatarUrl() + { + Name = IdentityConsts.ClaimType.Avatar.Name; + DisplayName = IdentityConsts.ClaimType.Avatar.DisplayName; + Description = IdentityConsts.ClaimType.Avatar.Description; + Emphasize = true; + UserClaims = new string[] { IdentityConsts.ClaimType.Avatar.Name }; + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj b/aspnet-core/services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj new file mode 100644 index 000000000..d135a63ea --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj @@ -0,0 +1,272 @@ + + + + + + net8.0 + enable + LY.AIO.Applications.Single + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs b/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs new file mode 100644 index 000000000..f2f66239a --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs @@ -0,0 +1,935 @@ +using Elsa; +using Elsa.Options; +using LINGYUN.Abp.Aliyun.Localization; +using LINGYUN.Abp.BackgroundTasks; +using LINGYUN.Abp.DataProtectionManagement; +using LINGYUN.Abp.ExceptionHandling; +using LINGYUN.Abp.ExceptionHandling.Emailing; +using LINGYUN.Abp.Exporter.MiniExcel; +using LINGYUN.Abp.Idempotent; +using LINGYUN.Abp.Identity.Session; +using LINGYUN.Abp.IdentityServer.IdentityResources; +using LINGYUN.Abp.Localization.CultureMap; +using LINGYUN.Abp.Notifications; +using LINGYUN.Abp.OpenIddict.AspNetCore.Session; +using LINGYUN.Abp.OpenIddict.LinkUser; +using LINGYUN.Abp.OpenIddict.Permissions; +using LINGYUN.Abp.OpenIddict.Portal; +using LINGYUN.Abp.OpenIddict.Sms; +using LINGYUN.Abp.OpenIddict.WeChat; +using LINGYUN.Abp.Saas; +using LINGYUN.Abp.Serilog.Enrichers.Application; +using LINGYUN.Abp.Serilog.Enrichers.UniqueId; +using LINGYUN.Abp.Tencent.Localization; +using LINGYUN.Abp.TextTemplating; +using LINGYUN.Abp.WebhooksManagement; +using LINGYUN.Abp.WeChat.Common.Messages.Handlers; +using LINGYUN.Abp.WeChat.Localization; +using LINGYUN.Abp.WeChat.Work; +using LINGYUN.Abp.Wrapper; +using LINGYUN.Platform.Localization; +using LY.AIO.Applications.Single.Authentication; +using LY.AIO.Applications.Single.IdentityResources; +using LY.AIO.Applications.Single.Microsoft.Extensions.DependencyInjection; +using LY.AIO.Applications.Single.WeChat.Official.Messages; +using Medallion.Threading; +using Medallion.Threading.Redis; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.Extensions.Caching.StackExchangeRedis; +using Microsoft.IdentityModel.Logging; +using Microsoft.OpenApi.Models; +using MiniExcelLibs.Attributes; +using OpenIddict.Server; +using OpenIddict.Server.AspNetCore; +using Quartz; +using StackExchange.Redis; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text.Encodings.Web; +using System.Text.Unicode; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.AntiForgery; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.Auditing; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.BlobStoring; +using Volo.Abp.BlobStoring.FileSystem; +using Volo.Abp.Caching; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Features; +using Volo.Abp.GlobalFeatures; +using Volo.Abp.Http.Client; +using Volo.Abp.Identity.Localization; +using Volo.Abp.IdentityServer; +using Volo.Abp.IdentityServer.Localization; +using Volo.Abp.Json; +using Volo.Abp.Json.SystemTextJson; +using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; +using Volo.Abp.OpenIddict; +using Volo.Abp.OpenIddict.Localization; +using Volo.Abp.PermissionManagement; +using Volo.Abp.Quartz; +using Volo.Abp.Security.Claims; +using Volo.Abp.SettingManagement; +using Volo.Abp.SettingManagement.Localization; +using Volo.Abp.Threading; +using Volo.Abp.UI.Navigation.Urls; +using Volo.Abp.VirtualFileSystem; +using VoloAbpExceptionHandlingOptions = Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingOptions; + +namespace LY.AIO.Applications.Single; + +public partial class MicroServiceApplicationsSingleModule +{ + protected const string DefaultCorsPolicyName = "Default"; + public static string ApplicationName { get; set; } = "MicroService-Applications-Single"; + private readonly static OneTimeRunner OneTimeRunner = new(); + + private void PreConfigureFeature() + { + OneTimeRunner.Run(() => + { + GlobalFeatureManager.Instance.Modules.Editions().EnableAll(); + }); + } + + private void PreConfigureApp(IConfiguration configuration) + { + AbpSerilogEnrichersConsts.ApplicationName = ApplicationName; + + PreConfigure(options => + { + // 以开放端口区别,应在0-31之间 + options.SnowflakeIdOptions.WorkerId = 1; + options.SnowflakeIdOptions.WorkerIdBits = 5; + options.SnowflakeIdOptions.DatacenterId = 1; + }); + + if (configuration.GetValue("App:ShowPii")) + { + IdentityModelEventSource.ShowPII = true; + } + } + + private void PreConfigureAuthServer(IConfiguration configuration) + { + PreConfigure(builder => + { + builder.AddValidation(options => + { + //options.AddAudiences("lingyun-abp-application"); + + options.UseLocalServer(); + + options.UseAspNetCore(); + + options.UseDataProtection(); + }); + }); + } + + private void PreConfigureIdentity() + { + PreConfigure(builder => + { + builder.AddDefaultTokenProviders(); + }); + } + + private void PreConfigureCertificate(IConfiguration configuration, IWebHostEnvironment environment) + { + var cerConfig = configuration.GetSection("Certificates"); + if (environment.IsProduction() && cerConfig.Exists()) + { + // 开发环境下存在证书配置 + // 且证书文件存在则使用自定义的证书文件来启动Ids服务器 + var cerPath = Path.Combine(environment.ContentRootPath, cerConfig["CerPath"]); + if (File.Exists(cerPath)) + { + var certificate = new X509Certificate2(cerPath, cerConfig["Password"]); + + if (configuration.GetValue("AuthServer:UseOpenIddict")) + { + PreConfigure(options => + { + //https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html + options.AddDevelopmentEncryptionAndSigningCertificate = false; + }); + + PreConfigure(builder => + { + builder.AddSigningCertificate(certificate); + builder.AddEncryptionCertificate(certificate); + + builder.UseDataProtection(); + + // 禁用https + builder.UseAspNetCore() + .DisableTransportSecurityRequirement(); + }); + } + else + { + PreConfigure(options => + { + options.AddDeveloperSigningCredential = false; + }); + + PreConfigure(builder => + { + builder.AddSigningCredential(certificate); + }); + } + } + } + else + { + if (configuration.GetValue("AuthServer:UseOpenIddict")) + { + PreConfigure(options => + { + //https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html + options.AddDevelopmentEncryptionAndSigningCertificate = false; + }); + + PreConfigure(builder => + { + //https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html + using (var algorithm = RSA.Create(keySizeInBits: 2048)) + { + var subject = new X500DistinguishedName("CN=Fabrikam Encryption Certificate"); + var request = new CertificateRequest(subject, algorithm, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature, critical: true)); + var certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(2)); + builder.AddSigningCertificate(certificate); + } + + using (var algorithm = RSA.Create(keySizeInBits: 2048)) + { + var subject = new X500DistinguishedName("CN=Fabrikam Signing Certificate"); + var request = new CertificateRequest(subject, algorithm, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.KeyEncipherment, critical: true)); + var certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(2)); + builder.AddEncryptionCertificate(certificate); + } + + builder.UseDataProtection(); + + // 禁用https + builder.UseAspNetCore() + .DisableTransportSecurityRequirement(); + }); + } + } + } + + private void PreConfigureQuartz(IConfiguration configuration) + { + PreConfigure(options => + { + // 如果使用持久化存储, 则配置quartz持久层 + if (configuration.GetSection("Quartz:UsePersistentStore").Get()) + { + var settings = configuration.GetSection("Quartz:Properties").Get>(); + if (settings != null) + { + foreach (var setting in settings) + { + options.Properties[setting.Key] = setting.Value; + } + } + + options.Configurator += (config) => + { + config.UsePersistentStore(store => + { + store.UseProperties = false; + store.UseNewtonsoftJsonSerializer(); + }); + }; + } + }); + } + + private void PreConfigureElsa(IServiceCollection services, IConfiguration configuration) + { + var elsaSection = configuration.GetSection("Elsa"); + var startups = new[] + { + typeof(Elsa.Activities.Console.Startup), + typeof(Elsa.Activities.Http.Startup), + typeof(Elsa.Activities.UserTask.Startup), + typeof(Elsa.Activities.Temporal.Quartz.Startup), + typeof(Elsa.Activities.Email.Startup), + typeof(Elsa.Scripting.JavaScript.Startup), + typeof(Elsa.Activities.Webhooks.Startup), + }; + + PreConfigure(elsa => + { + elsa + .AddActivitiesFrom() + .AddWorkflowsFrom() + .AddFeatures(startups, configuration) + .ConfigureWorkflowChannels(options => elsaSection.GetSection("WorkflowChannels").Bind(options)); + + elsa.DistributedLockingOptionsBuilder + .UseProviderFactory(sp => name => + { + var provider = sp.GetRequiredService(); + + return provider.CreateLock(name); + }); + }); + + services.AddNotificationHandlersFrom(); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(Elsa.Webhooks.Api.Endpoints.List).Assembly); + }); + } + + private void ConfigureAuthServer(IConfiguration configuration) + { + Configure(builder => + { + builder.DisableTransportSecurityRequirement(); + }); + + Configure(options => + { + options.DisableTransportSecurityRequirement = true; + }); + + Configure(options => + { + var lifetime = configuration.GetSection("OpenIddict:Lifetime"); + options.AuthorizationCodeLifetime = lifetime.GetValue("AuthorizationCode", options.AuthorizationCodeLifetime); + options.AccessTokenLifetime = lifetime.GetValue("AccessToken", options.AccessTokenLifetime); + options.DeviceCodeLifetime = lifetime.GetValue("DeviceCode", options.DeviceCodeLifetime); + options.IdentityTokenLifetime = lifetime.GetValue("IdentityToken", options.IdentityTokenLifetime); + options.RefreshTokenLifetime = lifetime.GetValue("RefreshToken", options.RefreshTokenLifetime); + options.RefreshTokenReuseLeeway = lifetime.GetValue("RefreshTokenReuseLeeway", options.RefreshTokenReuseLeeway); + options.UserCodeLifetime = lifetime.GetValue("UserCode", options.UserCodeLifetime); + }); + Configure(options => + { + options.PersistentSessionGrantTypes.Add(SmsTokenExtensionGrantConsts.GrantType); + options.PersistentSessionGrantTypes.Add(PortalTokenExtensionGrantConsts.GrantType); + options.PersistentSessionGrantTypes.Add(LinkUserTokenExtensionGrantConsts.GrantType); + options.PersistentSessionGrantTypes.Add(WeChatTokenExtensionGrantConsts.OfficialGrantType); + options.PersistentSessionGrantTypes.Add(WeChatTokenExtensionGrantConsts.MiniProgramGrantType); + options.PersistentSessionGrantTypes.Add(AbpWeChatWorkGlobalConsts.GrantType); + }); + } + + private void ConfigureEndpoints(IServiceCollection services) + { + // 不需要 + //Configure(options => + //{ + // options.EndpointConfigureActions.Add( + // (context) => + // { + // context.Endpoints.MapFallbackToPage("/_Host"); + // }); + //}); + var preActions = services.GetPreConfigureActions(); + + services.AddAbpApiVersioning(options => + { + options.ReportApiVersions = true; + options.AssumeDefaultVersionWhenUnspecified = true; + + //options.ApiVersionReader = new HeaderApiVersionReader("api-version"); //Supports header too + //options.ApiVersionReader = new MediaTypeApiVersionReader(); //Supports accept header too + }, mvcOptions => + { + mvcOptions.ConfigureAbp(preActions.Configure()); + }); + + //services.AddApiVersioning(config => + //{ + // // Specify the default API Version as 1.0 + // config.DefaultApiVersion = new ApiVersion(1, 0); + // // Advertise the API versions supported for the particular endpoint (through 'api-supported-versions' response header which lists all available API versions for that endpoint) + // config.ReportApiVersions = true; + //}); + + //services.AddVersionedApiExplorer(options => + //{ + // // add the versioned api explorer, which also adds IApiVersionDescriptionProvider service + // // note: the specified format code will format the version as "'v'major[.minor][-status]" + // options.GroupNameFormat = "'v'VVV"; + + // // note: this option is only necessary when versioning by url segment. the SubstitutionFormat + // // can also be used to control the format of the API version in route templates + // options.SubstituteApiVersionInUrl = true; + //}); + } + + private void ConfigureKestrelServer() + { + Configure(options => + { + options.Limits.MaxRequestBodySize = null; + options.Limits.MaxRequestBufferSize = null; + }); + } + + private void ConfigureBlobStoring(IConfiguration configuration) + { + Configure(options => + { + options.Containers.ConfigureAll((containerName, containerConfiguration) => + { + containerConfiguration.UseFileSystem(fileSystem => + { + fileSystem.BasePath = Path.Combine(Directory.GetCurrentDirectory(), "blobs"); + }); + + //containerConfiguration.UseMinio(minio => + //{ + // configuration.GetSection("Minio").Bind(minio); + //}); + }); + }); + } + + private void ConfigureBackgroundTasks() + { + Configure(options => + { + options.NodeName = ApplicationName; + options.JobCleanEnabled = true; + options.JobFetchEnabled = true; + options.JobCheckEnabled = true; + }); + } + + private void ConfigureTextTemplating(IConfiguration configuration) + { + if (configuration.GetValue("TextTemplating:IsDynamicStoreEnabled")) + { + Configure(options => + { + options.IsDynamicTemplateDefinitionStoreEnabled = true; + }); + } + } + + private void ConfigureFeatureManagement(IConfiguration configuration) + { + if (configuration.GetValue("FeatureManagement:IsDynamicStoreEnabled")) + { + Configure(options => + { + options.IsDynamicFeatureStoreEnabled = true; + }); + } + Configure(options => + { + options.ProviderPolicies[EditionFeatureValueProvider.ProviderName] = AbpSaasPermissions.Editions.ManageFeatures; + options.ProviderPolicies[TenantFeatureValueProvider.ProviderName] = AbpSaasPermissions.Tenants.ManageFeatures; + }); + } + + private void ConfigureSettingManagement(IConfiguration configuration) + { + if (configuration.GetValue("SettingManagement:IsDynamicStoreEnabled")) + { + Configure(options => + { + options.IsDynamicSettingStoreEnabled = true; + }); + } + } + + private void ConfigureWebhooksManagement(IConfiguration configuration) + { + if (configuration.GetValue("WebhooksManagement:IsDynamicStoreEnabled")) + { + Configure(options => + { + options.IsDynamicWebhookStoreEnabled = true; + }); + } + } + /// + /// 配置数据导出 + /// + private void ConfigureExporter() + { + Configure(options => + { + // options.MapExportSetting(typeof(BookDto), config => + // { + // config.DynamicColumns = new[] + // { + // // 忽略某些字段 + // new DynamicExcelColumn(nameof(BookDto.AuthorId)){ Ignore = true }, + // new DynamicExcelColumn(nameof(BookDto.LastModificationTime)){ Ignore = true }, + // new DynamicExcelColumn(nameof(BookDto.LastModifierId)){ Ignore = true }, + // new DynamicExcelColumn(nameof(BookDto.CreationTime)){ Ignore = true }, + // new DynamicExcelColumn(nameof(BookDto.CreatorId)){ Ignore = true }, + // new DynamicExcelColumn(nameof(BookDto.Id)){ Ignore = true }, + // }; + // }); + }); + } + /// + /// 配置数据权限 + /// + private void ConfigureEntityDataProtected() + { + // Configure(options => + // { + // options.AddEntities(typeof(DemoResource), + // new[] + // { + // typeof(Book), + // }); + // }); + } + + private void ConfigurePermissionManagement(IConfiguration configuration) + { + if (configuration.GetValue("PermissionManagement:IsDynamicStoreEnabled")) + { + Configure(options => + { + options.IsDynamicPermissionStoreEnabled = true; + }); + } + Configure(options => + { + // Rename IdentityServer.Client.ManagePermissions + // See https://github.com/abpframework/abp/blob/dev/modules/identityserver/src/Volo.Abp.PermissionManagement.Domain.IdentityServer/Volo/Abp/PermissionManagement/IdentityServer/AbpPermissionManagementDomainIdentityServerModule.cs + options.ProviderPolicies[ClientPermissionValueProvider.ProviderName] = AbpOpenIddictPermissions.Applications.ManagePermissions; + + //if (configuration.GetValue("AuthServer:UseOpenIddict")) + //{ + // options.ProviderPolicies[ClientPermissionValueProvider.ProviderName] = AbpOpenIddictPermissions.Applications.ManagePermissions; + //} + //else + //{ + // options.ProviderPolicies[ClientPermissionValueProvider.ProviderName] = AbpIdentityServerPermissions.Clients.ManagePermissions; + //} + }); + } + + private void ConfigureNotificationManagement(IConfiguration configuration) + { + if (configuration.GetValue("NotificationsManagement:IsDynamicStoreEnabled")) + { + Configure(options => + { + options.IsDynamicNotificationsStoreEnabled = true; + }); + } + } + + private void ConfigureDistributedLock(IServiceCollection services, IConfiguration configuration) + { + var distributedLockEnabled = configuration["DistributedLock:IsEnabled"]; + if (distributedLockEnabled.IsNullOrEmpty() || bool.Parse(distributedLockEnabled)) + { + var redis = ConnectionMultiplexer.Connect(configuration["DistributedLock:Redis:Configuration"]); + services.AddSingleton(_ => new RedisDistributedSynchronizationProvider(redis.GetDatabase())); + } + } + + private void ConfigureVirtualFileSystem() + { + Configure(options => + { + options.FileSets.AddEmbedded("LY.MicroService.Applications.Single"); + }); + } + + private void ConfigureIdempotent() + { + Configure(options => + { + options.IsEnabled = true; + options.DefaultTimeout = 0; + }); + } + + private void ConfigureDbContext() + { + Configure(options => + { + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);//解决PostgreSql设置为utc时间后无法写入local时区的问题 + options.UseNpgsql(); + + // options.UseMySQL(); + }); + } + + private void ConfigureDataSeeder() + { + Configure(options => + { + options.Resources.Add(new CustomIdentityResources.AvatarUrl()); + }); + } + + private void ConfigureExceptionHandling() + { + // 自定义需要处理的异常 + Configure(options => + { + // 加入需要处理的异常类型 + options.Handlers.Add(); + options.Handlers.Add(); + options.Handlers.Add(); + options.Handlers.Add(); + options.Handlers.Add(); + options.Handlers.Add(); + }); + // 自定义需要发送邮件通知的异常类型 + Configure(options => + { + // 是否发送堆栈信息 + options.SendStackTrace = true; + // 未指定异常接收者的默认接收邮件 + // 指定自己的邮件地址 + }); + + Configure(options => + { + options.SendStackTraceToClients = false; + options.SendExceptionsDetailsToClients = false; + }); + } + + private void ConfigureJsonSerializer(IConfiguration configuration) + { + // 统一时间日期格式 + Configure(options => + { + var jsonConfiguration = configuration.GetSection("Json"); + if (jsonConfiguration.Exists()) + { + jsonConfiguration.Bind(options); + } + }); + // 中文序列化的编码问题 + Configure(options => + { + options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); + }); + } + + private void ConfigureCaching(IConfiguration configuration) + { + Configure(options => + { + configuration.GetSection("DistributedCache").Bind(options); + }); + + Configure(options => + { + var redisConfig = ConfigurationOptions.Parse(options.Configuration); + options.ConfigurationOptions = redisConfig; + options.InstanceName = configuration["Redis:InstanceName"]; + }); + } + + private void ConfigureMultiTenancy(IConfiguration configuration) + { + // 多租户 + Configure(options => + { + options.IsEnabled = true; + }); + + var tenantResolveCfg = configuration.GetSection("App:Domains"); + if (tenantResolveCfg.Exists()) + { + Configure(options => + { + var domains = tenantResolveCfg.Get(); + foreach (var domain in domains) + { + options.AddDomainTenantResolver(domain); + } + }); + } + } + + private void ConfigureAuditing(IConfiguration configuration) + { + Configure(options => + { + options.ApplicationName = ApplicationName; + // 是否启用实体变更记录 + var allEntitiesSelectorIsEnabled = configuration["Auditing:AllEntitiesSelector"]; + if (allEntitiesSelectorIsEnabled.IsNullOrWhiteSpace() || + (bool.TryParse(allEntitiesSelectorIsEnabled, out var enabled) && enabled)) + { + options.EntityHistorySelectors.AddAllEntities(); + } + }); + } + + private void ConfigureSwagger(IServiceCollection services) + { + // Swagger + services.AddSwaggerGen( + options => + { + options.SwaggerDoc("v1", new OpenApiInfo { Title = "App API", Version = "v1" }); + options.DocInclusionPredicate((docName, description) => true); + options.CustomSchemaIds(type => type.FullName); + options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme + { + Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"", + Name = "Authorization", + In = ParameterLocation.Header, + Scheme = "bearer", + Type = SecuritySchemeType.Http, + BearerFormat = "JWT" + }); + options.AddSecurityRequirement(new OpenApiSecurityRequirement + { + { + new OpenApiSecurityScheme + { + Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer" } + }, + new string[] { } + } + }); + options.OperationFilter(); + }); + } + + private void ConfigureIdentity(IConfiguration configuration) + { + // 增加配置文件定义,在新建租户时需要 + Configure(options => + { + var identityConfiguration = configuration.GetSection("Identity"); + if (identityConfiguration.Exists()) + { + identityConfiguration.Bind(options); + } + }); + Configure(options => + { + options.IsDynamicClaimsEnabled = true; + }); + Configure(options => + { + options.IsCleanupEnabled = true; + }); + } + + private void ConfigureMvcUiTheme() + { + Configure(options => + { + //options.StyleBundles.Configure( + // LeptonXLiteThemeBundles.Styles.Global, + // bundle => + // { + // bundle.AddFiles("/global-styles.css"); + // } + //); + }); + } + + private void ConfigureLocalization() + { + Configure(options => + { + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + + options + .AddLanguagesMapOrUpdate( + "vue-admin-element-ui", + new NameValue("zh-Hans", "zh"), + new NameValue("en", "en")); + + // vben admin 语言映射 + options + .AddLanguagesMapOrUpdate( + "vben-admin-ui", + new NameValue("zh_CN", "zh-Hans")); + + options.Resources.Get() + .AddBaseTypes( + typeof(IdentityResource), + typeof(AliyunResource), + typeof(TencentCloudResource), + typeof(WeChatResource), + typeof(PlatformResource), + typeof(AbpOpenIddictResource), + typeof(AbpIdentityServerResource)); + + options.UseAllPersistence(); + }); + + 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); + }); + } + + private void ConfigureWrapper() + { + Configure(options => + { + options.IsEnabled = true; + // options.IsWrapUnauthorizedEnabled = true; + options.IgnoreNamespaces.Add("Elsa"); + }); + } + + private void PreConfigureWrapper() + { + //PreConfigure(options => + //{ + // options.ProxyRequestActions.Add( + // (appid, httprequestmessage) => + // { + // httprequestmessage.Headers.TryAddWithoutValidation(AbpHttpWrapConsts.AbpDontWrapResult, "true"); + // }); + //}); + + PreConfigure(options => + { + options.ProxyClientActions.Add( + (_, _, client) => + { + client.DefaultRequestHeaders.TryAddWithoutValidation(AbpHttpWrapConsts.AbpDontWrapResult, "true"); + }); + }); + } + + private void ConfigureAuditing() + { + Configure(options => + { + // options.IsEnabledForGetRequests = true; + options.ApplicationName = ApplicationName; + }); + } + + private void ConfigureUrls(IConfiguration configuration) + { + Configure(options => + { + var applicationConfiguration = configuration.GetSection("App:Urls:Applications"); + foreach (var appConfig in applicationConfiguration.GetChildren()) + { + options.Applications[appConfig.Key].RootUrl = appConfig["RootUrl"]; + foreach (var urlsConfig in appConfig.GetSection("Urls").GetChildren()) + { + options.Applications[appConfig.Key].Urls[urlsConfig.Key] = urlsConfig.Value; + } + } + }); + } + + private void ConfigureSecurity(IServiceCollection services, IConfiguration configuration, bool isDevelopment = false) + { + Configure(options => + { + options.AutoValidate = false; + }); + + services.Replace(ServiceLifetime.Scoped); + + services.AddAuthentication() + .AddAbpJwtBearer(options => + { + configuration.GetSection("AuthServer").Bind(options); + + options.Events ??= new JwtBearerEvents(); + options.Events.OnMessageReceived = context => + { + var accessToken = context.Request.Query["access_token"]; + var path = context.HttpContext.Request.Path; + if (!string.IsNullOrEmpty(accessToken) && + (path.StartsWithSegments("/api/files"))) + { + context.Token = accessToken; + } + return Task.CompletedTask; + }; + }); + + if (!isDevelopment) + { + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + services + .AddDataProtection() + .SetApplicationName("LINGYUN.Abp.Application") + .PersistKeysToStackExchangeRedis(redis, "LINGYUN.Abp.Application:DataProtection:Protection-Keys"); + } + + services.AddSameSiteCookiePolicy(); + } + + private void ConfigureCors(IServiceCollection services, IConfiguration configuration) + { + services.AddCors(options => + { + options.AddPolicy(DefaultCorsPolicyName, builder => + { + builder + .WithOrigins( + configuration["App:CorsOrigins"] + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() + ) + .WithAbpExposedHeaders() + .WithAbpWrapExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } + + private void ConfigureWeChat() + { + Configure(options => + { + // 回复文本消息 + options.MapMessage< + LINGYUN.Abp.WeChat.Official.Messages.Models.TextMessage, + TextMessageReplyContributor>(); + // 处理关注事件 + options.MapEvent< + LINGYUN.Abp.WeChat.Official.Messages.Models.UserSubscribeEvent, + UserSubscribeEventContributor>(); + + options.MapMessage< + LINGYUN.Abp.WeChat.Work.Common.Messages.Models.TextMessage, + WeChat.Work.Messages.TextMessageReplyContributor>(); + }); + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.cs new file mode 100644 index 000000000..a0c2ce2d6 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -0,0 +1,394 @@ +using LINGYUN.Abp.Account; +using LINGYUN.Abp.Account.Templates; +using LINGYUN.Abp.Aliyun.SettingManagement; +using LINGYUN.Abp.AspNetCore.HttpOverrides; +using LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper; +using LINGYUN.Abp.AspNetCore.Mvc.Localization; +using LINGYUN.Abp.AspNetCore.Mvc.Wrapper; +using LINGYUN.Abp.Auditing; +using LINGYUN.Abp.AuditLogging.EntityFrameworkCore; +using LINGYUN.Abp.Authentication.QQ; +using LINGYUN.Abp.Authentication.WeChat; +using LINGYUN.Abp.Authorization.OrganizationUnits; +using LINGYUN.Abp.BackgroundTasks; +using LINGYUN.Abp.BackgroundTasks.Activities; +using LINGYUN.Abp.BackgroundTasks.DistributedLocking; +using LINGYUN.Abp.BackgroundTasks.EventBus; +using LINGYUN.Abp.BackgroundTasks.ExceptionHandling; +using LINGYUN.Abp.BackgroundTasks.Jobs; +using LINGYUN.Abp.BackgroundTasks.Notifications; +using LINGYUN.Abp.BackgroundTasks.Quartz; +using LINGYUN.Abp.CachingManagement; +using LINGYUN.Abp.CachingManagement.StackExchangeRedis; +using LINGYUN.Abp.Dapr.Client; +using LINGYUN.Abp.Data.DbMigrator; +using LINGYUN.Abp.DataProtectionManagement; +using LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore; +// using LINGYUN.Abp.Demo; +// using LINGYUN.Abp.Demo.EntityFrameworkCore; +using LINGYUN.Abp.ExceptionHandling; +using LINGYUN.Abp.ExceptionHandling.Emailing; +using LINGYUN.Abp.Exporter.MiniExcel; +using LINGYUN.Abp.FeatureManagement; +using LINGYUN.Abp.FeatureManagement.HttpApi; +using LINGYUN.Abp.Features.LimitValidation; +using LINGYUN.Abp.Features.LimitValidation.Redis.Client; +using LINGYUN.Abp.Http.Client.Wrapper; +using LINGYUN.Abp.Identity; +using LINGYUN.Abp.Identity.AspNetCore.Session; +using LINGYUN.Abp.Identity.EntityFrameworkCore; +using LINGYUN.Abp.Identity.Notifications; +using LINGYUN.Abp.Identity.OrganizaztionUnits; +using LINGYUN.Abp.Identity.Session.AspNetCore; +using LINGYUN.Abp.Identity.WeChat; +using LINGYUN.Abp.IdGenerator; +using LINGYUN.Abp.IM.SignalR; +using LINGYUN.Abp.Localization.CultureMap; +using LINGYUN.Abp.Localization.Persistence; +using LINGYUN.Abp.LocalizationManagement; +using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; +using LINGYUN.Abp.MessageService; +using LINGYUN.Abp.MessageService.EntityFrameworkCore; +using LINGYUN.Abp.MultiTenancy.Editions; +using LINGYUN.Abp.Notifications; +using LINGYUN.Abp.Notifications.Common; +using LINGYUN.Abp.Notifications.Emailing; +using LINGYUN.Abp.Notifications.EntityFrameworkCore; +using LINGYUN.Abp.Notifications.SignalR; +using LINGYUN.Abp.Notifications.WeChat.MiniProgram; +using LINGYUN.Abp.OpenApi.Authorization; +using LINGYUN.Abp.OpenIddict; +using LINGYUN.Abp.OpenIddict.AspNetCore; +using LINGYUN.Abp.OpenIddict.AspNetCore.Session; +using LINGYUN.Abp.OpenIddict.Portal; +using LINGYUN.Abp.OpenIddict.Sms; +using LINGYUN.Abp.OpenIddict.WeChat; +using LINGYUN.Abp.OpenIddict.WeChat.Work; +using LINGYUN.Abp.OssManagement; +using LINGYUN.Abp.OssManagement.FileSystem; +// using LINGYUN.Abp.OssManagement.Imaging; +using LINGYUN.Abp.OssManagement.SettingManagement; +using LINGYUN.Abp.PermissionManagement; +using LINGYUN.Abp.PermissionManagement.HttpApi; +using LINGYUN.Abp.PermissionManagement.OrganizationUnits; +using LINGYUN.Abp.Saas; +using LINGYUN.Abp.Saas.EntityFrameworkCore; +using LINGYUN.Abp.Serilog.Enrichers.Application; +using LINGYUN.Abp.Serilog.Enrichers.UniqueId; +using LINGYUN.Abp.SettingManagement; +using LINGYUN.Abp.Sms.Aliyun; +using LINGYUN.Abp.TaskManagement; +using LINGYUN.Abp.TaskManagement.EntityFrameworkCore; +using LINGYUN.Abp.Tencent.QQ; +using LINGYUN.Abp.Tencent.SettingManagement; +using LINGYUN.Abp.TextTemplating; +using LINGYUN.Abp.TextTemplating.EntityFrameworkCore; +using LINGYUN.Abp.UI.Navigation; +using LINGYUN.Abp.UI.Navigation.VueVbenAdmin; +using LINGYUN.Abp.Webhooks; +using LINGYUN.Abp.Webhooks.EventBus; +using LINGYUN.Abp.Webhooks.Identity; +using LINGYUN.Abp.Webhooks.Saas; +using LINGYUN.Abp.WebhooksManagement; +using LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore; +using LINGYUN.Abp.WeChat.MiniProgram; +using LINGYUN.Abp.WeChat.Official; +using LINGYUN.Abp.WeChat.Official.Handlers; +using LINGYUN.Abp.WeChat.SettingManagement; +using LINGYUN.Abp.WeChat.Work; +using LINGYUN.Abp.WeChat.Work.Handlers; +using LINGYUN.Platform; +using LINGYUN.Platform.EntityFrameworkCore; +using LINGYUN.Platform.HttpApi; +using LINGYUN.Platform.Settings.VueVbenAdmin; +using LINGYUN.Platform.Theme.VueVbenAdmin; +using Volo.Abp; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.Authentication.JwtBearer; +using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore.PostgreSql; +using Volo.Abp.EventBus; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Imaging; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.Identity; +using Volo.Abp.PermissionManagement.OpenIddict; +using Volo.Abp.SettingManagement; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.Threading; +// using LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql; +// using Volo.Abp.EntityFrameworkCore.MySQL; + +namespace LY.AIO.Applications.Single; + +[DependsOn( + typeof(AbpAccountApplicationModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpAccountWebOpenIddictModule), + typeof(AbpAuditingApplicationModule), + typeof(AbpAuditingHttpApiModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpCachingManagementStackExchangeRedisModule), + typeof(AbpCachingManagementApplicationModule), + typeof(AbpCachingManagementHttpApiModule), + typeof(AbpIdentityAspNetCoreSessionModule), + typeof(AbpIdentitySessionAspNetCoreModule), + typeof(AbpIdentityNotificationsModule), + typeof(AbpIdentityDomainModule), + typeof(AbpIdentityApplicationModule), + typeof(AbpIdentityHttpApiModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpLocalizationManagementDomainModule), + typeof(AbpLocalizationManagementApplicationModule), + typeof(AbpLocalizationManagementHttpApiModule), + typeof(AbpLocalizationManagementEntityFrameworkCoreModule), + typeof(AbpSerilogEnrichersApplicationModule), + typeof(AbpSerilogEnrichersUniqueIdModule), + typeof(AbpMessageServiceDomainModule), + typeof(AbpMessageServiceApplicationModule), + typeof(AbpMessageServiceHttpApiModule), + typeof(AbpMessageServiceEntityFrameworkCoreModule), + typeof(AbpNotificationsDomainModule), + typeof(AbpNotificationsApplicationModule), + typeof(AbpNotificationsHttpApiModule), + typeof(AbpNotificationsEntityFrameworkCoreModule), + + //typeof(AbpIdentityServerSessionModule), + //typeof(AbpIdentityServerApplicationModule), + //typeof(AbpIdentityServerHttpApiModule), + //typeof(AbpIdentityServerEntityFrameworkCoreModule), + + typeof(AbpOpenIddictAspNetCoreModule), + typeof(AbpOpenIddictAspNetCoreSessionModule), + typeof(AbpOpenIddictApplicationModule), + typeof(AbpOpenIddictHttpApiModule), + typeof(AbpOpenIddictEntityFrameworkCoreModule), + typeof(AbpOpenIddictSmsModule), + typeof(AbpOpenIddictPortalModule), + typeof(AbpOpenIddictWeChatModule), + typeof(AbpOpenIddictWeChatWorkModule), + + //typeof(AbpOssManagementMinioModule), // 取消注释以使用Minio + typeof(AbpOssManagementFileSystemModule), + // typeof(AbpOssManagementImagingModule), + typeof(AbpOssManagementDomainModule), + typeof(AbpOssManagementApplicationModule), + typeof(AbpOssManagementHttpApiModule), + typeof(AbpOssManagementSettingManagementModule), + typeof(AbpImagingImageSharpModule), + + typeof(PlatformDomainModule), + typeof(PlatformApplicationModule), + typeof(PlatformHttpApiModule), + typeof(PlatformEntityFrameworkCoreModule), + typeof(PlatformSettingsVueVbenAdminModule), + typeof(PlatformThemeVueVbenAdminModule), + typeof(AbpUINavigationVueVbenAdminModule), + + typeof(AbpSaasDomainModule), + typeof(AbpSaasApplicationModule), + typeof(AbpSaasHttpApiModule), + typeof(AbpSaasEntityFrameworkCoreModule), + + typeof(TaskManagementDomainModule), + typeof(TaskManagementApplicationModule), + typeof(TaskManagementHttpApiModule), + typeof(TaskManagementEntityFrameworkCoreModule), + + typeof(AbpTextTemplatingDomainModule), + typeof(AbpTextTemplatingApplicationModule), + typeof(AbpTextTemplatingHttpApiModule), + typeof(AbpTextTemplatingEntityFrameworkCoreModule), + + typeof(AbpWebhooksModule), + typeof(AbpWebhooksEventBusModule), + typeof(AbpWebhooksIdentityModule), + typeof(AbpWebhooksSaasModule), + typeof(WebhooksManagementDomainModule), + typeof(WebhooksManagementApplicationModule), + typeof(WebhooksManagementHttpApiModule), + typeof(WebhooksManagementEntityFrameworkCoreModule), + + typeof(AbpFeatureManagementApplicationModule), + typeof(AbpFeatureManagementHttpApiModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + + typeof(AbpSettingManagementDomainModule), + typeof(AbpSettingManagementApplicationModule), + typeof(AbpSettingManagementHttpApiModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + + typeof(AbpPermissionManagementApplicationModule), + typeof(AbpPermissionManagementHttpApiModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpPermissionManagementDomainOpenIddictModule), + // typeof(AbpPermissionManagementDomainIdentityServerModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementDomainOrganizationUnitsModule), // 组织机构权限管理 + + typeof(AbpEntityFrameworkCorePostgreSqlModule), + // typeof(AbpEntityFrameworkCoreMySQLModule), + + typeof(AbpAliyunSmsModule), + typeof(AbpAliyunSettingManagementModule), + + typeof(AbpAuthenticationQQModule), + typeof(AbpAuthenticationWeChatModule), + typeof(AbpAuthorizationOrganizationUnitsModule), + typeof(AbpIdentityOrganizaztionUnitsModule), + + typeof(AbpBackgroundTasksModule), + typeof(AbpBackgroundTasksActivitiesModule), + typeof(AbpBackgroundTasksDistributedLockingModule), + typeof(AbpBackgroundTasksEventBusModule), + typeof(AbpBackgroundTasksExceptionHandlingModule), + typeof(AbpBackgroundTasksJobsModule), + typeof(AbpBackgroundTasksNotificationsModule), + typeof(AbpBackgroundTasksQuartzModule), + + typeof(AbpDataProtectionManagementApplicationModule), + typeof(AbpDataProtectionManagementHttpApiModule), + typeof(AbpDataProtectionManagementEntityFrameworkCoreModule), + + // typeof(AbpDemoApplicationModule), + // typeof(AbpDemoHttpApiModule), + // typeof(AbpDemoEntityFrameworkCoreModule), + + typeof(AbpDaprClientModule), + typeof(AbpExceptionHandlingModule), + typeof(AbpEmailingExceptionHandlingModule), + typeof(AbpFeaturesLimitValidationModule), + typeof(AbpFeaturesValidationRedisClientModule), + typeof(AbpAspNetCoreMvcLocalizationModule), + + typeof(AbpLocalizationCultureMapModule), + typeof(AbpLocalizationPersistenceModule), + + typeof(AbpOpenApiAuthorizationModule), + + typeof(AbpIMSignalRModule), + + typeof(AbpNotificationsModule), + typeof(AbpNotificationsCommonModule), + typeof(AbpNotificationsSignalRModule), + typeof(AbpNotificationsEmailingModule), + typeof(AbpMultiTenancyEditionsModule), + + typeof(AbpTencentQQModule), + typeof(AbpTencentCloudSettingManagementModule), + + typeof(AbpIdentityWeChatModule), + typeof(AbpNotificationsWeChatMiniProgramModule), + typeof(AbpWeChatMiniProgramModule), + typeof(AbpWeChatOfficialModule), + typeof(AbpWeChatOfficialApplicationModule), + typeof(AbpWeChatOfficialHttpApiModule), + typeof(AbpWeChatWorkModule), + typeof(AbpWeChatWorkApplicationModule), + typeof(AbpWeChatWorkHttpApiModule), + typeof(AbpWeChatOfficialHandlersModule), + typeof(AbpWeChatWorkHandlersModule), + typeof(AbpWeChatSettingManagementModule), + + typeof(AbpDataDbMigratorModule), + typeof(AbpIdGeneratorModule), + typeof(AbpUINavigationModule), + typeof(AbpAccountTemplatesModule), + typeof(AbpAspNetCoreAuthenticationJwtBearerModule), + typeof(AbpCachingStackExchangeRedisModule), + // typeof(AbpElsaModule), + // typeof(AbpElsaServerModule), + // typeof(AbpElsaActivitiesModule), + // typeof(AbpElsaEntityFrameworkCoreModule), + // typeof(AbpElsaEntityFrameworkCorePostgreSqlModule), + // typeof(AbpElsaModule), + // typeof(AbpElsaServerModule), + // typeof(AbpElsaActivitiesModule), + // typeof(AbpElsaEntityFrameworkCoreModule), + // typeof(AbpElsaEntityFrameworkCoreMySqlModule), + + typeof(AbpExporterMiniExcelModule), + typeof(AbpAspNetCoreMvcUiMultiTenancyModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpHttpClientWrapperModule), + typeof(AbpAspNetCoreMvcWrapperModule), + typeof(AbpAspNetCoreMvcIdempotentWrapperModule), + typeof(AbpAspNetCoreHttpOverridesModule), + typeof(AbpAspNetCoreMvcUiBasicThemeModule), + typeof(AbpEventBusModule), + typeof(AbpAutofacModule) + )] +public partial class MicroServiceApplicationsSingleModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + PreConfigureWrapper(); + PreConfigureFeature(); + PreConfigureIdentity(); + PreConfigureApp(configuration); + PreConfigureQuartz(configuration); + PreConfigureAuthServer(configuration); + PreConfigureElsa(context.Services, configuration); + PreConfigureCertificate(configuration, hostingEnvironment); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.GetConfiguration(); + + ConfigureWeChat(); + ConfigureWrapper(); + ConfigureExporter(); + ConfigureAuditing(); + ConfigureDbContext(); + ConfigureIdempotent(); + ConfigureMvcUiTheme(); + ConfigureDataSeeder(); + ConfigureLocalization(); + ConfigureKestrelServer(); + ConfigureBackgroundTasks(); + ConfigureExceptionHandling(); + ConfigureVirtualFileSystem(); + ConfigureEntityDataProtected(); + ConfigureUrls(configuration); + ConfigureCaching(configuration); + ConfigureAuditing(configuration); + ConfigureIdentity(configuration); + ConfigureAuthServer(configuration); + ConfigureSwagger(context.Services); + ConfigureEndpoints(context.Services); + ConfigureBlobStoring(configuration); + ConfigureMultiTenancy(configuration); + ConfigureJsonSerializer(configuration); + ConfigureTextTemplating(configuration); + ConfigureFeatureManagement(configuration); + ConfigureSettingManagement(configuration); + ConfigureWebhooksManagement(configuration); + ConfigurePermissionManagement(configuration); + ConfigureNotificationManagement(configuration); + ConfigureCors(context.Services, configuration); + ConfigureDistributedLock(context.Services, configuration); + ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment()); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => await OnApplicationInitializationAsync(context)); + } + + public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + { + await context.ServiceProvider.GetRequiredService().SeedAsync(); ; + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Microsoft/Extensions/DependencyInjection/SameSiteCookiesServiceCollectionExtensions.cs b/aspnet-core/services/LY.AIO.Applications.Single/Microsoft/Extensions/DependencyInjection/SameSiteCookiesServiceCollectionExtensions.cs new file mode 100644 index 000000000..9413fb658 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Microsoft/Extensions/DependencyInjection/SameSiteCookiesServiceCollectionExtensions.cs @@ -0,0 +1,67 @@ +namespace LY.AIO.Applications.Single.Microsoft.Extensions.DependencyInjection +{ + public static class SameSiteCookiesServiceCollectionExtensions + { + public static IServiceCollection AddSameSiteCookiePolicy(this IServiceCollection services) + { + services.Configure(options => + { + options.MinimumSameSitePolicy = SameSiteMode.Unspecified; + options.OnAppendCookie = cookieContext => + CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); + options.OnDeleteCookie = cookieContext => + CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); + }); + + return services; + } + + private static void CheckSameSite(HttpContext httpContext, CookieOptions options) + { + if (options.SameSite == SameSiteMode.None) + { + var userAgent = httpContext.Request.Headers["User-Agent"].ToString(); + if (!httpContext.Request.IsHttps || DisallowsSameSiteNone(userAgent)) + { + // For .NET Core < 3.1 set SameSite = (SameSiteMode)(-1) + options.SameSite = SameSiteMode.Unspecified; + } + } + } + + private static bool DisallowsSameSiteNone(string userAgent) + { + // Cover all iOS based browsers here. This includes: + // - Safari on iOS 12 for iPhone, iPod Touch, iPad + // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad + // - Chrome on iOS 12 for iPhone, iPod Touch, iPad + // All of which are broken by SameSite=None, because they use the iOS networking stack + if (userAgent.Contains("CPU iPhone OS 12") || userAgent.Contains("iPad; CPU OS 12")) + { + return true; + } + + // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes: + // - Safari on Mac OS X. + // This does not include: + // - Chrome on Mac OS X + // Because they do not use the Mac OS networking stack. + if (userAgent.Contains("Macintosh; Intel Mac OS X 10_14") && + userAgent.Contains("Version/") && userAgent.Contains("Safari")) + { + return true; + } + + // Cover Chrome 50-69, because some versions are broken by SameSite=None, + // and none in this range require it. + // Note: this covers some pre-Chromium Edge versions, + // but pre-Chromium Edge does not require SameSite=None. + if (userAgent.Contains("Chrome/5") || userAgent.Contains("Chrome/6")) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/ITenantConfigurationCache.cs b/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/ITenantConfigurationCache.cs new file mode 100644 index 000000000..475466d04 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/ITenantConfigurationCache.cs @@ -0,0 +1,10 @@ +using Volo.Abp.MultiTenancy; + +namespace LY.AIO.Applications.Single.MultiTenancy; + +public interface ITenantConfigurationCache +{ + Task RefreshAsync(); + + Task> GetTenantsAsync(); +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/TenantConfigurationCache.cs b/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/TenantConfigurationCache.cs new file mode 100644 index 000000000..e6d81bdcc --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/TenantConfigurationCache.cs @@ -0,0 +1,59 @@ +using LINGYUN.Abp.Saas.Tenants; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; +using Volo.Abp.MultiTenancy; + +namespace LY.AIO.Applications.Single.MultiTenancy; + +public class TenantConfigurationCache : ITenantConfigurationCache, ITransientDependency +{ + protected ITenantRepository TenantRepository { get; } + protected IDistributedCache TenantCache { get; } + + public TenantConfigurationCache( + ITenantRepository tenantRepository, + IDistributedCache tenantCache) + { + TenantRepository = tenantRepository; + TenantCache = tenantCache; + } + + public async virtual Task RefreshAsync() + { + var cacheKey = GetCacheKey(); + + await TenantCache.RemoveAsync(cacheKey); + } + + public async virtual Task> GetTenantsAsync() + { + return (await GetForCacheItemAsync()).Tenants; + } + + protected async virtual Task GetForCacheItemAsync() + { + var cacheKey = GetCacheKey(); + var cacheItem = await TenantCache.GetAsync(cacheKey); + if (cacheItem == null) + { + var allActiveTenants = await TenantRepository.GetListAsync(); + + cacheItem = new TenantConfigurationCacheItem( + allActiveTenants + .Where(t => t.IsActive) + .Select(t => new TenantConfiguration(t.Id, t.Name) + { + IsActive = t.IsActive, + }).ToList()); + + await TenantCache.SetAsync(cacheKey, cacheItem); + } + + return cacheItem; + } + + protected virtual string GetCacheKey() + { + return "_Abp_Tenant_Configuration"; + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/TenantConfigurationCacheItem.cs b/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/TenantConfigurationCacheItem.cs new file mode 100644 index 000000000..023235e3e --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/MultiTenancy/TenantConfigurationCacheItem.cs @@ -0,0 +1,19 @@ +using Volo.Abp.MultiTenancy; + +namespace LY.AIO.Applications.Single.MultiTenancy; + +[IgnoreMultiTenancy] +public class TenantConfigurationCacheItem +{ + public List Tenants { get; set; } + + public TenantConfigurationCacheItem() + { + Tenants = new List(); + } + + public TenantConfigurationCacheItem(List tenants) + { + Tenants = tenants; + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml new file mode 100644 index 000000000..aed9202eb --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml @@ -0,0 +1,103 @@ +@using Volo.Abp.Account.Localization +@using Volo.Abp.Users +@using Microsoft.AspNetCore.Mvc.Localization +@using Microsoft.Extensions.Localization +@using Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo +@using Volo.Abp.AspNetCore.Mvc.UI.Theming +@using Volo.Abp.Data +@using Volo.Abp.Identity.Settings +@using Volo.Abp.Localization +@using Volo.Abp.Settings +@using Volo.Abp.ObjectExtending +@inject IHtmlLocalizer L +@inject ICurrentUser CurrentUser +@inject ISettingProvider SettingManager +@inject IThemeManager ThemeManager +@inject IStringLocalizerFactory StringLocalizerFactory +@model Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo.AccountProfilePersonalInfoManagementGroupViewComponent.PersonalInfoModel +@{ + var isUserNameUpdateEnabled = string.Equals(await SettingManager.GetOrNullAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled), "true", + StringComparison.OrdinalIgnoreCase); + + var isEmailUpdateEnabled = string.Equals(await SettingManager.GetOrNullAsync(IdentitySettingNames.User.IsEmailUpdateEnabled), "true", + StringComparison.OrdinalIgnoreCase); +} + +

@L["PersonalSettings"]


+
+ + + + + + + + + + + + + + + + + + + + @if (CurrentUser.EmailVerified) + { + + } + else + { + @**@ + @L["Validation"].Value + } + + + + + + @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties()) + { + var isAllowed = propertyInfo.Configuration.GetOrDefault(IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit); + + if (isAllowed == null || !isAllowed.Equals(true)) + { + continue; + } + + if (!propertyInfo.Name.EndsWith("_Text")) + { + if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty()) + { + if (propertyInfo.Type.IsEnum) + { + Model.ExtraProperties.ToEnum(propertyInfo.Name, propertyInfo.Type); + } + + + } + else + { + + } + } + } + + + diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js new file mode 100644 index 000000000..55a88e52e --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js @@ -0,0 +1,28 @@ +(function ($) { + $(function () { + var l = abp.localization.getResource("AbpAccount"); + + $('#PersonalSettingsForm').submit(function (e) { + e.preventDefault(); + + if (!$('#PersonalSettingsForm').valid()) { + return false; + } + + var input = $('#PersonalSettingsForm').serializeFormToObject(); + + volo.abp.account.profile.update(input).then(function (result) { + abp.notify.success(l('PersonalSettingsSaved')); + updateConcurrencyStamp(); + }); + }); + }); + + abp.event.on('passwordChanged', updateConcurrencyStamp); + + function updateConcurrencyStamp(){ + volo.abp.account.profile.get().then(function(profile){ + $("#ConcurrencyStamp").val(profile.concurrencyStamp); + }); + } +})(jQuery); diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirm.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirm.cshtml new file mode 100644 index 000000000..63e834b2b --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirm.cshtml @@ -0,0 +1,17 @@ +@page +@inject IHtmlLocalizer L +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.Account.Localization +@model LY.AIO.Applications.Single.Pages.Account.EmailConfirmModel +@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout +
+
+

@L["EmailConfirm"]

+
+ + + @L["Cancel"] + + +
+
diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirm.cshtml.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirm.cshtml.cs new file mode 100644 index 000000000..ea7b4671c --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirm.cshtml.cs @@ -0,0 +1,72 @@ +using LINGYUN.Abp.Account; +using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Account.Localization; +using Volo.Abp.Account.Web.Pages.Account; +using Volo.Abp.Identity; +using Volo.Abp.Validation; + +namespace LY.AIO.Applications.Single.Pages.Account +{ + public class EmailConfirmModel : AccountPageModel + { + [Required] + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid UserId { get; set; } + + [Required] + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ConfirmToken { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrl { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrlHash { get; set; } + + public IMyProfileAppService MyProfileAppService { get; set; } + + public EmailConfirmModel() + { + LocalizationResourceType = typeof(AccountResource); + } + + public async virtual Task OnPostAsync() + { + try + { + ValidateModel(); + + await MyProfileAppService.ConfirmEmailAsync( + new ConfirmEmailInput + { + ConfirmToken = ConfirmToken, + }); + } + catch (AbpIdentityResultException e) + { + if (!string.IsNullOrWhiteSpace(e.Message)) + { + Alerts.Warning(GetLocalizeExceptionMessage(e)); + return Page(); + } + + throw; + } + catch (AbpValidationException) + { + return Page(); + } + + return RedirectToPage("./ConfirmEmailConfirmation", new + { + returnUrl = ReturnUrl, + returnUrlHash = ReturnUrlHash + }); + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirmConfirmation.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirmConfirmation.cshtml new file mode 100644 index 000000000..56c00aeaf --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirmConfirmation.cshtml @@ -0,0 +1,13 @@ +@page +@model LY.AIO.Applications.Single.Pages.Account.EmailConfirmConfirmationModel +@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.Account.Localization +@inject IHtmlLocalizer L +
+
+

@L["EmailConfirm"]

+

@L["YourEmailIsSuccessfullyConfirm"]

+ @L["GoToTheApplication"] +
+
diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirmConfirmation.cshtml.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirmConfirmation.cshtml.cs new file mode 100644 index 000000000..a66f51c1b --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/EmailConfirmConfirmation.cshtml.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Account.Web.Pages.Account; + +namespace LY.AIO.Applications.Single.Pages.Account; + +[AllowAnonymous] +public class EmailConfirmConfirmationModel : AccountPageModel +{ + [BindProperty(SupportsGet = true)] + public string ReturnUrl { get; set; } + + [BindProperty(SupportsGet = true)] + public string ReturnUrlHash { get; set; } + + public async virtual Task OnGetAsync() + { + ReturnUrl = await GetRedirectUrlAsync(ReturnUrl, ReturnUrlHash); + + return Page(); + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendCode.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendCode.cshtml new file mode 100644 index 000000000..1598132ba --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendCode.cshtml @@ -0,0 +1,26 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.Account.Localization +@model LY.AIO.Applications.Single.Pages.Account.SendCodeModel +@inject IHtmlLocalizer L + +
+
+

@L["TwoFactor"]

+
+ + + +
+ +
+
+ @L["SendVerifyCode"] +
+ + @L["Login"] + + +
+
+ diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendCode.cshtml.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendCode.cshtml.cs new file mode 100644 index 000000000..34b2f4c86 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendCode.cshtml.cs @@ -0,0 +1,125 @@ +using LINGYUN.Abp.Account.Emailing; +using LINGYUN.Abp.Identity.Settings; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Volo.Abp; +using Volo.Abp.Account.Localization; +using Volo.Abp.Account.Web.Pages.Account; +using Volo.Abp.Sms; + +namespace LY.AIO.Applications.Single.Pages.Account +{ + public class SendCodeModel : AccountPageModel + { + [BindProperty] + public SendCodeInputModel Input { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrl { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrlHash { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public bool RememberMe { get; set; } + + public IEnumerable Providers { get; set; } + + protected ISmsSender SmsSender { get; } + + protected IAccountEmailVerifySender AccountEmailVerifySender { get; } + + public SendCodeModel( + ISmsSender smsSender, + IAccountEmailVerifySender accountEmailVerifySender) + { + SmsSender = smsSender; + AccountEmailVerifySender = accountEmailVerifySender; + + LocalizationResourceType = typeof(AccountResource); + } + + public virtual async Task OnGetAsync() + { + Input = new SendCodeInputModel(); + + var user = await SignInManager.GetTwoFactorAuthenticationUserAsync(); + if (user == null) + { + // ˫������Ϣ��֤ʧ��,һ�㶼�dz�ʱ�˻����û���Ϣ��� + Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]); + return Page(); + } + var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(user); + Providers = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList(); + + return Page(); + } + + public virtual async Task OnPostAsync() + { + var user = await SignInManager.GetTwoFactorAuthenticationUserAsync(); + if (user == null) + { + Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]); + return Page(); + } + + if (Input.SelectedProvider == "Authenticator") + { + // �û�ͨ���ʼ�/�������ӽ�����Ȩҳ�� + return RedirectToPage("VerifyAuthenticatorCode", new + { + returnUrl = ReturnUrl, + returnUrlHash = ReturnUrlHash, + rememberMe = RememberMe + }); + } + // ������֤�� + var code = await UserManager.GenerateTwoFactorTokenAsync(user, Input.SelectedProvider); + if (string.IsNullOrWhiteSpace(code)) + { + Alerts.Warning(L["InvaidGenerateTwoFactorToken"]); + return Page(); + } + + if (Input.SelectedProvider == "Email") + { + await AccountEmailVerifySender + .SendMailLoginVerifyCodeAsync( + code, + user.UserName, + user.Email); + } + else if (Input.SelectedProvider == "Phone") + { + var phoneNumber = await UserManager.GetPhoneNumberAsync(user); + var templateCode = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsUserSignin); + Check.NotNullOrWhiteSpace(templateCode, nameof(IdentitySettingNames.User.SmsUserSignin)); + + // TODO: �Ժ���չ����ģ�巢�� + var smsMessage = new SmsMessage(phoneNumber, code); + smsMessage.Properties.Add("code", code); + smsMessage.Properties.Add("TemplateCode", templateCode); + + await SmsSender.SendAsync(smsMessage); + } + + return RedirectToPage("VerifyCode", new + { + provider = Input.SelectedProvider, + returnUrl = ReturnUrl, + returnUrlHash = ReturnUrlHash, + rememberMe = RememberMe + }); + } + } + + public class SendCodeInputModel + { + public string SelectedProvider { get; set; } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendEmailConfirm.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendEmailConfirm.cshtml new file mode 100644 index 000000000..68bc7890d --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendEmailConfirm.cshtml @@ -0,0 +1,16 @@ +@page +@inject IHtmlLocalizer L +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.Account.Localization +@model LY.AIO.Applications.Single.Pages.Account.SendEmailConfirmModel +@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout +
+
+

@L["EmailConfirm"]

+
+ + @L["Cancel"] + + +
+
diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendEmailConfirm.cshtml.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendEmailConfirm.cshtml.cs new file mode 100644 index 000000000..c2ef4852f --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/SendEmailConfirm.cshtml.cs @@ -0,0 +1,73 @@ +using LINGYUN.Abp.Account; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Account.Localization; +using Volo.Abp.Account.Web.Pages.Account; +using Volo.Abp.Identity; +using Volo.Abp.Validation; + +namespace LY.AIO.Applications.Single.Pages.Account +{ + public class SendEmailConfirmModel : AccountPageModel + { + [BindProperty(SupportsGet = true)] + public string Email { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrl { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrlHash { get; set; } + + public IMyProfileAppService MyProfileAppService { get; set; } + + public SendEmailConfirmModel() + { + LocalizationResourceType = typeof(AccountResource); + } + + public virtual Task OnGetAsync() + { + Email = CurrentUser.Email; + + return Task.FromResult(Page()); + } + + public async virtual Task OnPostAsync() + { + try + { + ValidateModel(); + + await MyProfileAppService.SendEmailConfirmLinkAsync( + new SendEmailConfirmCodeDto + { + Email = Email, + AppName = "MVC", + ReturnUrl = ReturnUrl, + ReturnUrlHash = ReturnUrlHash + }); + } + catch (AbpIdentityResultException e) + { + if (!string.IsNullOrWhiteSpace(e.Message)) + { + Alerts.Warning(GetLocalizeExceptionMessage(e)); + return Page(); + } + + throw; + } + catch (AbpValidationException) + { + return Page(); + } + + return RedirectToPage("~/Account/Manage", new + { + returnUrl = ReturnUrl + }); + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/TwoFactorSupportedLoginModel.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/TwoFactorSupportedLoginModel.cs new file mode 100644 index 000000000..322cca6be --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/TwoFactorSupportedLoginModel.cs @@ -0,0 +1,63 @@ +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Volo.Abp.Account.Web; +using Volo.Abp.Account.Web.Pages.Account; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; +using Volo.Abp.OpenIddict; +using IdentityOptions = Microsoft.AspNetCore.Identity.IdentityOptions; + +namespace LY.AIO.Applications.Single.Pages.Account +{ + /// + /// 重写登录模型,实现双因素登录 + /// + [Dependency(ReplaceServices = true)] + [ExposeServices(typeof(LoginModel), typeof(OpenIddictSupportedLoginModel))] + public class TwoFactorSupportedLoginModel : OpenIddictSupportedLoginModel + { + public TwoFactorSupportedLoginModel( + IAuthenticationSchemeProvider schemeProvider, + IOptions accountOptions, + IOptions identityOptions, + IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache, + AbpOpenIddictRequestHelper openIddictRequestHelper) + : base(schemeProvider, accountOptions, identityOptions, identityDynamicClaimsPrincipalContributorCache, openIddictRequestHelper) + { + + } + + protected async override Task> GetExternalProviders() + { + var providers = await base.GetExternalProviders(); + + foreach (var provider in providers) + { + var localizedDisplayName = L[provider.DisplayName]; + if (localizedDisplayName.ResourceNotFound) + { + localizedDisplayName = L["AuthenticationScheme:" + provider.DisplayName]; + } + + if (!localizedDisplayName.ResourceNotFound) + { + provider.DisplayName = localizedDisplayName.Value; + } + } + + return providers; + } + + protected override Task TwoFactorLoginResultAsync() + { + // 重定向双因素认证页面 + return Task.FromResult(RedirectToPage("SendCode", new + { + returnUrl = ReturnUrl, + returnUrlHash = ReturnUrlHash, + rememberMe = LoginInput.RememberMe + })); + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/UseRecoveryCode.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/UseRecoveryCode.cshtml new file mode 100644 index 000000000..079925ee4 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/UseRecoveryCode.cshtml @@ -0,0 +1,4 @@ +@page +@model LY.AIO.Applications.Single.Pages.Account.UseRecoveryCodeModel +@{ +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/UseRecoveryCode.cshtml.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/UseRecoveryCode.cshtml.cs new file mode 100644 index 000000000..016bf3771 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/UseRecoveryCode.cshtml.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace LY.AIO.Applications.Single.Pages.Account +{ + public class UseRecoveryCodeModel : PageModel + { + public void OnGet() + { + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyAuthenticatorCode.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyAuthenticatorCode.cshtml new file mode 100644 index 000000000..bc3e49acf --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyAuthenticatorCode.cshtml @@ -0,0 +1,26 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.Account.Localization +@model LY.AIO.Applications.Single.Pages.Account.VerifyAuthenticatorCodeModel +@inject IHtmlLocalizer L +
+
+
+ + +
+ + + +
+
+ + +
+ @L["VerifyAuthenticatorCode"] + + @L["Login"] + +
+
+
\ No newline at end of file diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyAuthenticatorCode.cshtml.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyAuthenticatorCode.cshtml.cs new file mode 100644 index 000000000..9a5d3c6ec --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyAuthenticatorCode.cshtml.cs @@ -0,0 +1,59 @@ +using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Account.Web.Pages.Account; + +namespace LY.AIO.Applications.Single.Pages.Account +{ + public class VerifyAuthenticatorCodeModel : AccountPageModel + { + [BindProperty] + public VerifyAuthenticatorCodeInputModel Input { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrl { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrlHash { get; set; } + + [BindProperty(SupportsGet = true)] + public bool RememberBrowser { get; set; } + + [HiddenInput] + public bool RememberMe { get; set; } + + public virtual IActionResult OnGet() + { + Input = new VerifyAuthenticatorCodeInputModel(); + + return Page(); + } + + public virtual async Task OnPostAsync() + { + var result = await SignInManager.TwoFactorAuthenticatorSignInAsync(Input.VerifyCode, RememberMe, RememberBrowser); + if (result.Succeeded) + { + return await RedirectSafelyAsync(ReturnUrl, ReturnUrlHash); + } + if (result.IsLockedOut) + { + Logger.LogWarning(7, "User account locked out."); + Alerts.Warning(L["UserLockedOutMessage"]); + return Page(); + } + else + { + Alerts.Danger(L["TwoFactorAuthenticationInvaidUser"]);// TODO: ����״̬��Ľ�� + return Page(); + } + } + } + + public class VerifyAuthenticatorCodeInputModel + { + [Required] + public string VerifyCode { get; set; } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyCode.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyCode.cshtml new file mode 100644 index 000000000..94589fb71 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyCode.cshtml @@ -0,0 +1,29 @@ +@page +@inject IHtmlLocalizer L +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.Account.Localization +@model LY.AIO.Applications.Single.Pages.Account.VerifyCodeModel +
+
+
+ + + + +
+ +
+ + + + + +
+ @L["VerifyAuthenticatorCode"] +
+ + @L["ReSendVerifyCode"] + +
+
+
diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyCode.cshtml.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyCode.cshtml.cs new file mode 100644 index 000000000..17ebff5bb --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Account/VerifyCode.cshtml.cs @@ -0,0 +1,90 @@ +using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Account.Localization; +using Volo.Abp.Account.Web.Pages.Account; + +namespace LY.AIO.Applications.Single.Pages.Account +{ + public class VerifyCodeModel : AccountPageModel + { + [BindProperty] + public VerifyCodeInputModel Input { get; set; } + /// + /// ˫������֤�ṩ���� + /// + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string Provider { get; set; } + /// + /// �ض���Url + /// + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrl { get; set; } + /// + /// + /// + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrlHash { get; set; } + /// + /// �Ƿ��ס��¼״̬ + /// + [HiddenInput] + [BindProperty(SupportsGet = true)] + public bool RememberMe { get; set; } + + public VerifyCodeModel() + { + LocalizationResourceType = typeof(AccountResource); + } + + public virtual IActionResult OnGet() + { + Input = new VerifyCodeInputModel(); + + return Page(); + } + + public virtual async Task OnPostAsync() + { + // ��֤�û���¼״̬ + var user = await SignInManager.GetTwoFactorAuthenticationUserAsync(); + if (user == null) + { + Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]); + return Page(); + } + // ˫���ص�¼ + var result = await SignInManager.TwoFactorSignInAsync(Provider, Input.VerifyCode, RememberMe, Input.RememberBrowser); + if (result.Succeeded) + { + return await RedirectSafelyAsync(ReturnUrl, ReturnUrlHash); + } + if (result.IsLockedOut) + { + Logger.LogWarning(7, "User account locked out."); + Alerts.Warning(L["UserLockedOutMessage"]); + return Page(); + } + else + { + Alerts.Danger(L["TwoFactorAuthenticationInvaidUser"]);// TODO: ����״̬��Ľ�� + return Page(); + } + } + } + + public class VerifyCodeInputModel + { + /// + /// �Ƿ���������м�ס��¼״̬ + /// + public bool RememberBrowser { get; set; } + /// + /// ���͵���֤�� + /// + [Required] + public string VerifyCode { get; set; } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Index.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Index.cshtml new file mode 100644 index 000000000..f220a0b10 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Index.cshtml @@ -0,0 +1,36 @@ +@page +@using Microsoft.AspNetCore.Mvc.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.Users +@model LY.AIO.Applications.Single.Pages.IndexModel +@inject ICurrentUser CurrentUser +@if (CurrentUser.IsAuthenticated) +{ +
+ + + + Logout + + +

@CurrentUser.UserName

+
@CurrentUser.Email
+
+ Roles: @CurrentUser.Roles.JoinAsString(", ") +
+ Claims:
+ @Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString("
")) +
+
+
+
+} + +@if (!CurrentUser.IsAuthenticated) +{ +
+

+ Login +
+} \ No newline at end of file diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/Index.cshtml.cs b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Index.cshtml.cs new file mode 100644 index 000000000..5164786e9 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/Index.cshtml.cs @@ -0,0 +1,11 @@ +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace LY.AIO.Applications.Single.Pages +{ + public class IndexModel : AbpPageModel + { + public void OnGet() + { + } + } +} \ No newline at end of file diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Pages/_ViewImports.cshtml b/aspnet-core/services/LY.AIO.Applications.Single/Pages/_ViewImports.cshtml new file mode 100644 index 000000000..c1da1f5f1 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Pages/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Program.cs b/aspnet-core/services/LY.AIO.Applications.Single/Program.cs new file mode 100644 index 000000000..7d97a1b43 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Program.cs @@ -0,0 +1,82 @@ +using LINGYUN.Abp.Identity.Session.AspNetCore; +using LY.AIO.Applications.Single; +using Microsoft.AspNetCore.Cors; +using Serilog; +using Volo.Abp.IO; +using Volo.Abp.Modularity.PlugIns; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddCors(options => +{ + options.AddDefaultPolicy(policy => + { + policy + .WithOrigins( + builder.Configuration["App:CorsOrigins"] + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() + ) + .WithAbpExposedHeaders() + .WithAbpWrapExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); +}); +builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseSerilog((context, provider, config) => + { + config.ReadFrom.Configuration(context.Configuration); + }); + +await builder.AddApplicationAsync(options => +{ + MicroServiceApplicationsSingleModule.ApplicationName = Environment.GetEnvironmentVariable("APPLICATION_NAME") + ?? MicroServiceApplicationsSingleModule.ApplicationName; + options.ApplicationName = MicroServiceApplicationsSingleModule.ApplicationName; + options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID"); + options.Configuration.UserSecretsAssembly = typeof(MicroServiceApplicationsSingleModule).Assembly; + var pluginFolder = Path.Combine( + Directory.GetCurrentDirectory(), "Modules"); + DirectoryHelper.CreateIfNotExists(pluginFolder); + options.PlugInSources.AddFolder( + pluginFolder, + SearchOption.AllDirectories); +}); + +var app = builder.Build(); + +await app.InitializeApplicationAsync(); + +app.UseForwardedHeaders(); +if (app.Environment.IsDevelopment()) +{ + app.UseDeveloperExceptionPage(); +} +// app.UseAbpExceptionHandling(); +app.UseCookiePolicy(); +app.UseMapRequestLocalization(); +app.UseCorrelationId(); +app.UseStaticFiles(); +app.UseRouting(); +app.UseCors(); +app.UseAuthentication(); +app.UseMultiTenancy(); +app.UseUnitOfWork(); +app.UseAbpOpenIddictValidation(); +app.UseAbpSession(); +app.UseDynamicClaims(); +app.UseAuthorization(); +app.UseSwagger(); +app.UseSwaggerUI(options => +{ + options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support App API"); +}); +app.UseAuditing(); +app.UseAbpSerilogEnrichers(); +app.UseConfiguredEndpoints(); + +await app.RunAsync(); diff --git a/aspnet-core/services/LY.AIO.Applications.Single/Properties/launchSettings.json b/aspnet-core/services/LY.AIO.Applications.Single/Properties/launchSettings.json new file mode 100644 index 000000000..337677308 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:19139", + "sslPort": 0 + } + }, + "profiles": { + "LY.MicroService.Applications.Single": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://0.0.0.0:30001", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Production" + } + }, + "LY.MicroService.Applications.Single.Development": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://0.0.0.0:30000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/TenantHeaderParamter.cs b/aspnet-core/services/LY.AIO.Applications.Single/TenantHeaderParamter.cs new file mode 100644 index 000000000..9d80a45fd --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/TenantHeaderParamter.cs @@ -0,0 +1,35 @@ +using Microsoft.Extensions.Options; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; +using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.MultiTenancy; + +namespace LY.AIO.Applications.Single; + +public class TenantHeaderParamter : IOperationFilter +{ + private readonly AbpMultiTenancyOptions _multiTenancyOptions; + private readonly AbpAspNetCoreMultiTenancyOptions _aspNetCoreMultiTenancyOptions; + public TenantHeaderParamter( + IOptions multiTenancyOptions, + IOptions aspNetCoreMultiTenancyOptions) + { + _multiTenancyOptions = multiTenancyOptions.Value; + _aspNetCoreMultiTenancyOptions = aspNetCoreMultiTenancyOptions.Value; + } + + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + if (_multiTenancyOptions.IsEnabled) + { + operation.Parameters = operation.Parameters ?? new List(); + operation.Parameters.Add(new OpenApiParameter + { + Name = _aspNetCoreMultiTenancyOptions.TenantKey, + In = ParameterLocation.Header, + Description = "Tenant Id in http header", + Required = false + }); + } + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Official/Messages/TextMessageReplyContributor.cs b/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Official/Messages/TextMessageReplyContributor.cs new file mode 100644 index 000000000..593116275 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Official/Messages/TextMessageReplyContributor.cs @@ -0,0 +1,21 @@ +using LINGYUN.Abp.WeChat.Common.Messages.Handlers; +using LINGYUN.Abp.WeChat.Official.Messages.Models; +using LINGYUN.Abp.WeChat.Official.Services; + +namespace LY.AIO.Applications.Single.WeChat.Official.Messages; +/// +/// 文本消息客服回复 +/// +public class TextMessageReplyContributor : IMessageHandleContributor +{ + public async virtual Task HandleAsync(MessageHandleContext context) + { + var messageSender = context.ServiceProvider.GetRequiredService(); + + await messageSender.SendAsync( + new LINGYUN.Abp.WeChat.Official.Services.Models.TextMessageModel( + context.Message.FromUserName, + new LINGYUN.Abp.WeChat.Official.Services.Models.TextMessage( + context.Message.Content))); + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Official/Messages/UserSubscribeEventContributor.cs b/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Official/Messages/UserSubscribeEventContributor.cs new file mode 100644 index 000000000..249105de0 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Official/Messages/UserSubscribeEventContributor.cs @@ -0,0 +1,21 @@ +using LINGYUN.Abp.WeChat.Common.Messages.Handlers; +using LINGYUN.Abp.WeChat.Official.Messages.Models; +using LINGYUN.Abp.WeChat.Official.Services; + +namespace LY.AIO.Applications.Single.WeChat.Official.Messages; +/// +/// 用户关注回复消息 +/// +public class UserSubscribeEventContributor : IEventHandleContributor +{ + public async virtual Task HandleAsync(MessageHandleContext context) + { + var messageSender = context.ServiceProvider.GetRequiredService(); + + await messageSender.SendAsync( + new LINGYUN.Abp.WeChat.Official.Services.Models.TextMessageModel( + context.Message.FromUserName, + new LINGYUN.Abp.WeChat.Official.Services.Models.TextMessage( + "感谢您的关注, 点击菜单了解更多."))); + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Work/Messages/TextMessageReplyContributor.cs b/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Work/Messages/TextMessageReplyContributor.cs new file mode 100644 index 000000000..f0c6a2b1f --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/WeChat/Work/Messages/TextMessageReplyContributor.cs @@ -0,0 +1,24 @@ +using LINGYUN.Abp.WeChat.Common.Messages.Handlers; +using LINGYUN.Abp.WeChat.Work.Common.Messages.Models; +using LINGYUN.Abp.WeChat.Work.Messages; + +namespace LY.AIO.Applications.Single.WeChat.Work.Messages; +/// +/// 文本消息客服回复 +/// +public class TextMessageReplyContributor : IMessageHandleContributor +{ + public async virtual Task HandleAsync(MessageHandleContext context) + { + var messageSender = context.ServiceProvider.GetRequiredService(); + + await messageSender.SendAsync( + new LINGYUN.Abp.WeChat.Work.Messages.Models.WeChatWorkTextMessage( + context.Message.AgentId.ToString(), + new LINGYUN.Abp.WeChat.Work.Messages.Models.TextMessage( + context.Message.Content)) + { + ToUser = context.Message.FromUserName, + }); + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/appsettings.Development.json b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.Development.json new file mode 100644 index 000000000..a9d10fdff --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.Development.json @@ -0,0 +1,249 @@ +{ + "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": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"//Mysql + "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;"//Postgres + }, + "DistributedLock": { + "IsEnabled": true, + "Redis": { + "Configuration": "127.0.0.1,defaultDatabase=14" + } + }, + "Elsa": { + "Features": { + "DefaultPersistence": { + "Enabled": true, + "ConnectionStringIdentifier": "Default", + "EntityFrameworkCore": { + "MySql": { + "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": true, + "ConnectionStringIdentifier": "Default", + "EntityFrameworkCore": { + "MySql": { + "Enabled": true + } + } + }, + "WorkflowSettings": { + "Enabled": true, + "ConnectionStringIdentifier": "Default", + "EntityFrameworkCore": { + "MySql": { + "Enabled": true + } + } + } + }, + "Server": { + "BaseUrl": "http://127.0.0.1:30000" + } + }, + "Quartz": { + "UsePersistentStore": false, + "Properties": { + "quartz.jobStore.dataSource": "tkm", + "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX,Quartz", + "quartz.dataSource.tkm.connectionStringName": "Default", +// "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.MySQLDelegate,Quartz", +// "quartz.dataSource.tkm.connectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", +// "quartz.dataSource.tkm.provider": "MySqlConnector", + "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate,Quartz", + "quartz.dataSource.tkm.connectionString": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;", + "quartz.dataSource.tkm.provider": "Npgsql", + "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/aspnet-core/services/LY.AIO.Applications.Single/appsettings.PostgreSql.json b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.PostgreSql.json new file mode 100644 index 000000000..cf15e11f7 --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.PostgreSql.json @@ -0,0 +1,246 @@ +{ + "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/aspnet-core/services/LY.AIO.Applications.Single/appsettings.json b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.json new file mode 100644 index 000000000..ff9beea3e --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.json @@ -0,0 +1,89 @@ +{ + "Clock": { + "Kind": "Local" + }, + "Forwarded": { + "ForwardedHeaders": "XForwardedFor,XForwardedProto" + }, + "StringEncryption": { + "DefaultPassPhrase": "s46c5q55nxpeS8Ra", + "InitVectorBytes": "s83ng0abvd02js84", + "DefaultSalt": "sf&5)s3#" + }, + "Json": { + "OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss", + "InputDateTimeFormats": [ + "yyyy-MM-dd HH:mm:ss", + "yyyy-MM-ddTHH:mm:ss" + ] + }, + "AllowedHosts": "*", + "Hosting": { + "BasePath": "" + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning", + "DotNetCore": "Information" + } + }, + "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ], + "WriteTo": [ + { + "Name": "Console", + "Args": { + "restrictedToMinimumLevel": "Debug", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Debug-.log", + "restrictedToMinimumLevel": "Debug", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Info-.log", + "restrictedToMinimumLevel": "Information", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Warn-.log", + "restrictedToMinimumLevel": "Warning", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Error-.log", + "restrictedToMinimumLevel": "Error", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "Logs/Fatal-.log", + "restrictedToMinimumLevel": "Fatal", + "rollingInterval": "Day", + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" + } + } + ] + } +} diff --git a/aspnet-core/services/LY.AIO.Applications.Single/gulpfile.js b/aspnet-core/services/LY.AIO.Applications.Single/gulpfile.js new file mode 100644 index 000000000..bec4d578f --- /dev/null +++ b/aspnet-core/services/LY.AIO.Applications.Single/gulpfile.js @@ -0,0 +1,10 @@ +"use strict"; + +var gulp = require("gulp"), + path = require('path'), + copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js'); + +exports.default = function(done){ + copyResources(path.resolve('./')); + done(); +}; \ No newline at end of file diff --git a/common.props b/common.props index cd370d567..9af819310 100644 --- a/common.props +++ b/common.props @@ -11,7 +11,7 @@ git https://github.com/colinin/abp-next-admin true - Debug;Release;PostgreSQL + Debug;Release From 1dac72a6bab425b67ded35f954742d01474d9cfc Mon Sep 17 00:00:00 2001 From: feijie Date: Wed, 18 Dec 2024 23:07:40 +0800 Subject: [PATCH 006/170] =?UTF-8?q?=F0=9F=94=A7=20=E4=BF=AE=E5=A4=8D(migra?= =?UTF-8?q?tions):=20=E4=BF=AE=E6=94=B9=E4=BE=9D=E8=B5=96=E9=A1=B9?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81MySql=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SingleDbMigratorModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/SingleDbMigratorModule.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/SingleDbMigratorModule.cs index 4bce3b4fd..c42eeea3f 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/SingleDbMigratorModule.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/SingleDbMigratorModule.cs @@ -1,7 +1,7 @@ using LINGYUN.Abp.UI.Navigation.VueVbenAdmin; using Microsoft.Extensions.DependencyInjection; using LY.MicroService.Applications.Single.EntityFrameworkCore.PostgreSql; -// using LY.MicroService.Applications.Single.EntityFrameworkCore.MySql; +using LY.MicroService.Applications.Single.EntityFrameworkCore.MySql; using Volo.Abp.Autofac; using Volo.Abp.Modularity; @@ -9,8 +9,8 @@ namespace LY.MicroService.Applications.Single.DbMigrator; [DependsOn( typeof(AbpUINavigationVueVbenAdminModule), - typeof(SingleMigrationsEntityFrameworkCorePostgreSqlModule), - // typeof(SingleMigrationsEntityFrameworkCoreMySqlModule), + // typeof(SingleMigrationsEntityFrameworkCorePostgreSqlModule), + typeof(SingleMigrationsEntityFrameworkCoreMySqlModule), typeof(AbpAutofacModule) )] public partial class SingleDbMigratorModule : AbpModule From 2b16f9a36bdb518b40ee0c5418866a3ba03338a1 Mon Sep 17 00:00:00 2001 From: feijie Date: Wed, 18 Dec 2024 23:08:24 +0800 Subject: [PATCH 007/170] =?UTF-8?q?=F0=9F=9A=80=20feat(migrations):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84=E8=BF=81=E7=A7=BB=E4=BB=A5?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=A4=E8=AF=81=E5=AE=9E=E4=BD=93=E5=8F=8A?= =?UTF-8?q?=E5=85=B6=E7=9B=B8=E5=85=B3=E5=B1=9E=E6=80=A7=E5=92=8C=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...vice.Applications.Single.DbMigrator.csproj | 4 + .../appsettings.json | 4 +- ...ddNewMigration_20241218_225542.Designer.cs | 5828 +++++++++++++++++ ...8145610_AddNewMigration_20241218_225542.cs | 183 + .../SingleMigrationsDbContextModelSnapshot.cs | 289 + 5 files changed, 6306 insertions(+), 2 deletions(-) create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20241218145610_AddNewMigration_20241218_225542.Designer.cs create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20241218145610_AddNewMigration_20241218_225542.cs 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 1f39486bc..5279f8ae4 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 @@ -35,6 +35,10 @@ PreserveNewest + + + PreserveNewest + diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json index daded80e0..4a3dae71a 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json @@ -3,8 +3,8 @@ "Kind": "Local" }, "ConnectionStrings": { - // "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"//MySql - "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer"//PostgreSql + "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"//MySql +// "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer"//PostgreSql }, "StringEncryption": { "DefaultPassPhrase": "s46c5q55nxpeS8Ra", diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20241218145610_AddNewMigration_20241218_225542.Designer.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20241218145610_AddNewMigration_20241218_225542.Designer.cs new file mode 100644 index 000000000..f61908182 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20241218145610_AddNewMigration_20241218_225542.Designer.cs @@ -0,0 +1,5828 @@ +// +using System; +using LY.MicroService.Applications.Single.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migrations +{ + [DbContext(typeof(SingleMigrationsDbContext))] + [Migration("20241218145610_AddNewMigration_20241218_225542")] + partial class AddNewMigration_20241218_225542 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("TypeFullName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("TypeFullName"); + + b.Property("TypeInfoId") + .HasColumnType("char(36)"); + + b.Property("ValueRange") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("ValueRange"); + + b.HasKey("Id"); + + b.HasIndex("TypeInfoId", "TypeFullName"); + + b.ToTable("AbpAuthEntityProperties", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAuditEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("TypeFullName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("TypeFullName"); + + b.HasKey("Id"); + + b.HasIndex("TypeFullName"); + + b.ToTable("AbpAuthEntitites", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowProperties") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("AllowProperties"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("EntityTypeFullName") + .HasColumnType("longtext"); + + b.Property("EntityTypeId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FilterGroup") + .HasColumnType("longtext") + .HasColumnName("FilterGroup"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Operation") + .HasColumnType("int"); + + b.Property("OrgCode") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("OrgCode"); + + b.Property("OrgId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("AbpAuthOrganizationUnitEntityRules", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowProperties") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("AllowProperties"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("EntityTypeFullName") + .HasColumnType("longtext"); + + b.Property("EntityTypeId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FilterGroup") + .HasColumnType("longtext") + .HasColumnName("FilterGroup"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Operation") + .HasColumnType("int"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("RoleName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("AbpAuthRoleEntityRules", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Demo.Authors.Author", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ShortBio") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("Demo_Authors", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Demo.Books.Book", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuthorId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Price") + .HasColumnType("float"); + + b.Property("PublishDate") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.ToTable("Demo_Books", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TwoLetterISOLanguageName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("TwoLetterISOLanguageName"); + + b.Property("UiCultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("UiCultureName"); + + b.HasKey("Id"); + + b.HasIndex("CultureName"); + + b.ToTable("AbpLocalizationLanguages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DefaultCultureName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DefaultCultureName"); + + b.Property("Description") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpLocalizationResources", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Text", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Key"); + + b.Property("ResourceName") + .HasColumnType("longtext"); + + b.Property("Value") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)") + .HasColumnName("Value"); + + b.HasKey("Id"); + + b.HasIndex("Key"); + + b.ToTable("AbpLocalizationTexts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Age") + .HasColumnType("int"); + + b.Property("AvatarUrl") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Birthday") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastOnlineTime") + .HasColumnType("datetime(6)"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Sex") + .HasColumnType("int"); + + b.Property("Sign") + .HasMaxLength(30) + .HasColumnType("varchar(30)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Black") + .HasColumnType("tinyint(1)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("DontDisturb") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrientId") + .HasColumnType("char(36)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("RemarkName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SpecialFocus") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "FrientId"); + + b.ToTable("AppUserChatFriends", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AllowAddFriend") + .HasColumnType("tinyint(1)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowReceiveMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("RequireAddFriendValition") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatSettings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("ReceiveUserId") + .HasColumnType("char(36)"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ReceiveUserId"); + + b.ToTable("AppUserMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.ChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("AdminUserId") + .HasColumnType("char(36)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AvatarUrl") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MaxUserCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("Notice") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Tag") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AppChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupChatBlack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("ShieldUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupChatBlacks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId", "UserId"); + + b.ToTable("AppUserChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserGroupCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SilenceEnd") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserGroupCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExpirationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationTypeName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "NotificationName"); + + b.ToTable("AppNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionGroupRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitionGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationLifetime") + .HasColumnType("int"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.Property("Providers") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Template") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("ReadStatus") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationId") + .HasDatabaseName("IX_Tenant_User_Notification_Id"); + + b.ToTable("AppUserNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserSubscribe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasDefaultValue("/"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationName") + .IsUnique() + .HasDatabaseName("IX_Tenant_User_Notification_Name"); + + b.ToTable("AppUserSubscribes", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.HasIndex("DisplayName"); + + b.ToTable("AbpEditions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisableTime") + .HasColumnType("datetime(6)"); + + b.Property("EditionId") + .HasColumnType("char(36)"); + + b.Property("EnableTime") + .HasColumnType("datetime(6)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("EditionId"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("Paramters") + .HasColumnType("longtext") + .HasColumnName("Paramters"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("TK_BackgroundJobActions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Args") + .HasColumnType("longtext") + .HasColumnName("Args"); + + b.Property("BeginTime") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Cron") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Cron"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Group"); + + b.Property("Interval") + .HasColumnType("int"); + + b.Property("IsAbandoned") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobType") + .HasColumnType("int"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastRunTime") + .HasColumnType("datetime(6)"); + + b.Property("LockTimeOut") + .HasColumnType("int"); + + b.Property("MaxCount") + .HasColumnType("int"); + + b.Property("MaxTryCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("NextRunTime") + .HasColumnType("datetime(6)"); + + b.Property("NodeName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("NodeName"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Result") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Result"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TriggerCount") + .HasColumnType("int"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Type"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Group"); + + b.ToTable("TK_BackgroundJobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Exception") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Exception"); + + b.Property("JobGroup") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobGroup"); + + b.Property("JobId") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("JobName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobName"); + + b.Property("JobType") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("JobType"); + + b.Property("Message") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Message"); + + b.Property("RunTime") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("JobGroup", "JobName"); + + b.ToTable("TK_BackgroundJobLogs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasMaxLength(1048576) + .HasColumnType("longtext") + .HasColumnName("Content"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Culture") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Culture"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("DisplayName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .HasDatabaseName("IX_Tenant_Text_Template_Name"); + + b.ToTable("AbpTextTemplates", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("DefaultCultureName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("DefaultCultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsInlineLocalized") + .HasColumnType("tinyint(1)"); + + b.Property("IsLayout") + .HasColumnType("tinyint(1)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Layout") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("Layout"); + + b.Property("LocalizationResourceName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("LocalizationResourceName"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Name"); + + b.Property("RenderEngine") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RenderEngine"); + + b.HasKey("Id"); + + b.ToTable("AbpTextTemplateDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("RequiredFeatures") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpWebhooksWebhooks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("Data") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Data"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WebhookName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("WebhookName"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhooksEvents", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpWebhooksWebhookGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("RequestHeaders") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("RequestHeaders"); + + b.Property("Response") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Response"); + + b.Property("ResponseHeaders") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("ResponseHeaders"); + + b.Property("ResponseStatusCode") + .HasColumnType("int"); + + b.Property("SendExactSameData") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WebhookEventId") + .HasColumnType("char(36)"); + + b.Property("WebhookSubscriptionId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("WebhookEventId"); + + b.ToTable("AbpWebhooksSendAttempts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Description"); + + b.Property("Headers") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Headers"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Secret") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Secret"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TimeoutDuration") + .HasColumnType("int"); + + b.Property("WebhookUri") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("WebhookUri"); + + b.Property("Webhooks") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Webhooks"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhooksSubscriptions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDatas", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowBeNull") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DefaultValue"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DataId"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDataItems", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformLayouts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(23) + .HasColumnType("varchar(23)") + .HasColumnName("Code"); + + b.Property("Component") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Component"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LayoutId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("RoleName"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleName", "MenuId"); + + b.ToTable("AppPlatformRoleMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserFavoriteMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AliasName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("AliasName"); + + b.Property("Color") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Color"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("Icon") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Icon"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserFavoriteMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("ForceUpdate") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("Note") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Note"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Version"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Version"); + + b.ToTable("AppPlatformPackages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ContentType") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ContentType"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DownloadCount") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("License") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("License"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("PackageId") + .HasColumnType("char(36)"); + + b.Property("SHA256") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SHA256"); + + b.Property("Size") + .HasColumnType("bigint"); + + b.Property("Summary") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Summary"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Url"); + + b.HasKey("Id"); + + b.HasIndex("PackageId", "Name"); + + b.ToTable("AppPlatformPackageBlobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Portal.Enterprise", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Address") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Address"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EnglishName") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("EnglishName"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LegalMan") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("LegalMan"); + + b.Property("Logo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Logo"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("OrganizationCode") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("OrganizationCode"); + + b.Property("RegistrationCode") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RegistrationCode"); + + b.Property("RegistrationDate") + .HasColumnType("datetime(6)"); + + b.Property("TaxCode") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("TaxCode"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformEnterprises", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "TypeInfo") + .WithMany("Properties") + .HasForeignKey("TypeInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TypeInfo"); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityTypeInfo"); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityTypeInfo"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Demo.Books.Book", b => + { + b.HasOne("LINGYUN.Abp.Demo.Authors.Author", null) + .WithMany() + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") + .WithMany() + .HasForeignKey("EditionId"); + + b.Navigation("Edition"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => + { + b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b => + { + b.HasOne("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", "WebhookEvent") + .WithOne() + .HasForeignKey("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", "WebhookEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WebhookEvent"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.HasOne("LINGYUN.Platform.Datas.Data", null) + .WithMany("Items") + .HasForeignKey("DataId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.HasOne("LINGYUN.Platform.Packages.Package", "Package") + .WithMany("Blobs") + .HasForeignKey("PackageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => + { + b.Navigation("Properties"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Navigation("Blobs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20241218145610_AddNewMigration_20241218_225542.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20241218145610_AddNewMigration_20241218_225542.cs new file mode 100644 index 000000000..e93c422e8 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20241218145610_AddNewMigration_20241218_225542.cs @@ -0,0 +1,183 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migrations +{ + /// + public partial class AddNewMigration_20241218_225542 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpAuthEntitites", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TypeFullName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsAuditEnabled = table.Column(type: "tinyint(1)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuthEntitites", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpAuthEntityProperties", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TypeFullName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ValueRange = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TypeInfoId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuthEntityProperties", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuthEntityProperties_AbpAuthEntitites_TypeInfoId", + column: x => x.TypeInfoId, + principalTable: "AbpAuthEntitites", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpAuthOrganizationUnitEntityRules", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrgId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrgCode = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + Operation = table.Column(type: "int", nullable: false), + FilterGroup = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EntityTypeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + EntityTypeFullName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AllowProperties = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuthOrganizationUnitEntityRules", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuthOrganizationUnitEntityRules_AbpAuthEntitites_EntityTy~", + column: x => x.EntityTypeId, + principalTable: "AbpAuthEntitites", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpAuthRoleEntityRules", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + Operation = table.Column(type: "int", nullable: false), + FilterGroup = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EntityTypeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + EntityTypeFullName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AllowProperties = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuthRoleEntityRules", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuthRoleEntityRules_AbpAuthEntitites_EntityTypeId", + column: x => x.EntityTypeId, + principalTable: "AbpAuthEntitites", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuthEntitites_TypeFullName", + table: "AbpAuthEntitites", + column: "TypeFullName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuthEntityProperties_TypeInfoId_TypeFullName", + table: "AbpAuthEntityProperties", + columns: new[] { "TypeInfoId", "TypeFullName" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuthOrganizationUnitEntityRules_EntityTypeId", + table: "AbpAuthOrganizationUnitEntityRules", + column: "EntityTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuthRoleEntityRules_EntityTypeId", + table: "AbpAuthRoleEntityRules", + column: "EntityTypeId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpAuthEntityProperties"); + + migrationBuilder.DropTable( + name: "AbpAuthOrganizationUnitEntityRules"); + + migrationBuilder.DropTable( + name: "AbpAuthRoleEntityRules"); + + migrationBuilder.DropTable( + name: "AbpAuthEntitites"); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/SingleMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/SingleMigrationsDbContextModelSnapshot.cs index 323306a7d..59856a89b 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/SingleMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/SingleMigrationsDbContextModelSnapshot.cs @@ -24,6 +24,257 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migratio MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("TypeFullName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("TypeFullName"); + + b.Property("TypeInfoId") + .HasColumnType("char(36)"); + + b.Property("ValueRange") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("ValueRange"); + + b.HasKey("Id"); + + b.HasIndex("TypeInfoId", "TypeFullName"); + + b.ToTable("AbpAuthEntityProperties", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAuditEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("TypeFullName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("TypeFullName"); + + b.HasKey("Id"); + + b.HasIndex("TypeFullName"); + + b.ToTable("AbpAuthEntitites", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowProperties") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("AllowProperties"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("EntityTypeFullName") + .HasColumnType("longtext"); + + b.Property("EntityTypeId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FilterGroup") + .HasColumnType("longtext") + .HasColumnName("FilterGroup"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Operation") + .HasColumnType("int"); + + b.Property("OrgCode") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("OrgCode"); + + b.Property("OrgId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("AbpAuthOrganizationUnitEntityRules", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowProperties") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("AllowProperties"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("EntityTypeFullName") + .HasColumnType("longtext"); + + b.Property("EntityTypeId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FilterGroup") + .HasColumnType("longtext") + .HasColumnName("FilterGroup"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Operation") + .HasColumnType("int"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("RoleName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("AbpAuthRoleEntityRules", (string)null); + }); + modelBuilder.Entity("LINGYUN.Abp.Demo.Authors.Author", b => { b.Property("Id") @@ -5091,6 +5342,39 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migratio b.ToTable("AbpSettingDefinitions", (string)null); }); + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "TypeInfo") + .WithMany("Properties") + .HasForeignKey("TypeInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TypeInfo"); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityTypeInfo"); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityTypeInfo"); + }); + modelBuilder.Entity("LINGYUN.Abp.Demo.Books.Book", b => { b.HasOne("LINGYUN.Abp.Demo.Authors.Author", null) @@ -5435,6 +5719,11 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migratio .HasForeignKey("AuthorizationId"); }); + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => + { + b.Navigation("Properties"); + }); + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => { b.Navigation("ConnectionStrings"); From 49381fb91bcdadf5eeacf58fa4edb2b68d32d0e3 Mon Sep 17 00:00:00 2001 From: feijie Date: Wed, 18 Dec 2024 23:21:19 +0800 Subject: [PATCH 008/170] =?UTF-8?q?=F0=9F=9A=A7=20refactor(appsettings):?= =?UTF-8?q?=20=E5=88=A0=E9=99=A4PostgreSql=E9=85=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E8=87=B3MySQL=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LY.AIO.Applications.Single.csproj | 2 +- ...rviceApplicationsSingleModule.Configure.cs | 6 +- .../MicroServiceApplicationsSingleModule.cs | 6 +- .../appsettings.Development.json | 16 +- .../appsettings.PostgreSql.json | 246 ------------------ 5 files changed, 15 insertions(+), 261 deletions(-) delete mode 100644 aspnet-core/services/LY.AIO.Applications.Single/appsettings.PostgreSql.json diff --git a/aspnet-core/services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj b/aspnet-core/services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj index d135a63ea..066e419db 100644 --- a/aspnet-core/services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj +++ b/aspnet-core/services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj @@ -37,7 +37,7 @@ - + diff --git a/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs b/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs index f2f66239a..5ec0178f6 100644 --- a/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs +++ b/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs @@ -569,10 +569,10 @@ public partial class MicroServiceApplicationsSingleModule { Configure(options => { - AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);//解决PostgreSql设置为utc时间后无法写入local时区的问题 - options.UseNpgsql(); + // AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);//解决PostgreSql设置为utc时间后无法写入local时区的问题 + // options.UseNpgsql(); - // options.UseMySQL(); + options.UseMySQL(); }); } diff --git a/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.cs index a0c2ce2d6..b83019ebb 100644 --- a/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.cs +++ b/aspnet-core/services/LY.AIO.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -124,7 +124,7 @@ using Volo.Abp.SettingManagement; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.Threading; // using LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql; -// using Volo.Abp.EntityFrameworkCore.MySQL; +using Volo.Abp.EntityFrameworkCore.MySQL; namespace LY.AIO.Applications.Single; @@ -233,8 +233,8 @@ namespace LY.AIO.Applications.Single; typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementDomainOrganizationUnitsModule), // 组织机构权限管理 - typeof(AbpEntityFrameworkCorePostgreSqlModule), - // typeof(AbpEntityFrameworkCoreMySQLModule), + // typeof(AbpEntityFrameworkCorePostgreSqlModule), + typeof(AbpEntityFrameworkCoreMySQLModule), typeof(AbpAliyunSmsModule), typeof(AbpAliyunSettingManagementModule), diff --git a/aspnet-core/services/LY.AIO.Applications.Single/appsettings.Development.json b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.Development.json index a9d10fdff..4f753c08e 100644 --- a/aspnet-core/services/LY.AIO.Applications.Single/appsettings.Development.json +++ b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.Development.json @@ -36,8 +36,8 @@ } }, "ConnectionStrings": { -// "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"//Mysql - "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;"//Postgres + "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"//Mysql +// "Default": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;"//Postgres }, "DistributedLock": { "IsEnabled": true, @@ -99,12 +99,12 @@ "quartz.jobStore.dataSource": "tkm", "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX,Quartz", "quartz.dataSource.tkm.connectionStringName": "Default", -// "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.MySQLDelegate,Quartz", -// "quartz.dataSource.tkm.connectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", -// "quartz.dataSource.tkm.provider": "MySqlConnector", - "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate,Quartz", - "quartz.dataSource.tkm.connectionString": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;", - "quartz.dataSource.tkm.provider": "Npgsql", + "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.MySQLDelegate,Quartz", + "quartz.dataSource.tkm.connectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", + "quartz.dataSource.tkm.provider": "MySqlConnector", +// "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate,Quartz", +// "quartz.dataSource.tkm.connectionString": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;", +// "quartz.dataSource.tkm.provider": "Npgsql", "quartz.jobStore.clustered": "true", "quartz.serializer.type": "json" } diff --git a/aspnet-core/services/LY.AIO.Applications.Single/appsettings.PostgreSql.json b/aspnet-core/services/LY.AIO.Applications.Single/appsettings.PostgreSql.json deleted file mode 100644 index cf15e11f7..000000000 --- a/aspnet-core/services/LY.AIO.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" - } - } - ] - } -} From 00febf39e1112ed9c31c4cf838a28afefebd2eaa Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 10:10:16 +0800 Subject: [PATCH 009/170] =?UTF-8?q?feat(openiddict):=20=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96openiddict=E5=8C=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/@abp/openiddict/package.json | 37 +++++++++++++++++++ .../packages/@abp/openiddict/tsconfig.json | 6 +++ 2 files changed, 43 insertions(+) create mode 100644 apps/vben5/packages/@abp/openiddict/package.json create mode 100644 apps/vben5/packages/@abp/openiddict/tsconfig.json diff --git a/apps/vben5/packages/@abp/openiddict/package.json b/apps/vben5/packages/@abp/openiddict/package.json new file mode 100644 index 000000000..2824afaf8 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/package.json @@ -0,0 +1,37 @@ +{ + "name": "@abp/openiddict", + "version": "8.3.2", + "homepage": "https://github.com/colinin/abp-next-admin", + "bugs": "https://github.com/colinin/abp-next-admin/issues", + "repository": { + "type": "git", + "url": "git+https://github.com/colinin/abp-next-admin.git", + "directory": "packages/@abp/openiddict" + }, + "license": "MIT", + "type": "module", + "sideEffects": [ + "**/*.css" + ], + "exports": { + ".": { + "types": "./src/index.ts", + "default": "./src/index.ts" + } + }, + "dependencies": { + "@abp/core": "workspace:*", + "@abp/permission": "workspace:*", + "@abp/request": "workspace:*", + "@abp/ui": "workspace:*", + "@ant-design/icons-vue": "catalog:", + "@vben/access": "workspace:*", + "@vben/common-ui": "workspace:*", + "@vben/hooks": "workspace:*", + "@vben/icons": "workspace:*", + "@vben/layouts": "workspace:*", + "@vben/locales": "workspace:*", + "ant-design-vue": "catalog:", + "vue": "catalog:*" + } +} diff --git a/apps/vben5/packages/@abp/openiddict/tsconfig.json b/apps/vben5/packages/@abp/openiddict/tsconfig.json new file mode 100644 index 000000000..ce1a891fb --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/tsconfig.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@vben/tsconfig/web.json", + "include": ["src"], + "exclude": ["node_modules"] +} From c8a1d188e4d111fd41f5fd746b5bd09671d968f0 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 10:10:49 +0800 Subject: [PATCH 010/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?pplications=E7=B1=BB=E5=9E=8B=E5=AF=BC=E5=87=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/@abp/openiddict/src/index.ts | 1 + .../@abp/openiddict/src/types/applications.ts | 62 +++++++++++++++++++ .../@abp/openiddict/src/types/index.ts | 1 + 3 files changed, 64 insertions(+) create mode 100644 apps/vben5/packages/@abp/openiddict/src/index.ts create mode 100644 apps/vben5/packages/@abp/openiddict/src/types/applications.ts create mode 100644 apps/vben5/packages/@abp/openiddict/src/types/index.ts diff --git a/apps/vben5/packages/@abp/openiddict/src/index.ts b/apps/vben5/packages/@abp/openiddict/src/index.ts new file mode 100644 index 000000000..fcb073fef --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/index.ts @@ -0,0 +1 @@ +export * from './types'; diff --git a/apps/vben5/packages/@abp/openiddict/src/types/applications.ts b/apps/vben5/packages/@abp/openiddict/src/types/applications.ts new file mode 100644 index 000000000..d964debc5 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/types/applications.ts @@ -0,0 +1,62 @@ +import type { + Dictionary, + ExtensibleAuditedEntityDto, + ExtensibleObject, + PagedAndSortedResultRequestDto, +} from '@abp/core'; + +interface OpenIddictApplicationGetListInput + extends PagedAndSortedResultRequestDto { + filter?: string; +} + +interface OpenIddictApplicationCreateOrUpdateDto extends ExtensibleObject { + applicationType?: string; + clientId: string; + clientSecret?: string; + clientType?: string; + clientUri?: string; + consentType?: string; + displayName?: string; + displayNames?: Dictionary; + endpoints?: string[]; + grantTypes?: string[]; + logoUri?: string; + postLogoutRedirectUris?: string[]; + properties?: Dictionary; + redirectUris?: string[]; + requirements?: string[]; + responseTypes?: string[]; + scopes?: string[]; +} + +type OpenIddictApplicationCreateDto = OpenIddictApplicationCreateOrUpdateDto; + +type OpenIddictApplicationUpdateDto = OpenIddictApplicationCreateOrUpdateDto; + +interface OpenIddictApplicationDto extends ExtensibleAuditedEntityDto { + applicationType?: string; + clientId: string; + clientSecret?: string; + clientType?: string; + clientUri?: string; + consentType?: string; + displayName?: string; + displayNames?: Dictionary; + endpoints?: string[]; + grantTypes?: string[]; + logoUri?: string; + postLogoutRedirectUris?: string[]; + properties?: Dictionary; + redirectUris?: string[]; + requirements?: string[]; + responseTypes?: string[]; + scopes?: string[]; +} + +export type { + OpenIddictApplicationCreateDto, + OpenIddictApplicationDto, + OpenIddictApplicationGetListInput, + OpenIddictApplicationUpdateDto, +}; diff --git a/apps/vben5/packages/@abp/openiddict/src/types/index.ts b/apps/vben5/packages/@abp/openiddict/src/types/index.ts new file mode 100644 index 000000000..ad838b1d0 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/types/index.ts @@ -0,0 +1 @@ +export * from './applications'; From 7bb34a14084417e0d4bc573fd62fcd6395e0884e Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 10:13:20 +0800 Subject: [PATCH 011/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?pplications=E6=8E=A5=E5=8F=A3=E5=AF=BC=E5=87=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@abp/openiddict/src/api/applications.ts | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 apps/vben5/packages/@abp/openiddict/src/api/applications.ts diff --git a/apps/vben5/packages/@abp/openiddict/src/api/applications.ts b/apps/vben5/packages/@abp/openiddict/src/api/applications.ts new file mode 100644 index 000000000..43aff5d92 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/applications.ts @@ -0,0 +1,74 @@ +import type { PagedResultDto } from '@abp/core'; + +import type { + OpenIddictApplicationCreateDto, + OpenIddictApplicationDto, + OpenIddictApplicationGetListInput, + OpenIddictApplicationUpdateDto, +} from '../types/applications'; + +import { requestClient } from '@abp/request'; + +/** + * 新增应用 + * @param input 参数 + * @returns 应用实体数据传输对象 + */ +export function createApi( + input: OpenIddictApplicationCreateDto, +): Promise { + return requestClient.post( + '/api/openiddict/applications', + input, + ); +} + +/** + * 删除应用 + * @param id 应用id + */ +export function deleteApi(id: string): Promise { + return requestClient.delete(`/api/openiddict/applications/${id}`); +} + +/** + * 查询应用 + * @param id 应用id + * @returns 应用实体数据传输对象 + */ +export function getApi(id: string): Promise { + return requestClient.get( + `/api/openiddict/applications/${id}`, + ); +} + +/** + * 更新应用 + * @param id 应用id + * @returns 应用实体数据传输对象 + */ +export function updateApi( + id: string, + input: OpenIddictApplicationUpdateDto, +): Promise { + return requestClient.put( + `/api/openiddict/applications/${id}`, + input, + ); +} + +/** + * 查询应用分页列表 + * @param input 过滤参数 + * @returns 应用实体数据传输对象分页列表 + */ +export function getPagedListApi( + input?: OpenIddictApplicationGetListInput, +): Promise> { + return requestClient.get>( + `/api/openiddict/applications`, + { + params: input, + }, + ); +} From 20fc80c827eff59d7aa58cf6c491083c67d27f59 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 10:16:55 +0800 Subject: [PATCH 012/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?pplications=E6=9D=83=E9=99=90=E5=B8=B8=E9=87=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@abp/openiddict/src/constants/index.ts | 1 + .../@abp/openiddict/src/constants/permissions.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 apps/vben5/packages/@abp/openiddict/src/constants/index.ts create mode 100644 apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts diff --git a/apps/vben5/packages/@abp/openiddict/src/constants/index.ts b/apps/vben5/packages/@abp/openiddict/src/constants/index.ts new file mode 100644 index 000000000..c85954d3e --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/constants/index.ts @@ -0,0 +1 @@ +export * from './permissions'; diff --git a/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts b/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts new file mode 100644 index 000000000..dddd70bbb --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts @@ -0,0 +1,16 @@ +/** 用户权限 */ +export const IdentityUserPermissions = { + /** 新增 */ + Create: 'AbpOpenIddict.Applications.Create', + Default: 'AbpOpenIddict.Applications', + /** 删除 */ + Delete: 'AbpOpenIddict.Applications.Delete', + /** 管理功能 */ + ManageFeatures: 'AbpOpenIddict.Applications.ManageFeatures', + /** 管理权限 */ + ManagePermissions: 'AbpOpenIddict.Applications.ManagePermissions', + /** 管理密钥 */ + ManageSecret: 'AbpOpenIddict.Applications.ManageSecret', + /** 更新 */ + Update: 'AbpOpenIddict.Applications.Update', +}; From 8966c213d6e0c2c4fbf946a749029078a2eb5ae5 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 10:19:06 +0800 Subject: [PATCH 013/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?pplications=E7=BB=84=E4=BB=B6.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/applications/ApplicationModal.vue | 7 +++++++ .../src/components/applications/ApplicationTable.vue | 7 +++++++ .../vben5/packages/@abp/openiddict/src/components/index.ts | 1 + apps/vben5/packages/@abp/openiddict/src/index.ts | 2 ++ 4 files changed, 17 insertions(+) create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/index.ts diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue new file mode 100644 index 000000000..1017376d1 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue new file mode 100644 index 000000000..1017376d1 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/index.ts b/apps/vben5/packages/@abp/openiddict/src/components/index.ts new file mode 100644 index 000000000..018e0abbc --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/index.ts @@ -0,0 +1 @@ +export { default as ApplicationTable } from './applications/ApplicationTable.vue'; diff --git a/apps/vben5/packages/@abp/openiddict/src/index.ts b/apps/vben5/packages/@abp/openiddict/src/index.ts index fcb073fef..c688f3a89 100644 --- a/apps/vben5/packages/@abp/openiddict/src/index.ts +++ b/apps/vben5/packages/@abp/openiddict/src/index.ts @@ -1 +1,3 @@ +export * from './components'; +export * from './constants'; export * from './types'; From d729a88bd38b50ac37e078a32a5b3707a5392cad Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 10:25:49 +0800 Subject: [PATCH 014/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?pplications=E8=B7=AF=E7=94=B1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/vben5/apps/app-antd/package.json | 1 + .../app-antd/src/locales/langs/en-US/abp.json | 4 ++++ .../app-antd/src/locales/langs/zh-CN/abp.json | 4 ++++ .../app-antd/src/router/routes/modules/abp.ts | 20 +++++++++++++++++++ .../views/openiddict/applications/index.vue | 15 ++++++++++++++ 5 files changed, 44 insertions(+) create mode 100644 apps/vben5/apps/app-antd/src/views/openiddict/applications/index.vue diff --git a/apps/vben5/apps/app-antd/package.json b/apps/vben5/apps/app-antd/package.json index 8b95e821b..5a2f778b9 100644 --- a/apps/vben5/apps/app-antd/package.json +++ b/apps/vben5/apps/app-antd/package.json @@ -30,6 +30,7 @@ "@abp/auditing": "workspace:*", "@abp/core": "workspace:*", "@abp/identity": "workspace:*", + "@abp/openiddict": "workspace:*", "@abp/request": "workspace:*", "@abp/ui": "workspace:*", "@vben/access": "workspace:*", diff --git a/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json b/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json index f995ca518..841a8d0ab 100644 --- a/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json +++ b/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json @@ -11,5 +11,9 @@ "organizationUnits": "Organization Units", "auditLogs": "Audit Logs" } + }, + "openiddict": { + "title": "OpenIddict", + "applications": "Applications" } } diff --git a/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json b/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json index 3f6b04aa2..cb55b88b7 100644 --- a/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json +++ b/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json @@ -11,5 +11,9 @@ "organizationUnits": "组织机构", "auditLogs": "审计日志" } + }, + "openiddict": { + "title": "OpenIddict", + "applications": "应用管理" } } diff --git a/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts b/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts index 457a439c5..cbb011642 100644 --- a/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts +++ b/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts @@ -92,6 +92,26 @@ const routes: RouteRecordRaw[] = [ }, ], }, + { + meta: { + title: $t('abp.openiddict.title'), + icon: 'mdi:openid', + }, + name: 'OpenIddict', + path: '/openiddict', + children: [ + { + meta: { + title: $t('abp.openiddict.applications'), + icon: 'carbon:application', + }, + name: 'OpenIddictApplications', + path: '/openiddict/applications', + component: () => + import('#/views/openiddict/applications/index.vue'), + }, + ], + }, ], }, ]; diff --git a/apps/vben5/apps/app-antd/src/views/openiddict/applications/index.vue b/apps/vben5/apps/app-antd/src/views/openiddict/applications/index.vue new file mode 100644 index 000000000..1e347ea86 --- /dev/null +++ b/apps/vben5/apps/app-antd/src/views/openiddict/applications/index.vue @@ -0,0 +1,15 @@ + + + From b9b075274dfa0f6f09e3d780ccd6194819c4fdc9 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 16:25:52 +0800 Subject: [PATCH 015/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?pplications=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/vben5/apps/app-antd/vite.config.mts | 7 + .../packages/@abp/core/src/types/index.ts | 1 + .../packages/@abp/core/src/types/openid.ts | 28 ++ .../packages/@abp/openiddict/package.json | 3 +- .../@abp/openiddict/src/api/openid.ts | 13 + .../applications/ApplicationModal.vue | 446 +++++++++++++++++- .../applications/ApplicationTable.vue | 220 ++++++++- .../display-names/DisplayNameModal.vue | 81 ++++ .../display-names/DisplayNameTable.vue | 103 ++++ .../src/components/display-names/types.ts | 11 + .../components/properties/PropertyModal.vue | 66 +++ .../components/properties/PropertyTable.vue | 101 ++++ .../src/components/properties/types.ts | 11 + .../src/components/uris/UriModal.vue | 52 ++ .../src/components/uris/UriTable.vue | 106 +++++ .../openiddict/src/constants/permissions.ts | 4 +- 16 files changed, 1245 insertions(+), 8 deletions(-) create mode 100644 apps/vben5/packages/@abp/core/src/types/openid.ts create mode 100644 apps/vben5/packages/@abp/openiddict/src/api/openid.ts create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameModal.vue create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameTable.vue create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/display-names/types.ts create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyModal.vue create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyTable.vue create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/properties/types.ts create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/uris/UriModal.vue create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/uris/UriTable.vue diff --git a/apps/vben5/apps/app-antd/vite.config.mts b/apps/vben5/apps/app-antd/vite.config.mts index 4ccb102a9..9ac834557 100644 --- a/apps/vben5/apps/app-antd/vite.config.mts +++ b/apps/vben5/apps/app-antd/vite.config.mts @@ -6,6 +6,13 @@ export default defineConfig(async () => { vite: { server: { proxy: { + '/.well-known': { + changeOrigin: true, + // rewrite: (path) => path.replace(/^\/api/, ''), + // mock代理目标地址 + target: 'http://127.0.0.1:30001/', + ws: true, + }, '/api': { changeOrigin: true, // rewrite: (path) => path.replace(/^\/api/, ''), diff --git a/apps/vben5/packages/@abp/core/src/types/index.ts b/apps/vben5/packages/@abp/core/src/types/index.ts index cde3fc4a5..b34d7c5f1 100644 --- a/apps/vben5/packages/@abp/core/src/types/index.ts +++ b/apps/vben5/packages/@abp/core/src/types/index.ts @@ -1,6 +1,7 @@ export * from './dto'; export * from './global'; export * from './localization'; +export * from './openid'; export * from './rules'; export * from './settings'; export * from './table'; diff --git a/apps/vben5/packages/@abp/core/src/types/openid.ts b/apps/vben5/packages/@abp/core/src/types/openid.ts new file mode 100644 index 000000000..e5bfca3f8 --- /dev/null +++ b/apps/vben5/packages/@abp/core/src/types/openid.ts @@ -0,0 +1,28 @@ +interface OpenIdConfiguration { + authorization_endpoint: string; + backchannel_logout_session_supported: boolean; + backchannel_logout_supported: boolean; + check_session_iframe: string; + claims_supported: string[]; + code_challenge_methods_supported: string[]; + device_authorization_endpoint: string; + end_session_endpoint: string; + frontchannel_logout_session_supported: boolean; + frontchannel_logout_supported: boolean; + grant_types_supported: string[]; + id_token_signing_alg_values_supported: string[]; + introspection_endpoint: string; + issuer: string; + jwks_uri: string; + request_parameter_supported: boolean; + response_modes_supported: string[]; + response_types_supported: string[]; + revocation_endpoint: string; + scopes_supported: string[]; + subject_types_supported: string[]; + token_endpoint: string; + token_endpoint_auth_methods_supported: string[]; + userinfo_endpoint: string; +} + +export type { OpenIdConfiguration }; diff --git a/apps/vben5/packages/@abp/openiddict/package.json b/apps/vben5/packages/@abp/openiddict/package.json index 2824afaf8..6b7e75727 100644 --- a/apps/vben5/packages/@abp/openiddict/package.json +++ b/apps/vben5/packages/@abp/openiddict/package.json @@ -32,6 +32,7 @@ "@vben/layouts": "workspace:*", "@vben/locales": "workspace:*", "ant-design-vue": "catalog:", - "vue": "catalog:*" + "vue": "catalog:*", + "vxe-table": "catalog:" } } diff --git a/apps/vben5/packages/@abp/openiddict/src/api/openid.ts b/apps/vben5/packages/@abp/openiddict/src/api/openid.ts new file mode 100644 index 000000000..b9eec4dc6 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/openid.ts @@ -0,0 +1,13 @@ +import type { OpenIdConfiguration } from '@abp/core'; + +import { requestClient } from '@abp/request'; + +/** + * openid发现端点 + * @returns OpenId配置数据 + */ +export function discoveryApi(): Promise { + return requestClient.get( + '/.well-known/openid-configuration', + ); +} diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue index 1017376d1..48234d459 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue @@ -1,7 +1,449 @@ - + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue index 1017376d1..a39cd03bd 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue @@ -1,7 +1,221 @@ - + - + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameModal.vue new file mode 100644 index 000000000..1ad77f819 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameModal.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameTable.vue new file mode 100644 index 000000000..2ac62bac1 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/display-names/DisplayNameTable.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/display-names/types.ts b/apps/vben5/packages/@abp/openiddict/src/components/display-names/types.ts new file mode 100644 index 000000000..709e230cb --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/display-names/types.ts @@ -0,0 +1,11 @@ +import type { Dictionary } from '@abp/core'; + +interface DisplayNameInfo { + culture: string; + displayName: string; +} +interface DisplayNameProps { + data?: Dictionary; +} + +export type { DisplayNameInfo, DisplayNameProps }; diff --git a/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyModal.vue new file mode 100644 index 000000000..2e58c12ee --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyModal.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyTable.vue new file mode 100644 index 000000000..cd535e0fc --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/properties/PropertyTable.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/properties/types.ts b/apps/vben5/packages/@abp/openiddict/src/components/properties/types.ts new file mode 100644 index 000000000..5ab5c256b --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/properties/types.ts @@ -0,0 +1,11 @@ +import type { Dictionary } from '@abp/core'; + +interface PropertyInfo { + key: string; + value: string; +} +interface PropertyProps { + data?: Dictionary; +} + +export type { PropertyInfo, PropertyProps }; diff --git a/apps/vben5/packages/@abp/openiddict/src/components/uris/UriModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/uris/UriModal.vue new file mode 100644 index 000000000..4302457f6 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/uris/UriModal.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/uris/UriTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/uris/UriTable.vue new file mode 100644 index 000000000..956dea577 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/uris/UriTable.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts b/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts index dddd70bbb..a62eeeebf 100644 --- a/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts +++ b/apps/vben5/packages/@abp/openiddict/src/constants/permissions.ts @@ -1,5 +1,5 @@ -/** 用户权限 */ -export const IdentityUserPermissions = { +/** 应用权限 */ +export const ApplicationsPermissions = { /** 新增 */ Create: 'AbpOpenIddict.Applications.Create', Default: 'AbpOpenIddict.Applications', From cbcb191ffa6333a6aac8092239326c3dd40ca4a1 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 16:36:28 +0800 Subject: [PATCH 016/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?pplications=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applications/ApplicationTable.vue | 52 +++++++++++++++++-- .../permissions/PermissionModal.vue | 3 +- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue index a39cd03bd..7940f0d70 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue @@ -1,5 +1,6 @@ + diff --git a/apps/vben5/packages/@abp/permission/src/components/permissions/PermissionModal.vue b/apps/vben5/packages/@abp/permission/src/components/permissions/PermissionModal.vue index 62cf75f3f..f8d121907 100644 --- a/apps/vben5/packages/@abp/permission/src/components/permissions/PermissionModal.vue +++ b/apps/vben5/packages/@abp/permission/src/components/permissions/PermissionModal.vue @@ -48,7 +48,8 @@ const permissionTree = ref([]); const getPermissionTab = computed(() => { return (tree: PermissionTree) => { const grantCount = getGrantPermissionCount(tree); - return `${tree.displayName} (${grantCount})`; + const permissionCount = getPermissionCount(tree); + return `${tree.displayName} (${grantCount}/${permissionCount})`; }; }); From 5bc88e5698ab4a64d39d0a2e18256999d1748bdd Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 21 Dec 2024 17:04:16 +0800 Subject: [PATCH 017/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0a?= =?UTF-8?q?pplications=E5=AF=86=E9=92=A5=E7=AE=A1=E7=90=86.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applications/ApplicationSecretModal.vue | 83 +++++++++++++++++++ .../applications/ApplicationTable.vue | 22 +++++ 2 files changed, 105 insertions(+) create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue new file mode 100644 index 000000000..f8332a6bc --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue index 7940f0d70..93ca585da 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationTable.vue @@ -31,6 +31,7 @@ defineOptions({ const MenuItem = Menu.Item; const CheckIcon = createIconifyIcon('ant-design:check-outlined'); const CloseIcon = createIconifyIcon('ant-design:close-outlined'); +const SecretIcon = createIconifyIcon('codicon:gist-secret'); const PermissionsOutlined = createIconifyIcon('icon-park-outline:permissions'); const { hasAccessByCodes } = useAccess(); @@ -138,6 +139,11 @@ const [ApplicationModal, modalApi] = useVbenModal({ () => import('./ApplicationModal.vue'), ), }); +const [ApplicationSecretModal, secretModalApi] = useVbenModal({ + connectedComponent: defineAsyncComponent( + () => import('./ApplicationSecretModal.vue'), + ), +}); const [ApplicationPermissionModal, permissionModalApi] = useVbenModal({ connectedComponent: PermissionModal, }); @@ -182,6 +188,11 @@ const onMenuClick = (row: OpenIddictApplicationDto, info: MenuInfo) => { permissionModalApi.open(); break; } + case 'secret': { + secretModalApi.setData(row); + secretModalApi.open(); + break; + } } }; @@ -239,6 +250,16 @@ const onMenuClick = (row: OpenIddictApplicationDto, info: MenuInfo) => { From b60ecc20a87a6b61e6e66e7a54b5742e4be43be7 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 22 Dec 2024 08:36:08 +0800 Subject: [PATCH 018/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E7=B1=BB=E5=9E=8B=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applications/ApplicationSecretModal.vue | 1 - .../openiddict/src/types/authorization.ts | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 apps/vben5/packages/@abp/openiddict/src/types/authorization.ts diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue index f8332a6bc..cae8093ea 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationSecretModal.vue @@ -70,7 +70,6 @@ async function onSubmit(input: Record) { message.success($t('AbpUi.SavedSuccessfully')); emits('change', dto); modalApi.close(); - modalApi.close(); } diff --git a/apps/vben5/packages/@abp/openiddict/src/types/authorization.ts b/apps/vben5/packages/@abp/openiddict/src/types/authorization.ts new file mode 100644 index 000000000..eedc7712d --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/types/authorization.ts @@ -0,0 +1,29 @@ +import type { + Dictionary, + ExtensibleAuditedEntityDto, + PagedAndSortedResultRequestDto, +} from '@abp/core'; + +interface OpenIddictAuthorizationDto + extends ExtensibleAuditedEntityDto { + applicationId?: string; + creationDate?: string; + properties?: Dictionary; + scopes?: string[]; + status?: string; + subject?: string; + type?: string; +} + +interface OpenIddictAuthorizationGetListInput + extends PagedAndSortedResultRequestDto { + beginCreationTime?: string; + clientId?: string; + endCreationTime?: string; + filter?: string; + status?: string; + subject?: string; + type?: string; +} + +export type { OpenIddictAuthorizationDto, OpenIddictAuthorizationGetListInput }; From 94a7895f879409f61aedc0082554be661be6ca13 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 22 Dec 2024 08:38:13 +0800 Subject: [PATCH 019/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E6=8E=A5=E5=8F=A3=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@abp/openiddict/src/api/authorizations.ts | 43 +++++++++++++++++++ .../{authorization.ts => authorizations.ts} | 0 .../@abp/openiddict/src/types/index.ts | 1 + 3 files changed, 44 insertions(+) create mode 100644 apps/vben5/packages/@abp/openiddict/src/api/authorizations.ts rename apps/vben5/packages/@abp/openiddict/src/types/{authorization.ts => authorizations.ts} (100%) diff --git a/apps/vben5/packages/@abp/openiddict/src/api/authorizations.ts b/apps/vben5/packages/@abp/openiddict/src/api/authorizations.ts new file mode 100644 index 000000000..94540540d --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/api/authorizations.ts @@ -0,0 +1,43 @@ +import type { PagedResultDto } from '@abp/core'; + +import type { + OpenIddictAuthorizationDto, + OpenIddictAuthorizationGetListInput, +} from '../types/authorizations'; + +import { requestClient } from '@abp/request'; + +/** + * 删除授权 + * @param id 授权id + */ +export function deleteApi(id: string): Promise { + return requestClient.delete(`/api/openiddict/authorizations/${id}`); +} + +/** + * 查询授权 + * @param id 授权id + * @returns 授权实体数据传输对象 + */ +export function getApi(id: string): Promise { + return requestClient.get( + `/api/openiddict/authorizations/${id}`, + ); +} + +/** + * 查询授权分页列表 + * @param input 过滤参数 + * @returns 授权实体数据传输对象分页列表 + */ +export function getPagedListApi( + input?: OpenIddictAuthorizationGetListInput, +): Promise> { + return requestClient.get>( + `/api/openiddict/authorizations`, + { + params: input, + }, + ); +} diff --git a/apps/vben5/packages/@abp/openiddict/src/types/authorization.ts b/apps/vben5/packages/@abp/openiddict/src/types/authorizations.ts similarity index 100% rename from apps/vben5/packages/@abp/openiddict/src/types/authorization.ts rename to apps/vben5/packages/@abp/openiddict/src/types/authorizations.ts diff --git a/apps/vben5/packages/@abp/openiddict/src/types/index.ts b/apps/vben5/packages/@abp/openiddict/src/types/index.ts index ad838b1d0..7284dba88 100644 --- a/apps/vben5/packages/@abp/openiddict/src/types/index.ts +++ b/apps/vben5/packages/@abp/openiddict/src/types/index.ts @@ -1 +1,2 @@ export * from './applications'; +export * from './authorizations'; From efd0d8c08e266f4ffbf8e9f3b14ec9f956891ad5 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 22 Dec 2024 08:41:20 +0800 Subject: [PATCH 020/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E7=BB=84=E4=BB=B6.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../authorizations/AuthorizationModal.vue | 7 + .../authorizations/AuthorizationTable.vue | 222 ++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue create mode 100644 apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue diff --git a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue new file mode 100644 index 000000000..1017376d1 --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue new file mode 100644 index 000000000..5b0d4f24c --- /dev/null +++ b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue @@ -0,0 +1,222 @@ + + + + + From d3a8a1c95fc8d7c63f041b0602666f86c23d7fee Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 22 Dec 2024 08:45:19 +0800 Subject: [PATCH 021/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E8=B7=AF=E7=94=B1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app-antd/src/locales/langs/en-US/abp.json | 3 ++- .../app-antd/src/locales/langs/zh-CN/abp.json | 3 ++- .../app-antd/src/router/routes/modules/abp.ts | 10 ++++++++++ .../src/views/openiddict/authorizations/index.vue | 15 +++++++++++++++ .../@abp/openiddict/src/components/index.ts | 1 + 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 apps/vben5/apps/app-antd/src/views/openiddict/authorizations/index.vue diff --git a/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json b/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json index 841a8d0ab..84e4c6eb2 100644 --- a/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json +++ b/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json @@ -14,6 +14,7 @@ }, "openiddict": { "title": "OpenIddict", - "applications": "Applications" + "applications": "Applications", + "authorizations": "Authorizations" } } diff --git a/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json b/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json index cb55b88b7..f888d040a 100644 --- a/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json +++ b/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json @@ -14,6 +14,7 @@ }, "openiddict": { "title": "OpenIddict", - "applications": "应用管理" + "applications": "应用管理", + "authorizations": "授权管理" } } diff --git a/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts b/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts index cbb011642..414096bbc 100644 --- a/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts +++ b/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts @@ -110,6 +110,16 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/openiddict/applications/index.vue'), }, + { + meta: { + title: $t('abp.openiddict.authorizations'), + icon: 'arcticons:ente-authenticator', + }, + name: 'OpenIddictAuthorizations', + path: '/openiddict/authorizations', + component: () => + import('#/views/openiddict/authorizations/index.vue'), + }, ], }, ], diff --git a/apps/vben5/apps/app-antd/src/views/openiddict/authorizations/index.vue b/apps/vben5/apps/app-antd/src/views/openiddict/authorizations/index.vue new file mode 100644 index 000000000..cb96f15fd --- /dev/null +++ b/apps/vben5/apps/app-antd/src/views/openiddict/authorizations/index.vue @@ -0,0 +1,15 @@ + + + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/index.ts b/apps/vben5/packages/@abp/openiddict/src/components/index.ts index 018e0abbc..3cfe46c08 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/index.ts +++ b/apps/vben5/packages/@abp/openiddict/src/components/index.ts @@ -1 +1,2 @@ export { default as ApplicationTable } from './applications/ApplicationTable.vue'; +export { default as AuthorizationTable } from './authorizations/AuthorizationTable.vue'; From 3f6bee92647b47c257ec48e89efb2c5701e23e69 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 22 Dec 2024 11:07:55 +0800 Subject: [PATCH 022/170] =?UTF-8?q?feat(openiddict):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E9=A2=84=E8=A7=88=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/@abp/identity/src/api/index.ts | 1 + .../@abp/identity/src/api/users-lookup.ts | 55 ++++++ .../identity/src/constants/permissions.ts | 8 + .../vben5/packages/@abp/identity/src/index.ts | 1 + .../packages/@abp/identity/src/types/users.ts | 10 + .../packages/@abp/openiddict/package.json | 5 + .../authorizations/AuthorizationModal.vue | 151 ++++++++++++++- .../authorizations/AuthorizationTable.vue | 181 +++++++++++------- .../openiddict/src/constants/permissions.ts | 8 + apps/vben5/pnpm-workspace.yaml | 2 + 10 files changed, 355 insertions(+), 67 deletions(-) create mode 100644 apps/vben5/packages/@abp/identity/src/api/index.ts create mode 100644 apps/vben5/packages/@abp/identity/src/api/users-lookup.ts diff --git a/apps/vben5/packages/@abp/identity/src/api/index.ts b/apps/vben5/packages/@abp/identity/src/api/index.ts new file mode 100644 index 000000000..fe13a9e18 --- /dev/null +++ b/apps/vben5/packages/@abp/identity/src/api/index.ts @@ -0,0 +1 @@ +export * as userLookupApi from './users-lookup'; diff --git a/apps/vben5/packages/@abp/identity/src/api/users-lookup.ts b/apps/vben5/packages/@abp/identity/src/api/users-lookup.ts new file mode 100644 index 000000000..443970ece --- /dev/null +++ b/apps/vben5/packages/@abp/identity/src/api/users-lookup.ts @@ -0,0 +1,55 @@ +import type { ListResultDto } from '@abp/core'; + +import type { + IdentityUserDto, + UserLookupCountInput, + UserLookupSearchInput, +} from '../types/users'; + +import { requestClient } from '@abp/request'; + +/** + * 通过id查询用户 + * @param id 用户id + * @returns 用户实体数据传输对象 + */ +export function findByIdApi(id: string): Promise { + return requestClient.get(`/api/identity/users/lookup/${id}`); +} + +/** + * 通过用户名查询用户 + * @param userName 用户名 + * @returns 用户实体数据传输对象 + */ +export function findByUserNameApi(userName: string): Promise { + return requestClient.get( + `/api/identity/users/lookup/by-username/${userName}`, + ); +} + +/** + * 搜索用户列表 + * @param input 搜索过滤条件 + * @returns 用户实体数据传输对象列表 + */ +export function searchApi( + input?: UserLookupSearchInput, +): Promise> { + return requestClient.get>( + `/api/identity/users/lookup/search`, + { + params: input, + }, + ); +} + +/** + * 搜索用户数量 + * @param input 搜索过滤条件 + */ +export function countApi(input?: UserLookupCountInput): Promise { + return requestClient.get(`/api/identity/users/lookup/count`, { + params: input, + }); +} diff --git a/apps/vben5/packages/@abp/identity/src/constants/permissions.ts b/apps/vben5/packages/@abp/identity/src/constants/permissions.ts index 23faa1206..3d58d9e4b 100644 --- a/apps/vben5/packages/@abp/identity/src/constants/permissions.ts +++ b/apps/vben5/packages/@abp/identity/src/constants/permissions.ts @@ -45,3 +45,11 @@ export const SecurityLogPermissions = { /** 删除 */ Delete: 'AbpAuditing.SecurityLog.Delete', }; +/** + * 搜索用户权限 + * @deprecated 后台服务删除权限后将无法使用. + * @todo 需要检查abp框架权限定义 + */ +export const UserLookupPermissions = { + Default: 'AbpIdentity.UserLookup', +}; diff --git a/apps/vben5/packages/@abp/identity/src/index.ts b/apps/vben5/packages/@abp/identity/src/index.ts index c688f3a89..f43dbaee0 100644 --- a/apps/vben5/packages/@abp/identity/src/index.ts +++ b/apps/vben5/packages/@abp/identity/src/index.ts @@ -1,3 +1,4 @@ +export * from './api'; export * from './components'; export * from './constants'; export * from './types'; diff --git a/apps/vben5/packages/@abp/identity/src/types/users.ts b/apps/vben5/packages/@abp/identity/src/types/users.ts index 9c718cd88..b0d821947 100644 --- a/apps/vben5/packages/@abp/identity/src/types/users.ts +++ b/apps/vben5/packages/@abp/identity/src/types/users.ts @@ -90,6 +90,14 @@ interface GetUserPagedListInput extends PagedAndSortedResultRequestDto { type IdentityUserCreateDto = IdentityUserCreateOrUpdateDto; type IdentityUserUpdateDto = IdentityUserCreateOrUpdateDto; +interface UserLookupCountInput { + filter?: string; +} + +interface UserLookupSearchInput + extends UserLookupCountInput, + PagedAndSortedResultRequestDto {} + export type { ChangeMyPasswordInput, ChangeUserPasswordInput, @@ -98,4 +106,6 @@ export type { IdentityUserDto, IdentityUserOrganizationUnitUpdateDto, IdentityUserUpdateDto, + UserLookupCountInput, + UserLookupSearchInput, }; diff --git a/apps/vben5/packages/@abp/openiddict/package.json b/apps/vben5/packages/@abp/openiddict/package.json index 6b7e75727..c5e925adc 100644 --- a/apps/vben5/packages/@abp/openiddict/package.json +++ b/apps/vben5/packages/@abp/openiddict/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@abp/core": "workspace:*", + "@abp/identity": "workspace:*", "@abp/permission": "workspace:*", "@abp/request": "workspace:*", "@abp/ui": "workspace:*", @@ -32,7 +33,11 @@ "@vben/layouts": "workspace:*", "@vben/locales": "workspace:*", "ant-design-vue": "catalog:", + "lodash.debounce": "catalog:", "vue": "catalog:*", "vxe-table": "catalog:" + }, + "devDependencies": { + "@types/lodash.debounce": "catalog:" } } diff --git a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue index 1017376d1..cac36ece7 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationModal.vue @@ -1,7 +1,154 @@ - + diff --git a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue index 5b0d4f24c..eb0e28715 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/authorizations/AuthorizationTable.vue @@ -1,25 +1,26 @@ diff --git a/apps/vben5/packages/@abp/notifications/package.json b/apps/vben5/packages/@abp/notifications/package.json index e6cbdf7fd..b28f76179 100644 --- a/apps/vben5/packages/@abp/notifications/package.json +++ b/apps/vben5/packages/@abp/notifications/package.json @@ -20,6 +20,7 @@ } }, "dependencies": { + "@abp/components": "workspace:*", "@abp/core": "workspace:*", "@abp/request": "workspace:*", "@abp/signalr": "workspace:*", diff --git a/apps/vben5/packages/@abp/notifications/src/components/my-notifilers/MyNotificationModal.vue b/apps/vben5/packages/@abp/notifications/src/components/my-notifilers/MyNotificationModal.vue new file mode 100644 index 000000000..048bd8c1d --- /dev/null +++ b/apps/vben5/packages/@abp/notifications/src/components/my-notifilers/MyNotificationModal.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/apps/vben5/packages/@abp/notifications/src/components/my-notifilers/MyNotificationTable.vue b/apps/vben5/packages/@abp/notifications/src/components/my-notifilers/MyNotificationTable.vue index 9611cd7a3..4ff70c04f 100644 --- a/apps/vben5/packages/@abp/notifications/src/components/my-notifilers/MyNotificationTable.vue +++ b/apps/vben5/packages/@abp/notifications/src/components/my-notifilers/MyNotificationTable.vue @@ -4,8 +4,9 @@ import type { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import type { Notification } from '../../types/notifications'; -import { h, ref } from 'vue'; +import { defineAsyncComponent, h, ref } from 'vue'; +import { useVbenModal } from '@vben/common-ui'; import { createIconifyIcon } from '@vben/icons'; import { $t } from '@vben/locales'; @@ -189,8 +190,16 @@ const [Grid, gridApi] = useVbenVxeGrid({ gridOptions, }); +const [NotificationModal, modalApi] = useVbenModal({ + connectedComponent: defineAsyncComponent( + () => import('./MyNotificationModal.vue'), + ), +}); + /** 点击行标记已读 */ async function onClickRead(row: Notification) { + modalApi.setData(row); + modalApi.open(); await _onRead([row.id], NotificationReadState.Read); } @@ -228,7 +237,7 @@ async function _onRead(idList: string[], state: NotificationReadState) { idList, state, }); - await gridApi.reload(); + await gridApi.query(); } finally { gridApi.setLoading(false); } @@ -332,6 +341,7 @@ const onDelete = (row: Notification) => { + diff --git a/apps/vben5/packages/@abp/openiddict/package.json b/apps/vben5/packages/@abp/openiddict/package.json index 36bfec846..48f180de4 100644 --- a/apps/vben5/packages/@abp/openiddict/package.json +++ b/apps/vben5/packages/@abp/openiddict/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@abp/auditing": "workspace:*", + "@abp/components": "workspace:*", "@abp/core": "workspace:*", "@abp/identity": "workspace:*", "@abp/permissions": "workspace:*", diff --git a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue index 01690113d..193422668 100644 --- a/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue +++ b/apps/vben5/packages/@abp/openiddict/src/components/applications/ApplicationModal.vue @@ -5,12 +5,13 @@ import type { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import type { DefaultOptionType } from 'ant-design-vue/es/select'; import type { TransferItem } from 'ant-design-vue/es/transfer'; +import type { Component } from 'vue'; + import type { OpenIddictApplicationDto } from '../../types/applications'; import type { DisplayNameInfo } from '../display-names/types'; import type { PropertyInfo } from '../properties/types'; import { - type Component, computed, defineAsyncComponent, defineEmits, @@ -30,6 +31,7 @@ import { Dropdown, Form, Input, + InputNumber, InputPassword, Menu, message, @@ -139,9 +141,6 @@ const getSupportScopes = computed((): TransferItem[] => { }; }); }); -const getPkceEnabled = computed(() => { - return formModel.value.requirements?.includes('pkce'); -}); const { discoveryApi } = useOpenIdApi(); const { cancel, createApi, getApi, updateApi } = useApplicationsApi(); @@ -270,13 +269,6 @@ function onUriDelete(uri: string) { } } } -function onPkceChange(checked: boolean) { - const requirements: string[] = []; - if (checked) { - requirements.push('pkce'); - } - formModel.value.requirements = requirements; -} + diff --git a/apps/vben5/packages/@abp/platform/src/components/messages/sms/SmsMessageTable.vue b/apps/vben5/packages/@abp/platform/src/components/messages/sms/SmsMessageTable.vue index 7e9d26abf..b805b457e 100644 --- a/apps/vben5/packages/@abp/platform/src/components/messages/sms/SmsMessageTable.vue +++ b/apps/vben5/packages/@abp/platform/src/components/messages/sms/SmsMessageTable.vue @@ -12,11 +12,7 @@ import { $t } from '@vben/locales'; import { formatToDateTime } from '@abp/core'; import { useVbenVxeGrid } from '@abp/ui'; -import { - DeleteOutlined, - EditOutlined, - EllipsisOutlined, -} from '@ant-design/icons-vue'; +import { DeleteOutlined, EllipsisOutlined } from '@ant-design/icons-vue'; import { Button, Dropdown, Menu, message, Modal, Tag } from 'ant-design-vue'; import { useSmsMessagesApi } from '../../../api/useSmsMessagesApi'; @@ -157,7 +153,7 @@ const gridOptions: VxeGridProps = { slots: { default: 'action' }, title: $t('AbpUi.Actions'), visible: hasAccessByCodes([SmsMessagesPermissions.Delete]), - width: 220, + width: 160, }, ], exportConfig: {}, @@ -191,10 +187,6 @@ const [Grid, gridApi] = useVbenVxeGrid({ gridOptions, }); -function onUpdate(row: SmsMessageDto) { - console.warn('onUpdate is not implementation!', row); -} - function onDelete(row: SmsMessageDto) { Modal.confirm({ afterClose: () => { @@ -207,7 +199,7 @@ function onDelete(row: SmsMessageDto) { gridApi.setLoading(true); await deleteApi(row.id); message.success($t('AbpUi.SuccessfullyDeleted')); - gridApi.reload(); + gridApi.query(); } finally { gridApi.setLoading(false); } @@ -225,7 +217,7 @@ async function onSend(row: SmsMessageDto) { gridApi.setLoading(true); await sendApi(row.id); message.success($t('AppPlatform.SuccessfullySent')); - gridApi.reload(); + gridApi.query(); } finally { gridApi.setLoading(false); } @@ -257,14 +249,6 @@ async function onMenuClick(row: SmsMessageDto, info: MenuInfo) { diff --git a/apps/vben5/packages/@abp/settings/package.json b/apps/vben5/packages/@abp/settings/package.json index 0f8f957ac..1e2c40f78 100644 --- a/apps/vben5/packages/@abp/settings/package.json +++ b/apps/vben5/packages/@abp/settings/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@abp/core": "workspace:*", + "@abp/features": "workspace:*", "@abp/request": "workspace:*", "@abp/ui": "workspace:*", "@ant-design/icons-vue": "catalog:", diff --git a/apps/vben5/packages/@abp/settings/src/components/settings/SettingForm.vue b/apps/vben5/packages/@abp/settings/src/components/settings/SettingForm.vue index 59b7b7fc9..e7b0a6104 100644 --- a/apps/vben5/packages/@abp/settings/src/components/settings/SettingForm.vue +++ b/apps/vben5/packages/@abp/settings/src/components/settings/SettingForm.vue @@ -110,16 +110,19 @@ onMounted(onGet);