Files
TakeoutSaaS.TenantApi/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantReviewClaimQueryHandler.cs

22 lines
827 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using MediatR;
using TakeoutSaaS.Application.App.Tenants.Dto;
using TakeoutSaaS.Application.App.Tenants.Queries;
using TakeoutSaaS.Domain.Tenants.Repositories;
namespace TakeoutSaaS.Application.App.Tenants.Handlers;
/// <summary>
/// 获取租户审核领取信息查询处理器。
/// </summary>
public sealed class GetTenantReviewClaimQueryHandler(ITenantRepository tenantRepository)
: IRequestHandler<GetTenantReviewClaimQuery, TenantReviewClaimDto?>
{
/// <inheritdoc />
public async Task<TenantReviewClaimDto?> Handle(GetTenantReviewClaimQuery request, CancellationToken cancellationToken)
{
// 1. 查询当前领取信息(未领取返回 null
var claim = await tenantRepository.GetActiveReviewClaimAsync(request.TenantId, cancellationToken);
return claim?.ToDto();
}
}