@Override public String getProperty(ConfKey confKey) { String result = getProperty(confKey.getConfGroup(), confKey.getConfKey()); if (StringUtils.isBlank(result) && StringUtils.isNotBlank(confKey.getDefaultValue())) { result = confKey.getDefaultValue(); } return result; }
private void refreshCache() { log.info("refreshCache() exec"); cache.clear(); for (ConfKey confKey : ConfKey.values()) { getProperty(confKey); } }
private void createConfByConfKeyEnums() { for (ConfKey confKey : ConfKey.values()) { Conf conf = new Conf(); conf.setConfGroup(confKey.getConfGroup()); conf.setConfKey(confKey.getConfKey()); conf.setConfDefaultValue(confKey.getDefaultValue()); conf.setRemarks(confKey.getDesc()); Conf fromDb = getById(conf.getConfGroup(), conf.getConfKey()); if (fromDb == null) { create(conf); } } }