fix
This commit is contained in:
89
Application/Dto/BudgetDto.cs
Normal file
89
Application/Dto/BudgetDto.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
namespace Application.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 预算响应
|
||||
/// </summary>
|
||||
public record BudgetResponse
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public BudgetPeriodType Type { get; init; }
|
||||
public decimal Limit { get; init; }
|
||||
public decimal Current { get; init; }
|
||||
public BudgetCategory Category { get; init; }
|
||||
public string[] SelectedCategories { get; init; } = [];
|
||||
public DateTime StartDate { get; init; }
|
||||
public bool NoLimit { get; init; }
|
||||
public bool IsMandatoryExpense { get; init; }
|
||||
public decimal UsagePercentage { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建预算请求
|
||||
/// </summary>
|
||||
public record CreateBudgetRequest
|
||||
{
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public BudgetPeriodType Type { get; init; } = BudgetPeriodType.Month;
|
||||
public decimal Limit { get; init; }
|
||||
public BudgetCategory Category { get; init; }
|
||||
public string[] SelectedCategories { get; init; } = [];
|
||||
public DateTime? StartDate { get; init; }
|
||||
public bool NoLimit { get; init; }
|
||||
public bool IsMandatoryExpense { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新预算请求
|
||||
/// </summary>
|
||||
public record UpdateBudgetRequest
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public BudgetPeriodType Type { get; init; } = BudgetPeriodType.Month;
|
||||
public decimal Limit { get; init; }
|
||||
public BudgetCategory Category { get; init; }
|
||||
public string[] SelectedCategories { get; init; } = [];
|
||||
public DateTime? StartDate { get; init; }
|
||||
public bool NoLimit { get; init; }
|
||||
public bool IsMandatoryExpense { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分类统计响应
|
||||
/// </summary>
|
||||
public record BudgetCategoryStatsResponse
|
||||
{
|
||||
public BudgetStatsDetail Month { get; init; } = new();
|
||||
public BudgetStatsDetail Year { get; init; } = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 统计详情
|
||||
/// </summary>
|
||||
public record BudgetStatsDetail
|
||||
{
|
||||
public decimal Limit { get; init; }
|
||||
public decimal Current { get; init; }
|
||||
public decimal Remaining { get; init; }
|
||||
public decimal UsagePercentage { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 未覆盖分类响应
|
||||
/// </summary>
|
||||
public record UncoveredCategoryResponse
|
||||
{
|
||||
public string Category { get; init; } = string.Empty;
|
||||
public decimal Amount { get; init; }
|
||||
public int Count { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新归档总结请求
|
||||
/// </summary>
|
||||
public record UpdateArchiveSummaryRequest
|
||||
{
|
||||
public DateTime ReferenceDate { get; init; }
|
||||
public string? Summary { get; init; }
|
||||
}
|
||||
49
Application/Dto/Category/CategoryDto.cs
Normal file
49
Application/Dto/Category/CategoryDto.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
namespace Application.Dto.Category;
|
||||
|
||||
/// <summary>
|
||||
/// 分类响应
|
||||
/// </summary>
|
||||
public record CategoryResponse
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public TransactionType Type { get; init; }
|
||||
public string? Icon { get; init; }
|
||||
public DateTime CreateTime { get; init; }
|
||||
public DateTime? UpdateTime { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建分类请求
|
||||
/// </summary>
|
||||
public record CreateCategoryRequest
|
||||
{
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public TransactionType Type { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新分类请求
|
||||
/// </summary>
|
||||
public record UpdateCategoryRequest
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public string Name { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成图标请求
|
||||
/// </summary>
|
||||
public record GenerateIconRequest
|
||||
{
|
||||
public long CategoryId { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新选中图标请求
|
||||
/// </summary>
|
||||
public record UpdateSelectedIconRequest
|
||||
{
|
||||
public long CategoryId { get; init; }
|
||||
public int SelectedIndex { get; init; }
|
||||
}
|
||||
28
Application/Dto/ConfigDto.cs
Normal file
28
Application/Dto/ConfigDto.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Application.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 获取配置请求
|
||||
/// </summary>
|
||||
public record GetConfigRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置键
|
||||
/// </summary>
|
||||
public string Key { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置配置请求
|
||||
/// </summary>
|
||||
public record SetConfigRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置键
|
||||
/// </summary>
|
||||
public string Key { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 配置值
|
||||
/// </summary>
|
||||
public string Value { get; init; } = string.Empty;
|
||||
}
|
||||
38
Application/Dto/Email/EmailMessageDto.cs
Normal file
38
Application/Dto/Email/EmailMessageDto.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
namespace Application.Dto.Email;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件消息响应
|
||||
/// </summary>
|
||||
public record EmailMessageResponse
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public string Subject { get; init; } = string.Empty;
|
||||
public string From { get; init; } = string.Empty;
|
||||
public string Body { get; init; } = string.Empty;
|
||||
public string HtmlBody { get; init; } = string.Empty;
|
||||
public DateTime ReceivedDate { get; init; }
|
||||
public DateTime CreateTime { get; init; }
|
||||
public DateTime? UpdateTime { get; init; }
|
||||
public int TransactionCount { get; init; }
|
||||
public string ToName { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 邮件查询请求
|
||||
/// </summary>
|
||||
public record EmailQueryRequest
|
||||
{
|
||||
public DateTime? LastReceivedDate { get; init; }
|
||||
public long? LastId { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 邮件分页结果
|
||||
/// </summary>
|
||||
public record EmailPagedResult
|
||||
{
|
||||
public EmailMessageResponse[] Data { get; init; } = [];
|
||||
public int Total { get; init; }
|
||||
public long? LastId { get; init; }
|
||||
public DateTime? LastTime { get; init; }
|
||||
}
|
||||
38
Application/Dto/ImportDto.cs
Normal file
38
Application/Dto/ImportDto.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
namespace Application.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 导入请求
|
||||
/// </summary>
|
||||
public record ImportRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件流
|
||||
/// </summary>
|
||||
public required Stream FileStream { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件扩展名(.csv, .xlsx, .xls)
|
||||
/// </summary>
|
||||
public required string FileExtension { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名
|
||||
/// </summary>
|
||||
public string FileName { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小(字节)
|
||||
/// </summary>
|
||||
public long FileSize { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入响应
|
||||
/// </summary>
|
||||
public record ImportResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 导入结果消息
|
||||
/// </summary>
|
||||
public string Message { get; init; } = string.Empty;
|
||||
}
|
||||
12
Application/Dto/LoginRequest.cs
Normal file
12
Application/Dto/LoginRequest.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Application.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 登录请求
|
||||
/// </summary>
|
||||
public record LoginRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
public string Password { get; init; } = string.Empty;
|
||||
}
|
||||
17
Application/Dto/LoginResponse.cs
Normal file
17
Application/Dto/LoginResponse.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Application.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 登录响应
|
||||
/// </summary>
|
||||
public record LoginResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// JWT Token
|
||||
/// </summary>
|
||||
public string Token { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Token过期时间(UTC)
|
||||
/// </summary>
|
||||
public DateTime ExpiresAt { get; init; }
|
||||
}
|
||||
22
Application/Dto/Message/MessageDto.cs
Normal file
22
Application/Dto/Message/MessageDto.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace Application.Dto.Message;
|
||||
|
||||
/// <summary>
|
||||
/// 消息记录响应
|
||||
/// </summary>
|
||||
public record MessageRecordResponse
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public string Title { get; init; } = string.Empty;
|
||||
public string Content { get; init; } = string.Empty;
|
||||
public bool IsRead { get; init; }
|
||||
public DateTime CreateTime { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 消息分页结果
|
||||
/// </summary>
|
||||
public record MessagePagedResult
|
||||
{
|
||||
public MessageRecordResponse[] Data { get; init; } = [];
|
||||
public int Total { get; init; }
|
||||
}
|
||||
56
Application/Dto/Periodic/PeriodicDto.cs
Normal file
56
Application/Dto/Periodic/PeriodicDto.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
namespace Application.Dto.Periodic;
|
||||
|
||||
/// <summary>
|
||||
/// 周期性账单响应
|
||||
/// </summary>
|
||||
public record PeriodicResponse
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public PeriodicType PeriodicType { get; init; }
|
||||
public string PeriodicConfig { get; init; } = string.Empty;
|
||||
public decimal Amount { get; init; }
|
||||
public TransactionType Type { get; init; }
|
||||
public string Classify { get; init; } = string.Empty;
|
||||
public string Reason { get; init; } = string.Empty;
|
||||
public bool IsEnabled { get; init; }
|
||||
public DateTime? NextExecuteTime { get; init; }
|
||||
public DateTime CreateTime { get; init; }
|
||||
public DateTime? UpdateTime { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建周期性账单请求
|
||||
/// </summary>
|
||||
public record CreatePeriodicRequest
|
||||
{
|
||||
public PeriodicType PeriodicType { get; init; }
|
||||
public string? PeriodicConfig { get; init; }
|
||||
public decimal Amount { get; init; }
|
||||
public TransactionType Type { get; init; }
|
||||
public string? Classify { get; init; }
|
||||
public string? Reason { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新周期性账单请求
|
||||
/// </summary>
|
||||
public record UpdatePeriodicRequest
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public PeriodicType PeriodicType { get; init; }
|
||||
public string? PeriodicConfig { get; init; }
|
||||
public decimal Amount { get; init; }
|
||||
public TransactionType Type { get; init; }
|
||||
public string? Classify { get; init; }
|
||||
public string? Reason { get; init; }
|
||||
public bool IsEnabled { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 周期性账单分页结果
|
||||
/// </summary>
|
||||
public record PeriodicPagedResult
|
||||
{
|
||||
public PeriodicResponse[] Data { get; init; } = [];
|
||||
public int Total { get; init; }
|
||||
}
|
||||
20
Application/Dto/Statistics/StatisticsDto.cs
Normal file
20
Application/Dto/Statistics/StatisticsDto.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Application.Dto.Statistics;
|
||||
|
||||
/// <summary>
|
||||
/// 余额统计DTO
|
||||
/// </summary>
|
||||
public record BalanceStatisticsDto(
|
||||
int Day,
|
||||
decimal CumulativeBalance
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// 每日统计DTO
|
||||
/// </summary>
|
||||
public record DailyStatisticsDto(
|
||||
int Day,
|
||||
int Count,
|
||||
decimal Expense,
|
||||
decimal Income,
|
||||
decimal Saving
|
||||
);
|
||||
106
Application/Dto/Transaction/TransactionDto.cs
Normal file
106
Application/Dto/Transaction/TransactionDto.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
namespace Application.Dto.Transaction;
|
||||
|
||||
/// <summary>
|
||||
/// 交易响应
|
||||
/// </summary>
|
||||
public record TransactionResponse
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public DateTime OccurredAt { get; init; }
|
||||
public string Reason { get; init; } = string.Empty;
|
||||
public decimal Amount { get; init; }
|
||||
public decimal Balance { get; init; }
|
||||
public TransactionType Type { get; init; }
|
||||
public string Classify { get; init; } = string.Empty;
|
||||
public string? UnconfirmedClassify { get; init; }
|
||||
public TransactionType? UnconfirmedType { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建交易请求
|
||||
/// </summary>
|
||||
public record CreateTransactionRequest
|
||||
{
|
||||
public string OccurredAt { get; init; } = string.Empty;
|
||||
public string? Reason { get; init; }
|
||||
public decimal Amount { get; init; }
|
||||
public TransactionType Type { get; init; }
|
||||
public string? Classify { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新交易请求
|
||||
/// </summary>
|
||||
public record UpdateTransactionRequest
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public string? Reason { get; init; }
|
||||
public decimal Amount { get; init; }
|
||||
public decimal Balance { get; init; }
|
||||
public TransactionType Type { get; init; }
|
||||
public string? Classify { get; init; }
|
||||
public string? OccurredAt { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 交易查询请求
|
||||
/// </summary>
|
||||
public record TransactionQueryRequest
|
||||
{
|
||||
public int PageIndex { get; init; } = 1;
|
||||
public int PageSize { get; init; } = 20;
|
||||
public string? SearchKeyword { get; init; }
|
||||
public string? Classify { get; init; }
|
||||
public int? Type { get; init; }
|
||||
public int? Year { get; init; }
|
||||
public int? Month { get; init; }
|
||||
public DateTime? StartDate { get; init; }
|
||||
public DateTime? EndDate { get; init; }
|
||||
public string? Reason { get; init; }
|
||||
public bool SortByAmount { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页结果
|
||||
/// </summary>
|
||||
public record PagedResult<T>
|
||||
{
|
||||
public T[] Data { get; init; } = [];
|
||||
public int Total { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量更新分类项
|
||||
/// </summary>
|
||||
public record BatchUpdateClassifyItem
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public string? Classify { get; init; }
|
||||
public TransactionType? Type { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按摘要批量更新请求
|
||||
/// </summary>
|
||||
public record BatchUpdateByReasonRequest
|
||||
{
|
||||
public string Reason { get; init; } = string.Empty;
|
||||
public TransactionType Type { get; init; }
|
||||
public string Classify { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 一句话录账解析请求
|
||||
/// </summary>
|
||||
public record ParseOneLineRequest
|
||||
{
|
||||
public string Text { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 确认所有未确认记录请求
|
||||
/// </summary>
|
||||
public record ConfirmAllUnconfirmedRequest
|
||||
{
|
||||
public long[] Ids { get; init; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user