重构数据引擎和报表引擎

This commit is contained in:
2026-06-11 13:06:54 +08:00
parent 285a0fc632
commit 419473f266
53 changed files with 8434 additions and 375 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"time"
"gitea.com/red-future/common/db/gfdb"
"gitea.redpowerfuture.com/red-future/common/db/gfdb"
"github.com/sirupsen/logrus"
)
@@ -19,12 +19,8 @@ func InsertRows(ctx context.Context, tableName string, conflictKeys []string, ro
if rows[i] == nil {
rows[i] = make(map[string]interface{})
}
if _, ok := rows[i]["created_at"]; !ok {
rows[i]["created_at"] = now
}
if _, ok := rows[i]["updated_at"]; !ok {
rows[i]["updated_at"] = now
}
// 始终覆盖 updated_at不设置 created_at 让数据库维护首次值upsert 时不会覆盖)
rows[i]["updated_at"] = now
}
batchSize := 100