-feat 修复部分bug

This commit is contained in:
2026-01-27 18:42:35 +08:00
parent a339a9adce
commit 6422f2c45f
10 changed files with 1001 additions and 1 deletions

View File

@@ -5,9 +5,9 @@ import (
"strconv"
"time"
"accounting-app/pkg/api"
"accounting-app/internal/models"
"accounting-app/internal/service"
"accounting-app/pkg/api"
"github.com/gin-gonic/gin"
)
@@ -155,6 +155,17 @@ func (h *TransactionHandler) GetTransactions(c *gin.Context) {
input.AccountID = &accID
}
// Parse ledger filter
if ledgerIDStr := c.Query("ledger_id"); ledgerIDStr != "" {
ledgerID, err := strconv.ParseUint(ledgerIDStr, 10, 32)
if err != nil {
api.BadRequest(c, "Invalid ledger_id")
return
}
lid := uint(ledgerID)
input.LedgerID = &lid
}
if typeStr := c.Query("type"); typeStr != "" {
txnType := models.TransactionType(typeStr)
input.Type = &txnType