fix(backend): 架构质量改进批次三 (#41-44)
- #41 CheckInventoryAvailability Scan 加错误检查,DB 故障不再误报库存不足 - #42 finance ListRecords 和 inventory Logs 补加 pageSize 上限(500) - #43 ReconcileInventory 两条 Scan 加错误检查,DB 故障返回 500 而非误导性空结果 - #44 license Info 改用 CountDevices(licenseID) 统计当前 license 绑定数,修复跨 license 计数偏差 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/wangjia/jiu/backend/internal/middleware"
|
||||
"github.com/wangjia/jiu/backend/internal/model"
|
||||
"github.com/wangjia/jiu/backend/internal/util"
|
||||
)
|
||||
|
||||
type FinanceHandler struct {
|
||||
@@ -33,9 +34,7 @@ func (h *FinanceHandler) ListRecords(c *gin.Context) {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
if q.PageSize <= 0 {
|
||||
q.PageSize = 50
|
||||
}
|
||||
q.PageSize = util.ValidatePageSize(q.PageSize, 50, 500)
|
||||
if q.Page <= 0 {
|
||||
q.Page = 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user