package com.zy.core.network.fake; import com.zy.system.service.ConfigService; import com.core.common.SpringUtils; public final class FakeConfigSupport { private FakeConfigSupport() { } public static String getString(String code) { return getString(code, FakeConfigKeys.DEFAULTS.get(code)); } public static String getString(String code, String defaultValue) { ConfigService configService = SpringUtils.getBean(ConfigService.class); if (configService == null) { return defaultValue; } return configService.getConfigValue(code, defaultValue); } public static long getLong(String code) { String defaultValue = FakeConfigKeys.DEFAULTS.get(code); long fallback = 0L; if (defaultValue != null) { try { fallback = Long.parseLong(defaultValue); } catch (Exception ignore) { } } return getLong(code, fallback); } public static long getLong(String code, long defaultValue) { ConfigService configService = SpringUtils.getBean(ConfigService.class); if (configService == null) { return defaultValue; } return configService.getConfigLongValue(code, defaultValue); } }