feat: 租户审核领单与强制接管
This commit is contained in:
@@ -108,6 +108,70 @@ public sealed class TenantsController(IMediator mediator) : BaseApiController
|
||||
return ApiResponse<TenantDto>.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询当前租户审核领取信息。
|
||||
/// </summary>
|
||||
/// <returns>领取信息,未领取返回 null。</returns>
|
||||
[HttpGet("{tenantId:long}/review/claim")]
|
||||
[PermissionAuthorize("tenant:review")]
|
||||
[ProducesResponseType(typeof(ApiResponse<TenantReviewClaimDto?>), StatusCodes.Status200OK)]
|
||||
public async Task<ApiResponse<TenantReviewClaimDto?>> GetReviewClaim(long tenantId, CancellationToken cancellationToken)
|
||||
{
|
||||
// 1. 查询领取信息
|
||||
var result = await mediator.Send(new GetTenantReviewClaimQuery(tenantId), cancellationToken);
|
||||
|
||||
// 2. 返回领取信息
|
||||
return ApiResponse<TenantReviewClaimDto?>.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 领取租户入驻审核(领取后仅领取人可操作审核)。
|
||||
/// </summary>
|
||||
/// <returns>领取结果。</returns>
|
||||
[HttpPost("{tenantId:long}/review/claim")]
|
||||
[PermissionAuthorize("tenant:review")]
|
||||
[ProducesResponseType(typeof(ApiResponse<TenantReviewClaimDto>), StatusCodes.Status200OK)]
|
||||
public async Task<ApiResponse<TenantReviewClaimDto>> ClaimReview(long tenantId, CancellationToken cancellationToken)
|
||||
{
|
||||
// 1. 执行领取
|
||||
var result = await mediator.Send(new ClaimTenantReviewCommand { TenantId = tenantId }, cancellationToken);
|
||||
|
||||
// 2. 返回领取结果
|
||||
return ApiResponse<TenantReviewClaimDto>.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 强制接管租户入驻审核(仅超级管理员可用)。
|
||||
/// </summary>
|
||||
/// <returns>接管后的领取信息。</returns>
|
||||
[HttpPost("{tenantId:long}/review/force-claim")]
|
||||
[PermissionAuthorize("tenant:review:force-claim")]
|
||||
[ProducesResponseType(typeof(ApiResponse<TenantReviewClaimDto>), StatusCodes.Status200OK)]
|
||||
public async Task<ApiResponse<TenantReviewClaimDto>> ForceClaimReview(long tenantId, CancellationToken cancellationToken)
|
||||
{
|
||||
// 1. 执行强制接管
|
||||
var result = await mediator.Send(new ForceClaimTenantReviewCommand { TenantId = tenantId }, cancellationToken);
|
||||
|
||||
// 2. 返回接管结果
|
||||
return ApiResponse<TenantReviewClaimDto>.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 释放租户入驻审核领取(仅领取人可释放)。
|
||||
/// </summary>
|
||||
/// <returns>释放后的领取信息,未领取返回 null。</returns>
|
||||
[HttpPost("{tenantId:long}/review/release")]
|
||||
[PermissionAuthorize("tenant:review")]
|
||||
[ProducesResponseType(typeof(ApiResponse<TenantReviewClaimDto?>), StatusCodes.Status200OK)]
|
||||
public async Task<ApiResponse<TenantReviewClaimDto?>> ReleaseReview(long tenantId, CancellationToken cancellationToken)
|
||||
{
|
||||
// 1. 执行释放
|
||||
var result = await mediator.Send(new ReleaseTenantReviewClaimCommand { TenantId = tenantId }, cancellationToken);
|
||||
|
||||
// 2. 返回释放结果
|
||||
return ApiResponse<TenantReviewClaimDto?>.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建或续费租户订阅。
|
||||
/// </summary>
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
"tenant:create",
|
||||
"tenant:read",
|
||||
"tenant:review",
|
||||
"tenant:review:force-claim",
|
||||
"tenant:subscription",
|
||||
"tenant:quota:check",
|
||||
"tenant-package:read",
|
||||
|
||||
Reference in New Issue
Block a user