Sin descripción
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

save_service.go 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package service
  2. import (
  3. "encoding/json"
  4. "git.x2erp.com/qdy/go-base/ctx"
  5. "git.x2erp.com/qdy/go-base/logger"
  6. "git.x2erp.com/qdy/go-base/model/response"
  7. "git.x2erp.com/qdy/go-db/factory/mongodb"
  8. "git.x2erp.com/qdy/go-svc-core/internal/model"
  9. )
  10. // SaveETLConfig 保存抽数工具配置
  11. func SaveETLConfig(req model.ETLConfig, mongoDBFactory *mongodb.MongoDBFactory, reqCtx *ctx.RequestContext) (*response.QueryResult[interface{}], error) {
  12. if logger.IsDebug() {
  13. jsonBytes, _ := json.Marshal(req)
  14. logger.DebugC(reqCtx, "ETLConfig data: %s", string(jsonBytes))
  15. }
  16. queryResult, err := mongoDBFactory.InsertOne("etl_configs", req)
  17. return queryResult, err
  18. }
  19. // SaveTenantConfig 保存租户配置
  20. func SaveTenantConfig(req model.TenantConfig, mongoDBFactory *mongodb.MongoDBFactory, reqCtx *ctx.RequestContext) (*response.QueryResult[interface{}], error) {
  21. if logger.IsDebug() {
  22. jsonBytes, _ := json.Marshal(req)
  23. logger.DebugC(reqCtx, "TenantConfig data: %s", string(jsonBytes))
  24. }
  25. queryResult, err := mongoDBFactory.InsertOne("tenant_configs", req)
  26. return queryResult, err
  27. }