Authored by skinny.wu

短息告警服务 sendMsg()方法增加一个重载方法,比原来方法多一个String alarmInfo参数,兼容原来方法

... ... @@ -6,4 +6,6 @@ package com.monitor.common.service;
public interface AlarmMsgService {
public boolean sendSms(String type, String content, String mobile);
boolean sendSms(String type, String content, String alarmInfo, String mobile);
}
... ...
... ... @@ -46,6 +46,21 @@ public class AlarmMsgServiceImpl implements AlarmMsgService {
*/
@Override
public boolean sendSms(String type, String content, String mobile) {
return sendSms(type, content, "", mobile);
}
/**
* 发送短信
*
* @param type
* @param content
* @param alarmInfo
* @param mobile
* @return
*/
@Override
public boolean sendSms(String type, String content, String alarmInfo, String mobile) {
Map<String, String> contentMap = new HashMap<String, String>();
contentMap.put("OperID", sendsmsConfig.getUserName());
contentMap.put("OperPass", sendsmsConfig.getPwd());
... ... @@ -75,7 +90,7 @@ public class AlarmMsgServiceImpl implements AlarmMsgService {
}
try {
monitorAlarmMapper.insertAlarmMsg(InfluxDBContants.AWS, type, content, "", sendStatus ? "successed" : "failed");
monitorAlarmMapper.insertAlarmMsg(InfluxDBContants.AWS, type, content, alarmInfo, sendStatus ? "successed" : "failed");
}catch (Exception e){
logger.error("insert sms into influxdb failed",e);
}
... ...