Browse Source
Merge pull request #13656 from abpframework/auto-merge/rel-5-3/1269
Merge branch rel-6.0 with rel-5.3
pull/13659/head
liangshiwei
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with
26 additions and
5 deletions
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/AbpTenantManagementDomainSharedModule.cs
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ar.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de-DE.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/es.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fi.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fr.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hi.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/it.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pt-BR.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ru.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sk.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sl.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hans.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hant.json
-
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantManager.cs
-
modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo/Abp/TenantManagement/TenantAppService_Tests.cs
-
modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo/Abp/TenantManagement/TenantManager_Tests.cs
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
using Volo.Abp.Localization; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.TenantManagement.Localization; |
|
|
|
using Volo.Abp.Localization.ExceptionHandling; |
|
|
|
using Volo.Abp.Validation; |
|
|
|
using Volo.Abp.Validation.Localization; |
|
|
|
using Volo.Abp.VirtualFileSystem; |
|
|
|
@ -25,5 +26,10 @@ public class AbpTenantManagementDomainSharedModule : AbpModule |
|
|
|
typeof(AbpValidationResource) |
|
|
|
).AddVirtualJson("/Volo/Abp/TenantManagement/Localization/Resources"); |
|
|
|
}); |
|
|
|
|
|
|
|
Configure<AbpExceptionLocalizationOptions>(options => |
|
|
|
{ |
|
|
|
options.MapCodeNamespace("Volo.Abp.TenantManagement", typeof(AbpTenantManagementResource)); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "ar", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "اسم المستأجر موجود بالفعل: {Name}", |
|
|
|
"Menu:TenantManagement": "إدارة الجهات", |
|
|
|
"Tenants": "الجهات", |
|
|
|
"NewTenant": "جهة جديدة", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "de-DE", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Der Name des Mandanten ist bereits vorhanden: {Name}", |
|
|
|
"Menu:TenantManagement": "Mandantenverwaltung", |
|
|
|
"Tenants": "Mandanten", |
|
|
|
"NewTenant": "Neuer Mandant", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "en", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Tenant name already exist: {Name}", |
|
|
|
"Menu:TenantManagement": "Tenant management", |
|
|
|
"Tenants": "Tenants", |
|
|
|
"NewTenant": "New tenant", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "es", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "El nombre del inquilino ya existe: {Name}", |
|
|
|
"Menu:TenantManagement": "Gestión de tenants", |
|
|
|
"Tenants": "Inquilinos", |
|
|
|
"NewTenant": "Nuevo inquilino", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "fi", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Vuokralaisen nimi on jo olemassa: {Name}", |
|
|
|
"Menu:TenantManagement": "Vuokralaisten hallinta", |
|
|
|
"Tenants": "Vuokralaiset", |
|
|
|
"NewTenant": "Uusi vuokralainen", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "fr", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Le nom du locataire existe déjà: {Name}", |
|
|
|
"Menu:TenantManagement": "Gestion des locataires", |
|
|
|
"Tenants": "Locataires", |
|
|
|
"NewTenant": "Nouveau locataire", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "hi", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "किरायेदार नाम पहले से मौजूद है: {Name}", |
|
|
|
"Menu:TenantManagement": "किरायेदार प्रबंधन", |
|
|
|
"Tenants": "किरायेदारों", |
|
|
|
"NewTenant": "नया किरायेदार", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "it", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Il nome del tenant esiste già: {Name}", |
|
|
|
"Menu:TenantManagement": "Gestione tenants", |
|
|
|
"Tenants": "Tenants", |
|
|
|
"NewTenant": "Nuovo Tenant", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "pt-BR", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "O nome do ambiente já existe: {Name}", |
|
|
|
"Menu:TenantManagement": "Gerencimento de Inquilinos", |
|
|
|
"Tenants": "Inquilinos", |
|
|
|
"NewTenant": "Novo Inquilino", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "ru", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Имя арендатора уже существует: {Name}", |
|
|
|
"Menu:TenantManagement": "Управление арендаторами", |
|
|
|
"Tenants": "Арендаторы", |
|
|
|
"NewTenant": "Новый арендатор", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "sk", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Názov tenanta už existuje: {Name}", |
|
|
|
"Menu:TenantManagement": "Správa tenantov", |
|
|
|
"Tenants": "Tentanti", |
|
|
|
"NewTenant": "Nový tenant", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "sl", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Ime najemnika že obstaja: {Name}", |
|
|
|
"Menu:TenantManagement": "Upravljanje najemnikov", |
|
|
|
"Tenants": "Najemniki", |
|
|
|
"NewTenant": "Nov najemnik", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "tr", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "Müşteri ismi zaten mevcut: {Name}", |
|
|
|
"Menu:TenantManagement": "Müşteri yönetimi", |
|
|
|
"Tenants": "Müşteriler", |
|
|
|
"NewTenant": "Yeni müşteri", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "zh-Hans", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "租户名称已存在: {Name}", |
|
|
|
"Menu:TenantManagement": "租户管理", |
|
|
|
"Tenants": "租户", |
|
|
|
"NewTenant": "新租户", |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
{ |
|
|
|
"culture": "zh-Hant", |
|
|
|
"texts": { |
|
|
|
"Volo.Abp.TenantManagement:DuplicateTenantName": "租戶名稱已存在: {Name}", |
|
|
|
"Menu:TenantManagement": "租戶管理", |
|
|
|
"Tenants": "租戶", |
|
|
|
"NewTenant": "新租戶", |
|
|
|
|
|
|
|
@ -36,7 +36,7 @@ public class TenantManager : DomainService, ITenantManager |
|
|
|
var tenant = await TenantRepository.FindByNameAsync(name); |
|
|
|
if (tenant != null && tenant.Id != expectedId) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("Duplicate tenancy name: " + name); //TODO: A domain exception would be better..?
|
|
|
|
throw new BusinessException("Volo.Abp.TenantManagement:DuplicateTenantName").WithData("Name", name); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -66,7 +66,7 @@ public class TenantAppService_Tests : AbpTenantManagementApplicationTestBase |
|
|
|
[Fact] |
|
|
|
public async Task CreateAsync_Should_Not_Allow_Duplicate_Names() |
|
|
|
{ |
|
|
|
await Assert.ThrowsAsync<UserFriendlyException>(async () => |
|
|
|
await Assert.ThrowsAsync<BusinessException>(async () => |
|
|
|
{ |
|
|
|
await _tenantAppService.CreateAsync(new TenantCreateDto { Name = "acme", AdminEmailAddress = "admin@admin.com", AdminPassword = "123456" }); |
|
|
|
}); |
|
|
|
@ -90,7 +90,7 @@ public class TenantAppService_Tests : AbpTenantManagementApplicationTestBase |
|
|
|
{ |
|
|
|
var acme = UsingDbContext(dbContext => dbContext.Tenants.Single(t => t.Name == "acme")); |
|
|
|
|
|
|
|
await Assert.ThrowsAsync<UserFriendlyException>(async () => |
|
|
|
await Assert.ThrowsAsync<BusinessException>(async () => |
|
|
|
{ |
|
|
|
await _tenantAppService.UpdateAsync(acme.Id, new TenantUpdateDto { Name = "volosoft" }); |
|
|
|
}); |
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ public class TenantManager_Tests : AbpTenantManagementDomainTestBase |
|
|
|
[Fact] |
|
|
|
public async Task Create_Tenant_Name_Can_Not_Duplicate() |
|
|
|
{ |
|
|
|
await Assert.ThrowsAsync<UserFriendlyException>(async () => await _tenantManager.CreateAsync("volosoft")); |
|
|
|
await Assert.ThrowsAsync<BusinessException>(async () => await _tenantManager.CreateAsync("volosoft")); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
@ -46,6 +46,6 @@ public class TenantManager_Tests : AbpTenantManagementDomainTestBase |
|
|
|
var tenant = await _tenantRepository.FindByNameAsync("acme"); |
|
|
|
tenant.ShouldNotBeNull(); |
|
|
|
|
|
|
|
await Assert.ThrowsAsync<UserFriendlyException>(async () => await _tenantManager.ChangeNameAsync(tenant, "volosoft")); |
|
|
|
await Assert.ThrowsAsync<BusinessException>(async () => await _tenantManager.ChangeNameAsync(tenant, "volosoft")); |
|
|
|
} |
|
|
|
} |
|
|
|
|