}
return alarmRules;
}
private AlarmRuleDO modelToDo(AlarmRule alarmRule) {
AlarmRuleDO alarmRuleDo = new AlarmRuleDO();
alarmRuleDo.setId(alarmRule.getId());
alarmRuleDo.setMatchValue(alarmRule.getMatchValue());
alarmRuleDo.setMonitorName(alarmRule.getMonitorName());
alarmRuleDo.setReceiverKey(alarmRule.getReceiverKey());
alarmRuleDo.setPipelineId(alarmRule.getPipelineId());
alarmRuleDo.setStatus(alarmRule.getStatus());
alarmRuleDo.setDescription(alarmRule.getDescription());
alarmRuleDo.setGmtCreate(alarmRule.getGmtCreate());
alarmRuleDo.setGmtModified(alarmRule.getGmtModified());
AlarmRuleParameter alarmRuleParameter = new AlarmRuleParameter();
alarmRuleParameter.setIntervalTime(alarmRule.getIntervalTime());
if (alarmRule.getPauseTime() != null) {
SimpleDateFormat format = new SimpleDateFormat(TIMESTAMP_FORMAT);
alarmRuleParameter.setPauseTime(format.format(alarmRule.getPauseTime()));
}
alarmRuleParameter.setAutoRecovery(alarmRule.getAutoRecovery());
alarmRuleParameter.setRecoveryThresold(alarmRule.getRecoveryThresold());
alarmRuleDo.setAlarmRuleParameter(alarmRuleParameter);
return alarmRuleDo;
}