コード例 #1
0
 public static void saveOrUpdate(RuleModel ruleModel) {
   if (!ruleModel.isEchoOnly()) {
     RulesDao.saveOrUpdateRule(ruleModel.toRule());
     if (!ruleModel.getEcho()) {
       EchoParametersDao.deleteEchoParameters(ruleModel.getId());
     }
   }
   if (ruleModel.getEcho() || ruleModel.isEchoOnly()) {
     EchoParametersDao.saveOrUpdateEchoParameter(ruleModel.toEchoParameter());
   }
 }
コード例 #2
0
 public static List<RuleModel> getRulesModels() {
   List<RuleModel> ruleModels =
       RulesDao.getRules().stream().map(RuleModel::new).collect(Collectors.toList());
   EchoParametersDao.getEchoParameters()
       .forEach(forwardParameter -> mergedForwardParameter(ruleModels, forwardParameter));
   return ruleModels;
 }
コード例 #3
0
 public static void delete(String... rulesIds) {
   RulesDao.deleteRules(rulesIds);
   EchoParametersDao.deleteEchoParameters(rulesIds);
 }