-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3107 from abpframework/Cotur-TenantManagement
Custom admin/pass implementation for new tenant
- Loading branch information
Showing
7 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
17 changes: 16 additions & 1 deletion
17
...o.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantCreateDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
namespace Volo.Abp.TenantManagement | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Text.RegularExpressions; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Localization; | ||
using Volo.Abp.TenantManagement.Localization; | ||
|
||
namespace Volo.Abp.TenantManagement | ||
{ | ||
public class TenantCreateDto : TenantCreateOrUpdateDtoBase | ||
{ | ||
[Required] | ||
[EmailAddress] | ||
[MaxLength(256)] | ||
public string AdminEmailAddress { get; set; } | ||
|
||
|
||
[Required] | ||
[MaxLength(128)] | ||
public string AdminPassword { get; set; } | ||
} | ||
} |
6 changes: 5 additions & 1 deletion
6
...Management.Application.Contracts/Volo/Abp/TenantManagement/TenantCreateOrUpdateDtoBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
namespace Volo.Abp.TenantManagement | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Volo.Abp.TenantManagement | ||
{ | ||
public abstract class TenantCreateOrUpdateDtoBase | ||
{ | ||
[Required] | ||
[StringLength(TenantConsts.MaxNameLength)] | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ public async Task GetListAsync_Sorted_Descending_By_Name() | |
public async Task CreateAsync() | ||
{ | ||
var tenancyName = Guid.NewGuid().ToString("N").ToLowerInvariant(); | ||
var tenant = await _tenantAppService.CreateAsync(new TenantCreateDto { Name = tenancyName }); | ||
var tenant = await _tenantAppService.CreateAsync(new TenantCreateDto { Name = tenancyName , AdminEmailAddress = "[email protected]", AdminPassword = "123456"}); | ||
tenant.Name.ShouldBe(tenancyName); | ||
tenant.Id.ShouldNotBe(default(Guid)); | ||
} | ||
|
@@ -69,7 +69,7 @@ public async Task CreateAsync_Should_Not_Allow_Duplicate_Names() | |
{ | ||
await Assert.ThrowsAsync<UserFriendlyException>(async () => | ||
{ | ||
await _tenantAppService.CreateAsync(new TenantCreateDto { Name = "acme" }); | ||
await _tenantAppService.CreateAsync(new TenantCreateDto { Name = "acme", AdminEmailAddress = "[email protected]", AdminPassword = "123456" }); | ||
}); | ||
} | ||
|
||
|