mongo.go重构

This commit is contained in:
2026-03-12 08:51:17 +08:00
parent 55e8a829de
commit 7d05387104
+6 -2
View File
@@ -29,9 +29,13 @@ type MongoDB struct {
Cache bool
}
func DB(cache bool) *MongoDB {
func DB(cache ...bool) *MongoDB {
b := true
if len(cache) > 0 {
b = cache[0]
}
return &MongoDB{
Cache: cache,
Cache: b,
}
}