优化已使用流量计算

This commit is contained in:
dushixiang committed 2026-01-11 12:08:59 +08:00
1 parent ab1a13d5b2
commit 52037fa8e6
5 files changed
+24 -77

No files matched your search

+1 -2
View File
@@ -281,7 +281,6 @@ func (h *AgentHandler) UpdateTrafficConfig(c echo.Context) error {
Enabled bool `json:"enabled"`
Type string `json:"type"` // 流量类型: recv/send/both
Limit uint64 `json:"limit"`
Used uint64 `json:"used"` // 手动设置已使用流量(可选)
ResetDay int `json:"resetDay"`
}
@@ -290,7 +289,7 @@ func (h *AgentHandler) UpdateTrafficConfig(c echo.Context) error {
}
ctx := c.Request().Context()
if err := h.trafficService.UpdateTrafficConfig(ctx, agentID, req.Enabled, req.Type, req.Limit, req.ResetDay, req.Used); err != nil {
if err := h.trafficService.UpdateTrafficConfig(ctx, agentID, req.Enabled, req.Type, req.Limit, req.ResetDay); err != nil {
return err
}