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

@@ -15,13 +15,16 @@ public sealed class SearchTenantBillsQueryHandler(ITenantBillingRepository billi
{
public async Task<PagedResult<TenantBillingDto>> Handle(SearchTenantBillsQuery request, CancellationToken cancellationToken)
{
// 1. 查询账单
var bills = await billingRepository.SearchAsync(request.TenantId, request.Status, request.From, request.To, cancellationToken);
// 2. 排序与分页
var ordered = bills.OrderByDescending(x => x.PeriodEnd).ToList();
var page = request.Page <= 0 ? 1 : request.Page;
var size = request.PageSize <= 0 ? 20 : request.PageSize;
var items = ordered.Skip((page - 1) * size).Take(size).Select(x => x.ToDto()).ToList();
// 3. 返回分页结果
return new PagedResult<TenantBillingDto>(items, page, size, ordered.Count);
}
}