Browse Source

feat: cap支持多租户

feat/cap 9.1.0.1
Hanpaopao 1 year ago
parent
commit
08e1b70e5a
  1. 3
      aspnet-core/frameworks/src/Lion.AbpPro.CAP/Lion/AbpPro/CAP/AbpProCAPSubscribeInvoker.cs
  2. 1
      aspnet-core/frameworks/src/Lion.AbpPro.CAP/Lion/AbpPro/CAP/AbpProCapServiceCollectionExtensions.cs
  3. 10
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json
  4. 2
      aspnet-core/services/src/Lion.AbpPro.DbMigrator/appsettings.json

3
aspnet-core/frameworks/src/Lion.AbpPro.CAP/Lion/AbpPro/CAP/AbpProCAPSubscribeInvoker.cs

@ -5,12 +5,13 @@ using Microsoft.Extensions.Internal;
namespace Lion.AbpPro.CAP;
public class AbpProCAPSubscribeInvoker
public class AbpProCAPSubscribeInvoker : ISubscribeInvoker
{
private readonly ConcurrentDictionary<string, ObjectMethodExecutor> _executors;
private readonly ISerializer _serializer;
private readonly IServiceProvider _serviceProvider;
private readonly ICurrentTenant _currentTenant;
public AbpProCAPSubscribeInvoker(IServiceProvider serviceProvider, ISerializer serializer, ICurrentTenant currentTenant)
{
_serviceProvider = serviceProvider;

1
aspnet-core/frameworks/src/Lion.AbpPro.CAP/Lion/AbpPro/CAP/AbpProCapServiceCollectionExtensions.cs

@ -6,6 +6,7 @@ public static class AbpProCapServiceCollectionExtensions
{
context.Services.Replace(ServiceDescriptor.Transient<IUnitOfWork, AbpProCapUnitOfWork>());
context.Services.Replace(ServiceDescriptor.Transient<UnitOfWork, AbpProCapUnitOfWork>());
context.Services.AddSingleton<ISubscribeInvoker, AbpProCAPSubscribeInvoker>();
context.Services.AddTransient<AbpProCapUnitOfWork>();
context.Services.AddCap(capAction);
return context;

10
aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json

@ -31,19 +31,19 @@
},
"App": {
"SelfUrl": "http://localhost:44315",
"CorsOrigins": "https://*.AbpPro.com,http://localhost:4200,http://182.43.18.151:44320,http://182.43.18.151:44321,http://182.43.18.151:44322,http://182.43.18.151:44318"
"CorsOrigins": "https://*.AbpPro.com,http://localhost:4200,http://localhost:44320,http://localhost:44321,http://localhost:44322,http://localhost:44318"
},
"ConnectionStrings": {
"Default": "Data Source=182.43.18.151;Port=3306;Database=LionAbpProDemo9;uid=root;pwd=IFKy!Cufe3V9sYcz;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
"Default": "Data Source=localhost;Port=3306;Database=LionAbpProDemo9;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
},
"Hangfire": {
"Redis": {
"Host": "182.43.18.151:6379,password=1q2w3E*",
"Host": "localhost:6379,password=1q2w3E*",
"DB": "2"
}
},
"Redis": {
"Configuration": "182.43.18.151:6379,password=1q2w3E*,defaultdatabase=9"
"Configuration": "localhost:6379,password=1q2w3E*,defaultdatabase=9"
},
"Jwt": {
"Audience": "Lion.AbpPro",
@ -52,7 +52,7 @@
"ExpirationTime": 2
},
"Cap": {
"Enabled": false,
"Enabled": true,
"RabbitMq": {
"HostName": "localhost",
"UserName": "admin",

2
aspnet-core/services/src/Lion.AbpPro.DbMigrator/appsettings.json

@ -1,5 +1,5 @@
{
"ConnectionStrings": {
"Default": "Data Source=localhost;Port=3306;Database=LionAbpPro91;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
"Default": "Data Source=localhost;Port=3306;Database=LionAbpProDemo9;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
}
}
Loading…
Cancel
Save