示例#1
0
 @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;
 }
示例#2
0
 private void refreshCache() {
   log.info("refreshCache() exec");
   cache.clear();
   for (ConfKey confKey : ConfKey.values()) {
     getProperty(confKey);
   }
 }
示例#3
0
  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);
      }
    }
  }