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,20 +13,21 @@ namespace TakeoutSaaS.Application.App.Tenants.Handlers;
public sealed class GetTenantAuditLogsQueryHandler(ITenantRepository tenantRepository)
: IRequestHandler<GetTenantAuditLogsQuery, PagedResult<TenantAuditLogDto>>
{
private readonly ITenantRepository _tenantRepository = tenantRepository;
/// <inheritdoc />
public async Task<PagedResult<TenantAuditLogDto>> Handle(GetTenantAuditLogsQuery request, CancellationToken cancellationToken)
{
var logs = await _tenantRepository.GetAuditLogsAsync(request.TenantId, cancellationToken);
// 1. 查询审核日志
var logs = await tenantRepository.GetAuditLogsAsync(request.TenantId, cancellationToken);
var total = logs.Count;
// 2. 分页映射
var paged = logs
.Skip((request.Page - 1) * request.PageSize)
.Take(request.PageSize)
.Select(TenantMapping.ToDto)
.ToList();
// 3. 返回分页结果
return new PagedResult<TenantAuditLogDto>(paged, request.Page, request.PageSize, total);
}
}