加入 连接状态判断 控制台日志输出

This commit is contained in:
2026-02-05 11:39:27 +08:00
parent f772e16119
commit 9e3a7d5721
7 changed files with 134 additions and 15 deletions

View File

@@ -9,6 +9,8 @@ abstract class DataBase {
_dataBase = database;
}
bool isConnected();
// 执行查询操作
Future<List<Map<String, dynamic>>> query(String table, {dynamic condition});

View File

@@ -10,6 +10,10 @@ class MongoDb implements DataBase {
connect(false);
}
bool isConnected() {
return db.isConnected;
}
void connect(reconnect) {
if (reconnect) {
print("尝试重连MongoDb");