Пример #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 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);
      }
    }
  }