mirror of
https://github.com/CarmJos/MineSQL.git
synced 2026-06-05 00:48:16 +08:00
修改实现部分
This commit is contained in:
@@ -22,7 +22,7 @@ public class EasySQLManagerImpl implements EasySQLManager {
|
||||
Map<String, DBConfiguration> configurations = platform.readConfigurations();
|
||||
|
||||
if (configurations.isEmpty()) {
|
||||
platform.getLogger().warning("No database configurations found. Skipping SQLManager initialization.");
|
||||
platform.getLogger().warning("未检测到任何数据库配置,将不会创建任何SQLManager。");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class EasySQLManagerImpl implements EasySQLManager {
|
||||
SQLManager sqlManager = create(id, configuration);
|
||||
this.sqlManagerRegistry.put(id, sqlManager);
|
||||
} catch (Exception exception) {
|
||||
platform.getLogger().warning("Failed to initialize SQLManager #" + id + " .");
|
||||
platform.getLogger().warning("初始化SQLManager(#" + id + ") 出错,请检查配置文件.");
|
||||
exception.printStackTrace();
|
||||
}
|
||||
});
|
||||
@@ -41,7 +41,7 @@ public class EasySQLManagerImpl implements EasySQLManager {
|
||||
@Override
|
||||
public @NotNull SQLManager get(@Nullable String id) throws NullPointerException {
|
||||
if (!this.sqlManagerRegistry.containsKey(id)) {
|
||||
throw new NullPointerException("SQLManager #" + id + " does not exist.");
|
||||
throw new NullPointerException("并不存在ID为 #" + id + " 的SQLManager.");
|
||||
}
|
||||
return this.sqlManagerRegistry.get(id);
|
||||
}
|
||||
|
||||
@@ -4,12 +4,15 @@ import cc.carm.plugin.easysql.api.DBConfiguration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public interface EasySQLPluginPlatform {
|
||||
|
||||
@NotNull Map<String, DBConfiguration> readConfigurations();
|
||||
|
||||
@NotNull Map<String, Properties> readProperties();
|
||||
|
||||
Logger getLogger();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package cc.carm.plugin.easysql.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
public class PropertiesUtil {
|
||||
|
||||
public static Map<String, Properties> readDBProperties(File propertiesFolder) {
|
||||
Map<String, Properties> propertiesMap = new HashMap<>();
|
||||
|
||||
return propertiesMap;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package cc.carm.plugin.easysql;
|
||||
package cc.carm.plugin.easysql.util;
|
||||
|
||||
import cc.carm.lib.githubreleases4j.GithubReleases4J;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class UpdateChecker {
|
||||
public class UpdateCheckUtil {
|
||||
|
||||
public static final String REPO_OWNER = "CarmJos";
|
||||
public static final String REPO_NAME = "EasySQL-Plugin";
|
||||
Reference in New Issue
Block a user