优化结构

This commit is contained in:
Yvan
2026-08-24 13:25:16 +08:00
parent 7a9a738c6a
commit 0b6b8ddf1a
72 changed files with 2475 additions and 1443 deletions
+3 -3
View File
@@ -6,13 +6,13 @@ import (
"strings"
"time"
"kra/internal/conf"
"kra/internal/config"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
func mongoURI(config *conf.Data_Mongo) string {
func mongoURI(config *config.Mongo) string {
hosts := make([]string, 0, len(config.Hosts))
for _, host := range config.Hosts {
if host != nil && host.Host != "" && host.Port != "" {
@@ -26,7 +26,7 @@ func mongoURI(config *conf.Data_Mongo) string {
return uri
}
func openMongo(config *conf.Data_Mongo, enabled bool) (*mongo.Client, error) {
func openMongo(config *config.Mongo, enabled bool) (*mongo.Client, error) {
if !enabled {
return nil, nil
}