package service import ( "encoding/json" "git.x2erp.com/qdy/go-base/ctx" "git.x2erp.com/qdy/go-base/logger" "git.x2erp.com/qdy/go-base/model/response" "git.x2erp.com/qdy/go-db/factory/mongodb" "git.x2erp.com/qdy/go-svc-core/internal/model" ) // SaveETLConfig 保存抽数工具配置 func SaveETLConfig(req model.ETLConfig, mongoDBFactory *mongodb.MongoDBFactory, reqCtx *ctx.RequestContext) (*response.QueryResult[interface{}], error) { if logger.IsDebug() { jsonBytes, _ := json.Marshal(req) logger.DebugC(reqCtx, "ETLConfig data: %s", string(jsonBytes)) } queryResult, err := mongoDBFactory.InsertOne("etl_configs", req) return queryResult, err } // SaveTenantConfig 保存租户配置 func SaveTenantConfig(req model.TenantConfig, mongoDBFactory *mongodb.MongoDBFactory, reqCtx *ctx.RequestContext) (*response.QueryResult[interface{}], error) { if logger.IsDebug() { jsonBytes, _ := json.Marshal(req) logger.DebugC(reqCtx, "TenantConfig data: %s", string(jsonBytes)) } queryResult, err := mongoDBFactory.InsertOne("tenant_configs", req) return queryResult, err }