feat: 更新交易记录和预算服务,支持按分类和日期范围筛选
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 26s
Docker Build & Deploy / Deploy to Production (push) Successful in 9s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s

This commit is contained in:
孙诚
2026-01-09 16:21:03 +08:00
parent 2244d08b43
commit b5d0524868
6 changed files with 127 additions and 29 deletions

View File

@@ -22,29 +22,39 @@ public class TransactionRecordController(
[FromQuery] int? type = null,
[FromQuery] int? year = null,
[FromQuery] int? month = null,
[FromQuery] DateTime? startDate = null,
[FromQuery] DateTime? endDate = null,
[FromQuery] string? reason = null,
[FromQuery] bool sortByAmount = false
)
{
try
{
string[]? classifies = string.IsNullOrWhiteSpace(classify)
? null
: classify.Split(',', StringSplitOptions.RemoveEmptyEntries);
TransactionType? transactionType = type.HasValue ? (TransactionType)type.Value : null;
var list = await transactionRepository.GetPagedListAsync(
pageIndex,
pageSize,
searchKeyword,
classify,
classifies,
transactionType,
year,
month,
startDate,
endDate,
reason,
sortByAmount);
var total = await transactionRepository.GetTotalCountAsync(
searchKeyword,
classify,
classifies,
transactionType,
year,
month,
startDate,
endDate,
reason);
return new PagedResponse<TransactionRecord>