feat: 后台手动新增租户并直接入驻接口

This commit is contained in:
2025-12-15 12:16:17 +08:00
parent 5e7f7144ed
commit 13821f2d19
3 changed files with 548 additions and 0 deletions

View File

@@ -35,6 +35,22 @@ public sealed class TenantsController(IMediator mediator) : BaseApiController
return ApiResponse<TenantDto>.Ok(result);
}
/// <summary>
/// 后台手动新增租户并直接入驻(创建租户 + 认证 + 订阅 + 管理员账号)。
/// </summary>
/// <returns>新增后的租户详情。</returns>
[HttpPost("manual")]
[PermissionAuthorize("tenant:create")]
[ProducesResponseType(typeof(ApiResponse<TenantDetailDto>), StatusCodes.Status200OK)]
public async Task<ApiResponse<TenantDetailDto>> CreateManually([FromBody] CreateTenantManuallyCommand command, CancellationToken cancellationToken)
{
// 1. 后台手动新增租户(直接可用)
var result = await mediator.Send(command, cancellationToken);
// 2. 返回创建结果
return ApiResponse<TenantDetailDto>.Ok(result);
}
/// <summary>
/// 分页查询租户。
/// </summary>