|
|
package com.monitor.common.config;
|
|
|
|
|
|
import com.monitor.common.service.AlarmMsgService;
|
|
|
import com.util.GetUsersInfoUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import retrofit.http.POST;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
|
|
/**
|
|
|
* 告警任务的短信号码 Created by yoho on 2016/5/4.
|
|
|
*/
|
|
|
@Component("snsMobileConfig")
|
|
|
public class SnsMobileConfig {
|
|
|
public static final Logger logger = LoggerFactory.getLogger(SnsMobileConfig.class);
|
|
|
|
|
|
@Value("${base_mobile}")
|
|
|
private String baseMobile;
|
|
|
|
|
|
@Value("${redis_exception_mobile}")
|
|
|
private String redisMobile;
|
|
|
|
|
|
@Autowired
|
|
|
private GetUsersInfoUtil getUsersInfoUtil;
|
|
|
@Value("${java_service_alarm_mobile}")
|
|
|
private String javaServiceMobile;
|
|
|
|
|
|
@Value("${java_service_alarm_flag}")
|
|
|
private boolean javaServiceFlag;
|
...
|
...
|
@@ -32,56 +27,12 @@ public class SnsMobileConfig { |
|
|
@Value("${java_service_alarm_count_threshold}")
|
|
|
private Integer javaServiceCountThreshold;
|
|
|
|
|
|
@Value("${java_api_error}")
|
|
|
private String javaApiError;
|
|
|
|
|
|
@Value("${bigdata_mobile}")
|
|
|
private String bigdataMobile;
|
|
|
|
|
|
private String javaServiceMobile;
|
|
|
|
|
|
private String redisMobile;
|
|
|
|
|
|
private String baseMobile;
|
|
|
|
|
|
|
|
|
@PostConstruct
|
|
|
public void init(){
|
|
|
//JAVAAPI错误报警
|
|
|
javaApiError =getUsersInfoUtil.getMobileByAlarmGroup("JAVAAPI错误报警");
|
|
|
if(StringUtils.isBlank(javaApiError)){
|
|
|
javaApiError="";
|
|
|
}
|
|
|
//大数据报警
|
|
|
bigdataMobile=getUsersInfoUtil.getMobileByAlarmGroup("大数据报警");
|
|
|
if(StringUtils.isBlank(bigdataMobile)){
|
|
|
bigdataMobile="";
|
|
|
}
|
|
|
|
|
|
//JAVASERVICE错误报警
|
|
|
javaServiceMobile=getUsersInfoUtil.getMobileByAlarmGroup("JAVASERVICE错误报警");
|
|
|
if(StringUtils.isBlank(javaServiceMobile)){
|
|
|
javaServiceMobile="";
|
|
|
}
|
|
|
|
|
|
//REDIS异常报警
|
|
|
redisMobile=getUsersInfoUtil.getMobileByAlarmGroup("REDIS异常报警");
|
|
|
if(StringUtils.isBlank(redisMobile)){
|
|
|
redisMobile="";
|
|
|
}
|
|
|
|
|
|
//基础组
|
|
|
baseMobile=getUsersInfoUtil.getMobileByAlarmGroup("基础组");
|
|
|
if(StringUtils.isBlank(baseMobile)){
|
|
|
baseMobile="";
|
|
|
}
|
|
|
|
|
|
logger.info("初始化手机号码");
|
|
|
logger.info("JAVAAPI错误报警 javaApiError :"+javaApiError);
|
|
|
logger.info("大数据报警 bigdataMobile :"+bigdataMobile);
|
|
|
logger.info("JAVASERVICE错误报警 javaServiceMobile :"+javaServiceMobile);
|
|
|
logger.info("REDIS异常报警 redisMobile :"+redisMobile);
|
|
|
logger.info("基础组 baseMobile :"+baseMobile);
|
|
|
}
|
|
|
|
|
|
|
|
|
public String getBaseMobile() {
|
|
|
return baseMobile;
|
...
|
...
|
|