Revert "手机号码改为通过组加载"
This reverts commit 6db5c9ae.
Showing
5 changed files
with
24 additions
and
63 deletions
1 | package com.monitor.common.config; | 1 | package com.monitor.common.config; |
2 | 2 | ||
3 | -import com.monitor.common.service.AlarmMsgService; | ||
4 | -import com.util.GetUsersInfoUtil; | ||
5 | -import org.apache.commons.lang3.StringUtils; | ||
6 | -import org.slf4j.Logger; | ||
7 | -import org.slf4j.LoggerFactory; | ||
8 | -import org.springframework.beans.factory.annotation.Autowired; | ||
9 | import org.springframework.beans.factory.annotation.Value; | 3 | import org.springframework.beans.factory.annotation.Value; |
10 | import org.springframework.stereotype.Component; | 4 | import org.springframework.stereotype.Component; |
11 | -import retrofit.http.POST; | ||
12 | - | ||
13 | -import javax.annotation.PostConstruct; | ||
14 | 5 | ||
15 | /** | 6 | /** |
16 | * 告警任务的短信号码 Created by yoho on 2016/5/4. | 7 | * 告警任务的短信号码 Created by yoho on 2016/5/4. |
17 | */ | 8 | */ |
18 | @Component("snsMobileConfig") | 9 | @Component("snsMobileConfig") |
19 | public class SnsMobileConfig { | 10 | public class SnsMobileConfig { |
20 | - public static final Logger logger = LoggerFactory.getLogger(SnsMobileConfig.class); | ||
21 | 11 | ||
12 | + @Value("${base_mobile}") | ||
13 | + private String baseMobile; | ||
22 | 14 | ||
23 | - @Autowired | ||
24 | - private GetUsersInfoUtil getUsersInfoUtil; | 15 | + @Value("${redis_exception_mobile}") |
16 | + private String redisMobile; | ||
17 | + | ||
18 | + @Value("${java_service_alarm_mobile}") | ||
19 | + private String javaServiceMobile; | ||
25 | 20 | ||
26 | @Value("${java_service_alarm_flag}") | 21 | @Value("${java_service_alarm_flag}") |
27 | private boolean javaServiceFlag; | 22 | private boolean javaServiceFlag; |
@@ -32,56 +27,12 @@ public class SnsMobileConfig { | @@ -32,56 +27,12 @@ public class SnsMobileConfig { | ||
32 | @Value("${java_service_alarm_count_threshold}") | 27 | @Value("${java_service_alarm_count_threshold}") |
33 | private Integer javaServiceCountThreshold; | 28 | private Integer javaServiceCountThreshold; |
34 | 29 | ||
30 | + @Value("${java_api_error}") | ||
35 | private String javaApiError; | 31 | private String javaApiError; |
36 | 32 | ||
33 | + @Value("${bigdata_mobile}") | ||
37 | private String bigdataMobile; | 34 | private String bigdataMobile; |
38 | 35 | ||
39 | - private String javaServiceMobile; | ||
40 | - | ||
41 | - private String redisMobile; | ||
42 | - | ||
43 | - private String baseMobile; | ||
44 | - | ||
45 | - | ||
46 | - @PostConstruct | ||
47 | - public void init(){ | ||
48 | - //JAVAAPI错误报警 | ||
49 | - javaApiError =getUsersInfoUtil.getMobileByAlarmGroup("JAVAAPI错误报警"); | ||
50 | - if(StringUtils.isBlank(javaApiError)){ | ||
51 | - javaApiError=""; | ||
52 | - } | ||
53 | - //大数据报警 | ||
54 | - bigdataMobile=getUsersInfoUtil.getMobileByAlarmGroup("大数据报警"); | ||
55 | - if(StringUtils.isBlank(bigdataMobile)){ | ||
56 | - bigdataMobile=""; | ||
57 | - } | ||
58 | - | ||
59 | - //JAVASERVICE错误报警 | ||
60 | - javaServiceMobile=getUsersInfoUtil.getMobileByAlarmGroup("JAVASERVICE错误报警"); | ||
61 | - if(StringUtils.isBlank(javaServiceMobile)){ | ||
62 | - javaServiceMobile=""; | ||
63 | - } | ||
64 | - | ||
65 | - //REDIS异常报警 | ||
66 | - redisMobile=getUsersInfoUtil.getMobileByAlarmGroup("REDIS异常报警"); | ||
67 | - if(StringUtils.isBlank(redisMobile)){ | ||
68 | - redisMobile=""; | ||
69 | - } | ||
70 | - | ||
71 | - //基础组 | ||
72 | - baseMobile=getUsersInfoUtil.getMobileByAlarmGroup("基础组"); | ||
73 | - if(StringUtils.isBlank(baseMobile)){ | ||
74 | - baseMobile=""; | ||
75 | - } | ||
76 | - | ||
77 | - logger.info("初始化手机号码"); | ||
78 | - logger.info("JAVAAPI错误报警 javaApiError :"+javaApiError); | ||
79 | - logger.info("大数据报警 bigdataMobile :"+bigdataMobile); | ||
80 | - logger.info("JAVASERVICE错误报警 javaServiceMobile :"+javaServiceMobile); | ||
81 | - logger.info("REDIS异常报警 redisMobile :"+redisMobile); | ||
82 | - logger.info("基础组 baseMobile :"+baseMobile); | ||
83 | - } | ||
84 | - | ||
85 | 36 | ||
86 | public String getBaseMobile() { | 37 | public String getBaseMobile() { |
87 | return baseMobile; | 38 | return baseMobile; |
@@ -43,9 +43,6 @@ public class DeviceActiveTask { | @@ -43,9 +43,6 @@ public class DeviceActiveTask { | ||
43 | @PostConstruct | 43 | @PostConstruct |
44 | public void init() { | 44 | public void init() { |
45 | mobile = getUsersInfoUtil.getMobileByAlarmGroup(AlarmGroupContants.UNION_MOBILE); | 45 | mobile = getUsersInfoUtil.getMobileByAlarmGroup(AlarmGroupContants.UNION_MOBILE); |
46 | - if(mobile==null){ | ||
47 | - mobile=""; | ||
48 | - } | ||
49 | DEBUG.info("联盟激活的电话号码is "+ mobile); | 46 | DEBUG.info("联盟激活的电话号码is "+ mobile); |
50 | } | 47 | } |
51 | 48 |
@@ -8,14 +8,20 @@ qcloud_voice_url=https://yun.tim.qq.com/v3/tlsvoicesvr/sendvoiceprompt?sdkappid= | @@ -8,14 +8,20 @@ qcloud_voice_url=https://yun.tim.qq.com/v3/tlsvoicesvr/sendvoiceprompt?sdkappid= | ||
8 | qcloud_sms_url=https://yun.tim.qq.com/v3/tlssmssvr/sendmultisms2?sdkappid=1400021400&random=124 | 8 | qcloud_sms_url=https://yun.tim.qq.com/v3/tlssmssvr/sendmultisms2?sdkappid=1400021400&random=124 |
9 | qcloud_sms_key=6e56f948f6f1c0a1bc359e23f7acc140 | 9 | qcloud_sms_key=6e56f948f6f1c0a1bc359e23f7acc140 |
10 | 10 | ||
11 | - | 11 | +base_mobile=18751986615,18652008443,18252034289,17361900581,18751886435,17314953523 |
12 | switch_mobile=18751986615 | 12 | switch_mobile=18751986615 |
13 | 13 | ||
14 | +dns_exception_mobile=18751986615,18652008443,18252034289,17361900581 | ||
15 | + | ||
16 | +redis_exception_mobile=18751986615,18652008443,17361900581,18252034289 | ||
17 | + | ||
18 | +java_service_alarm_mobile=18751986615,18652008443,18252034289,17361900581,18602555621 | ||
14 | java_service_alarm_flag=true | 19 | java_service_alarm_flag=true |
15 | java_service_alarm_cost_threshold=300 | 20 | java_service_alarm_cost_threshold=300 |
16 | java_service_alarm_count_threshold=50 | 21 | java_service_alarm_count_threshold=50 |
17 | 22 | ||
23 | +bigdata_mobile=18652925653,18600623107,18651650543,18021522255 | ||
18 | 24 | ||
19 | - | 25 | +java_api_error=18751986615,18652008443,18252034289,13951882433,17361900581,18602555621 |
20 | 26 | ||
21 | SWITCH_DB_URL=http://172.31.56.59:8011/switchdb/switchMysql | 27 | SWITCH_DB_URL=http://172.31.56.59:8011/switchdb/switchMysql |
@@ -20,5 +20,8 @@ java_service_alarm_flag=true | @@ -20,5 +20,8 @@ java_service_alarm_flag=true | ||
20 | java_service_alarm_cost_threshold=300 | 20 | java_service_alarm_cost_threshold=300 |
21 | java_service_alarm_count_threshold=50 | 21 | java_service_alarm_count_threshold=50 |
22 | 22 | ||
23 | +bigdata_mobile=18652925653,17368731356,18600623107 | ||
24 | + | ||
25 | +java_api_error=18751986615,18652008443,18252034289,13951882433,17361900581,18602555621 | ||
23 | 26 | ||
24 | SWITCH_DB_URL=http://10.66.4.28:8011/switchdb/switchMysql | 27 | SWITCH_DB_URL=http://10.66.4.28:8011/switchdb/switchMysql |
@@ -24,4 +24,8 @@ java_service_alarm_flag=true | @@ -24,4 +24,8 @@ java_service_alarm_flag=true | ||
24 | java_service_alarm_cost_threshold=150 | 24 | java_service_alarm_cost_threshold=150 |
25 | java_service_alarm_count_threshold=50 | 25 | java_service_alarm_count_threshold=50 |
26 | 26 | ||
27 | +java_api_error=15905144483 | ||
28 | + | ||
29 | +bigdata_mobile=18652925653,18502542319 | ||
30 | + | ||
27 | SWITCH_DB_URL=http://127.0.0.1:8011/switchdb/switchMysql | 31 | SWITCH_DB_URL=http://127.0.0.1:8011/switchdb/switchMysql |
-
Please register or login to post a comment