db 사용여부 관련 수정

master
mjkhan21 11 months ago
parent f3215b84f0
commit 70b95a9bb5

@ -80,7 +80,7 @@ public class InterfaceConfig extends AbstractComponent {
this.remote = remote; this.remote = remote;
} }
public static boolean useDatabase() { public static boolean databaseActive() {
return conf.useDatabase; return conf.useDatabase;
} }

@ -67,7 +67,7 @@ public abstract class InterfaceInfoReader<T extends InterfaceInfo<?, ?>> extends
.read(path) .read(path)
.getMessages() .getMessages()
.forEach(info -> { .forEach(info -> {
insertInterfaceInfo().accept(info); InterfaceConfig.databaseActive(() -> insertInterfaceInfo().accept(info));
List<T> msgs = (List<T>)status.get("messages"); List<T> msgs = (List<T>)status.get("messages");
if (msgs == null) if (msgs == null)
status.set("messages", msgs = new ArrayList<>()); status.set("messages", msgs = new ArrayList<>());

@ -9,7 +9,7 @@ import cokr.xit.foundation.test.TestSupport;
public class InterfaceConfigTest extends TestSupport { public class InterfaceConfigTest extends TestSupport {
@Test @Test
void config() { void config() {
System.out.println("useDatabase: " + InterfaceConfig.useDatabase()); System.out.println("useDatabase: " + InterfaceConfig.databaseActive());
InterfaceConfig.EndPoint remote = InterfaceConfig.remote(); InterfaceConfig.EndPoint remote = InterfaceConfig.remote();
System.out.println("========== remote =========="); System.out.println("========== remote ==========");
System.out.println("organization: " + remote.getOrganization()); System.out.println("organization: " + remote.getOrganization());

Loading…
Cancel
Save