Browse Source

Fix tenant model binding failed

pull/269/head
cKey 5 years ago
parent
commit
0ffa880310
  1. 7
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 9
      aspnet-core/LINGYUN.MicroService.Common.sln
  3. 2
      aspnet-core/database/ApiGateway-Init-SqlServer.sql
  4. 4
      aspnet-core/database/ApiGateway-Init.sql
  5. 6
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN/ApiGateway/ApiGatewayHttpApiModule.cs
  6. 6
      aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AbpAuditingHttpApiModule.cs
  7. 7
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml
  8. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/TenantStore.cs
  9. 15
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/ITenantAppService.cs
  10. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Localization/Resources/en.json
  11. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Localization/Resources/zh-Hans.json
  12. 20
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN/Abp/TenantManagement/TenantAppService.cs
  13. 8
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN/Abp/TenantManagement/AbpTenantManagementHttpApiModule.cs
  14. 14
      aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN/Abp/TenantManagement/TenantController.cs
  15. 6
      aspnet-core/tests/LINGYUN.Abp.Rules.RulesEngine.Tests/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineTestModule.cs
  16. 8
      vueJs/src/api/tenant-management.ts

7
aspnet-core/LINGYUN.MicroService.All.sln

@ -294,8 +294,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Xm
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Xml.Tests", "tests\LINGYUN.Abp.Localization.Xml.Tests\LINGYUN.Abp.Localization.Xml.Tests.csproj", "{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Json.Tests", "tests\LINGYUN.Abp.Localization.Json.Tests\LINGYUN.Abp.Localization.Json.Tests.csproj", "{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Dynamic", "modules\common\LINGYUN.Abp.Localization.Dynamic\LINGYUN.Abp.Localization.Dynamic.csproj", "{4A9043FD-24A3-4A4A-956B-9CB71876F415}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "localization-management", "localization-management", "{D3BAA44E-8395-4E8A-AA96-6B463356C537}"
@ -811,10 +809,6 @@ Global
{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED}.Release|Any CPU.Build.0 = Release|Any CPU
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161}.Release|Any CPU.Build.0 = Release|Any CPU
{4A9043FD-24A3-4A4A-956B-9CB71876F415}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A9043FD-24A3-4A4A-956B-9CB71876F415}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A9043FD-24A3-4A4A-956B-9CB71876F415}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -1017,7 +1011,6 @@ Global
{90E88EAC-4291-4406-8D88-EFDF61B11292} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{84868710-ECBB-4025-900A-EEB99EC49534} = {90E88EAC-4291-4406-8D88-EFDF61B11292}
{A061D2B4-B650-4F7F-A6CB-5C8FFFD512ED} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{EBCF7D88-49E2-413D-A7A6-1A76BC2E8161} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{4A9043FD-24A3-4A4A-956B-9CB71876F415} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{D3BAA44E-8395-4E8A-AA96-6B463356C537} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{5BE18D72-0D02-4854-966E-745CE5DAF77F} = {D3BAA44E-8395-4E8A-AA96-6B463356C537}

9
aspnet-core/LINGYUN.MicroService.Common.sln

@ -123,8 +123,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Xm
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Xml.Tests", "tests\LINGYUN.Abp.Localization.Xml.Tests\LINGYUN.Abp.Localization.Xml.Tests.csproj", "{94FEA59E-3B6D-41A0-9E44-BA5D6477244F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Localization.Json.Tests", "tests\LINGYUN.Abp.Localization.Json.Tests\LINGYUN.Abp.Localization.Json.Tests.csproj", "{BA2F4EC9-BC2C-482A-9123-BDACB8B15295}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dapr", "dapr", "{7FDFB22F-1BFF-4E05-9427-78B7A8461D50}"
ProjectSection(SolutionItems) = preProject
modules\dapr\README.md = modules\dapr\README.md
@ -156,7 +154,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Dapr.AspNetCore
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Dapr.Actors.Tests", "tests\LINGYUN.Abp.Dapr.Actors.Tests\LINGYUN.Abp.Dapr.Actors.Tests.csproj", "{CF30221B-CA7A-42CD-B91A-B7224AB2F38B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.AspNetCore.HttpOverrides", "modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj", "{191BB108-546E-4E70-978E-D6A8149C319C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.HttpOverrides", "modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj", "{191BB108-546E-4E70-978E-D6A8149C319C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -356,10 +354,6 @@ Global
{94FEA59E-3B6D-41A0-9E44-BA5D6477244F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94FEA59E-3B6D-41A0-9E44-BA5D6477244F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94FEA59E-3B6D-41A0-9E44-BA5D6477244F}.Release|Any CPU.Build.0 = Release|Any CPU
{BA2F4EC9-BC2C-482A-9123-BDACB8B15295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA2F4EC9-BC2C-482A-9123-BDACB8B15295}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA2F4EC9-BC2C-482A-9123-BDACB8B15295}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA2F4EC9-BC2C-482A-9123-BDACB8B15295}.Release|Any CPU.Build.0 = Release|Any CPU
{C72E0407-06FE-4CAA-86E5-30FF216A7B82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C72E0407-06FE-4CAA-86E5-30FF216A7B82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C72E0407-06FE-4CAA-86E5-30FF216A7B82}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -475,7 +469,6 @@ Global
{E73A0F8B-2B4B-4CED-82A4-1EE5E0B89744} = {02EA4E78-5891-43BC-944F-3E52FEE032E4}
{8CC72F4E-F134-4A43-9037-5D4D1F29B68A} = {E73A0F8B-2B4B-4CED-82A4-1EE5E0B89744}
{94FEA59E-3B6D-41A0-9E44-BA5D6477244F} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{BA2F4EC9-BC2C-482A-9123-BDACB8B15295} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{7FDFB22F-1BFF-4E05-9427-78B7A8461D50} = {02EA4E78-5891-43BC-944F-3E52FEE032E4}
{C72E0407-06FE-4CAA-86E5-30FF216A7B82} = {7FDFB22F-1BFF-4E05-9427-78B7A8461D50}
{E74FF671-6E5E-430C-9211-ED910634DDBE} = {7FDFB22F-1BFF-4E05-9427-78B7A8461D50}

2
aspnet-core/database/ApiGateway-Init-SqlServer.sql

File diff suppressed because one or more lines are too long

4
aspnet-core/database/ApiGateway-Init.sql

@ -1389,8 +1389,8 @@ INSERT INTO `appapigatewayreroute` VALUES (60, '{}', '8409117162504f71aa66982f05
INSERT INTO `appapigatewayreroute` VALUES (61, '{}', '9f520820071b4e14bc94ab57989cea1f', 1263304204797648896, '【平台服务】- 框架配置', '/api/abp/application-configuration', '', '', '/api/abp/platform/application-configuration', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30025,', '', '', 'platform-configuration', 0, 120000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (62, '{}', '530ab314560f41678b40f48da9383d51', 1263304872891555840, '【后台管理】- 租户管理', '/api/tenant-management/tenants', '', '', '/api/tenant-management/tenants', 'GET,POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (63, '{}', '21334c6da4c349cc883c38c13de0e754', 1263305106250047488, '【后台管理】- 特定租户管理', '/api/tenant-management/tenants/{id}', '', '', '/api/tenant-management/tenants/{id}', 'GET,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (64, '{}', 'cc8fdf1b2d0b414ebf2dc51a6dc78305', 1263305244594970624, '【后台管理】- 租户连接字符串', '/api/tenant-management/tenants/{id}/connection-string', '', '', '/api/tenant-management/tenants/{id}/concatenation', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 2, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (65, '{}', 'aaf285ed10da4024ba561d5cf8c6322b', 1263305430536855552, '【后台管理】- 特定租户连接字符串', '/api/tenant-management/tenants/{id}/connection-string/{name}', '', '', '/api/tenant-management/tenants/{id}/concatenation/{name}', 'GET,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 1, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (64, '{}', 'cc8fdf1b2d0b414ebf2dc51a6dc78305', 1263305244594970624, '【后台管理】- 租户连接字符串', '/api/tenant-management/tenants/{id}/connection-string', '', '', '/api/tenant-management/tenants/{id}/connection-string', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 2, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (65, '{}', 'aaf285ed10da4024ba561d5cf8c6322b', 1263305430536855552, '【后台管理】- 特定租户连接字符串', '/api/tenant-management/tenants/{id}/connection-string/{name}', '', '', '/api/tenant-management/tenants/{id}/connection-string/{name}', 'GET,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 1, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (66, '{}', '6a7da198f4c84d94969a437adc47642b', 1263639172959174656, '【后台管理】- 全局设置', '/api/setting-management/settings/by-global', '', '', '/api/setting-management/settings/by-global/app', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', 'setting-global', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (67, '{}', '755b4dce5c34444785fa3b647fef4131', 1264799968944640000, '【身份认证服务】- 验证手机号', '/api/account/phone/verify', '', '', '/api/account/phone/verify', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (68, '{}', '535191c570ae453ab320012304d7a62c', 1264800070161584128, '【身份认证服务】- 手机号注册', '/api/account/phone/register', '', '', '/api/account/phone/register', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');

6
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN/ApiGateway/ApiGatewayHttpApiModule.cs

@ -2,6 +2,7 @@
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
@ -19,6 +20,11 @@ namespace LINGYUN.ApiGateway
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(ApiGatewayHttpApiModule).Assembly);
});
PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(typeof(ApiGatewayResource), typeof(ApiGatewayApplicationContractsModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)

6
aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AbpAuditingHttpApiModule.cs

@ -1,6 +1,7 @@
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AuditLogging.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
@ -18,6 +19,11 @@ namespace LINGYUN.Abp.Auditing
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAuditingHttpApiModule).Assembly);
});
PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(typeof(AuditLoggingResource), typeof(AbpAuditingApplicationContractsModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)

7
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml

@ -9,6 +9,11 @@
消费者查找器
</summary>
</member>
<member name="P:DotNetCore.CAP.ConsumerServiceSelector.CapOptions">
<summary>
CAP配置
</summary>
</member>
<member name="P:DotNetCore.CAP.ConsumerServiceSelector.AbpDistributedEventBusOptions">
<summary>
Abp分布式事件配置
@ -19,7 +24,7 @@
服务提供者
</summary>
</member>
<member name="M:DotNetCore.CAP.ConsumerServiceSelector.#ctor(System.IServiceProvider,Microsoft.Extensions.Options.IOptions{Volo.Abp.EventBus.Distributed.AbpDistributedEventBusOptions})">
<member name="M:DotNetCore.CAP.ConsumerServiceSelector.#ctor(System.IServiceProvider,Microsoft.Extensions.Options.IOptions{DotNetCore.CAP.CapOptions},Microsoft.Extensions.Options.IOptions{Volo.Abp.EventBus.Distributed.AbpDistributedEventBusOptions})">
<summary>
Creates a new <see cref="T:DotNetCore.CAP.Internal.ConsumerServiceSelector" />.
</summary>

2
aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/TenantStore.cs

@ -124,7 +124,7 @@ namespace LINGYUN.Abp.MultiTenancy.RemoteService
}
Logger.LogDebug($"Not found in the cache, getting from the remote service: {cacheKey}");
var tenantDto = await _tenantAppService.GetAsync(new TenantGetByNameInputDto(name));
var tenantDto = await _tenantAppService.GetAsync(name);
var tenantConnectionStringsDto = await _tenantAppService.GetConnectionStringAsync(tenantDto.Id);
var connectionStrings = new ConnectionStrings();
foreach (var tenantConnectionString in tenantConnectionStringsDto.Items)

15
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/ITenantAppService.cs

@ -1,4 +1,5 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
@ -7,14 +8,22 @@ namespace LINGYUN.Abp.TenantManagement
{
public interface ITenantAppService : ICrudAppService<TenantDto, Guid, TenantGetByPagedInputDto, TenantCreateDto, TenantUpdateDto>
{
Task<TenantDto> GetAsync(TenantGetByNameInputDto tenantGetByNameInput);
Task<TenantDto> GetAsync(
[Required]
string name);
Task<TenantConnectionStringDto> GetConnectionStringAsync(TenantConnectionGetByNameInputDto tenantConnectionGetByName);
Task<TenantConnectionStringDto> GetConnectionStringAsync(
Guid id,
[Required]
string connectionName);
Task<ListResultDto<TenantConnectionStringDto>> GetConnectionStringAsync(Guid id);
Task<TenantConnectionStringDto> SetConnectionStringAsync(Guid id, TenantConnectionStringCreateOrUpdateDto tenantConnectionStringCreateOrUpdate);
Task DeleteConnectionStringAsync(TenantConnectionGetByNameInputDto tenantConnectionGetByName);
Task DeleteConnectionStringAsync(
Guid id,
[Required]
string connectionName);
}
}

2
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Localization/Resources/en.json

@ -1,6 +1,8 @@
{
"culture": "en",
"texts": {
"DisplayName:Name": "Name",
"DisplayName:Value": "Value",
"TenantNotFoundById": "Tenant: {0} not found!",
"TenantNotFoundByName": "Tenant: {0} not found!"
}

2
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application.Contracts/LINGYUN/Abp/TenantManagement/Localization/Resources/zh-Hans.json

@ -1,6 +1,8 @@
{
"culture": "zh-Hans",
"texts": {
"DisplayName:Name": "名称",
"DisplayName:Value": "值",
"TenantNotFoundById": "租户: {0} 不存在!",
"TenantNotFoundByName": "租户: {0} 不存在!"
}

20
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.Application/LINGYUN/Abp/TenantManagement/TenantAppService.cs

@ -38,12 +38,12 @@ namespace LINGYUN.Abp.TenantManagement
return ObjectMapper.Map<Tenant, TenantDto>(tenant);
}
public virtual async Task<TenantDto> GetAsync(TenantGetByNameInputDto tenantGetByNameInput)
public virtual async Task<TenantDto> GetAsync(string name)
{
var tenant = await TenantRepository.FindByNameAsync(tenantGetByNameInput.Name, false);
var tenant = await TenantRepository.FindByNameAsync(name, false);
if (tenant == null)
{
throw new UserFriendlyException(L["TenantNotFoundByName", tenantGetByNameInput.Name]);
throw new UserFriendlyException(L["TenantNotFoundByName", name]);
}
return ObjectMapper.Map<Tenant, TenantDto>(tenant);
}
@ -119,15 +119,15 @@ namespace LINGYUN.Abp.TenantManagement
}
[Authorize(TenantManagementPermissions.Tenants.ManageConnectionStrings)]
public virtual async Task<TenantConnectionStringDto> GetConnectionStringAsync(TenantConnectionGetByNameInputDto tenantConnectionGetByName)
public virtual async Task<TenantConnectionStringDto> GetConnectionStringAsync(Guid id, string name)
{
var tenant = await TenantRepository.GetAsync(tenantConnectionGetByName.Id);
var tenant = await TenantRepository.GetAsync(id);
var tenantConnectionString = tenant.FindConnectionString(tenantConnectionGetByName.Name);
var tenantConnectionString = tenant.FindConnectionString(name);
return new TenantConnectionStringDto
{
Name = tenantConnectionGetByName.Name,
Name = name,
Value = tenantConnectionString
};
}
@ -164,11 +164,11 @@ namespace LINGYUN.Abp.TenantManagement
}
[Authorize(TenantManagementPermissions.Tenants.ManageConnectionStrings)]
public virtual async Task DeleteConnectionStringAsync(TenantConnectionGetByNameInputDto tenantConnectionGetByName)
public virtual async Task DeleteConnectionStringAsync(Guid id, string name)
{
var tenant = await TenantRepository.GetAsync(tenantConnectionGetByName.Id);
var tenant = await TenantRepository.GetAsync(id);
tenant.RemoveConnectionString(tenantConnectionGetByName.Name);
tenant.RemoveConnectionString(name);
var updateEventData = new UpdateEventData
{

8
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN/Abp/TenantManagement/AbpTenantManagementHttpApiModule.cs

@ -1,6 +1,7 @@
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.TenantManagement.Localization;
@ -19,6 +20,13 @@ namespace LINGYUN.Abp.TenantManagement
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpTenantManagementHttpApiModule).Assembly);
});
PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(
typeof(AbpTenantManagementResource),
typeof(AbpTenantManagementApplicationContractsModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)

14
aspnet-core/modules/tenants/LINGYUN.Abp.TenantManagement.HttpApi/LINGYUN/Abp/TenantManagement/TenantController.cs

@ -55,9 +55,9 @@ namespace LINGYUN.Abp.TenantManagement
[HttpGet]
[Route("{id}/connection-string/{name}")]
public virtual Task<TenantConnectionStringDto> GetConnectionStringAsync(TenantConnectionGetByNameInputDto tenantConnectionGetByName)
public virtual Task<TenantConnectionStringDto> GetConnectionStringAsync(Guid id, string name)
{
return TenantAppService.GetConnectionStringAsync(tenantConnectionGetByName);
return TenantAppService.GetConnectionStringAsync(id, name);
}
[HttpGet]
@ -76,16 +76,16 @@ namespace LINGYUN.Abp.TenantManagement
[HttpDelete]
[Route("{id}/connection-string/{name}")]
public virtual Task DeleteConnectionStringAsync(TenantConnectionGetByNameInputDto tenantConnectionGetByName)
public virtual Task DeleteConnectionStringAsync(Guid id, string name)
{
return TenantAppService.DeleteConnectionStringAsync(tenantConnectionGetByName);
return TenantAppService.DeleteConnectionStringAsync(id, name);
}
[HttpGet]
[Route("name/{name}")]
public virtual Task<TenantDto> GetAsync(TenantGetByNameInputDto tenantGetByNameInput)
[Route("by-name/{name}")]
public virtual Task<TenantDto> GetAsync(string name)
{
return TenantAppService.GetAsync(tenantGetByNameInput);
return TenantAppService.GetAsync(name);
}
}
}

6
aspnet-core/tests/LINGYUN.Abp.Rules.RulesEngine.Tests/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineTestModule.cs

@ -1,7 +1,7 @@
using LINGYUN.Abp.Rules.RulesEngine.FileProviders.Physical;
using LINGYUN.Abp.Tests;
using System.IO;
using Volo.Abp.Modularity;
using Microsoft.Extensions.DependencyInjection;
namespace LINGYUN.Abp.Rules.RulesEngine
{
@ -12,9 +12,7 @@ namespace LINGYUN.Abp.Rules.RulesEngine
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddMemoryCache();
Configure<AbpRulesEngineOptions>(options =>
Configure<AbpRulesEnginePthsicalFileResolveOptions>(options =>
{
options.PhysicalPath = Path.Combine(Directory.GetCurrentDirectory(), "Rules");
});

8
vueJs/src/api/tenant-management.ts

@ -51,26 +51,26 @@ export default class TenantService {
public static getTenantConnections(id: string) {
let _url = '/api/tenant-management/tenants/'
_url += id + '/concatenation'
_url += id + '/connection-string'
return ApiService.Get<ListResultDto<TenantConnectionString>>(_url, serviceUrl)
}
public static getTenantConnectionByName(id: string, name: string) {
let _url = '/api/tenant-management/tenants/'
_url += id + '/concatenation/'
_url += id + '/connection-string/'
_url += name
return ApiService.Get<TenantConnectionString>(_url, serviceUrl)
}
public static setTenantConnection(id: string, payload: TenantConnectionString) {
let _url = '/api/tenant-management/tenants/'
_url += id + '/concatenation'
_url += id + '/connection-string'
return ApiService.Put<TenantConnectionString>(_url, payload, serviceUrl)
}
public static deleteTenantConnectionByName(id: string, name: string) {
let _url = '/api/tenant-management/tenants/'
_url += id + '/concatenation/'
_url += id + '/connection-string/'
_url += name
return ApiService.Delete(_url, serviceUrl)
}

Loading…
Cancel
Save