feat: 添加分类名称更新功能,支持在交易记录中同步更新分类名称
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 23s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s

This commit is contained in:
2026-01-01 15:20:59 +08:00
parent c58404491f
commit 8c72102e87
6 changed files with 173 additions and 34 deletions

View File

@@ -4,6 +4,7 @@
[Route("api/[controller]/[action]")]
public class TransactionCategoryController(
ITransactionCategoryRepository categoryRepository,
ITransactionRecordRepository transactionRecordRepository,
ILogger<TransactionCategoryController> logger
) : ControllerBase
{
@@ -129,6 +130,9 @@ public class TransactionCategoryController(
{
return BaseResponse.Fail("已存在相同名称的分类");
}
// 同步更新交易记录中的分类名称
await transactionRecordRepository.UpdateCategoryNameAsync(category.Name, dto.Name, category.Type);
}
category.Name = dto.Name;