chore: add documentation comments and stylecop rules

This commit is contained in:
2025-12-04 11:25:01 +08:00
parent 17d143a351
commit 8e4c2b0e45
142 changed files with 1309 additions and 439 deletions

View File

@@ -13,17 +13,18 @@ namespace TakeoutSaaS.Application.App.Tenants.Handlers;
public sealed class GetTenantByIdQueryHandler(ITenantRepository tenantRepository)
: IRequestHandler<GetTenantByIdQuery, TenantDetailDto>
{
private readonly ITenantRepository _tenantRepository = tenantRepository;
/// <inheritdoc />
public async Task<TenantDetailDto> Handle(GetTenantByIdQuery request, CancellationToken cancellationToken)
{
var tenant = await _tenantRepository.FindByIdAsync(request.TenantId, cancellationToken)
// 1. 查询租户
var tenant = await tenantRepository.FindByIdAsync(request.TenantId, cancellationToken)
?? throw new BusinessException(ErrorCodes.NotFound, "租户不存在");
var subscription = await _tenantRepository.GetActiveSubscriptionAsync(request.TenantId, cancellationToken);
var verification = await _tenantRepository.GetVerificationProfileAsync(request.TenantId, cancellationToken);
// 2. 查询订阅与认证
var subscription = await tenantRepository.GetActiveSubscriptionAsync(request.TenantId, cancellationToken);
var verification = await tenantRepository.GetVerificationProfileAsync(request.TenantId, cancellationToken);
// 3. 组装返回
return new TenantDetailDto
{
Tenant = TenantMapping.ToDto(tenant, subscription, verification),