测试及开发环境短信发送手机号白名单

This commit is contained in:
feng.li
2024-01-15 14:40:33 +08:00
parent 57387a305d
commit 8b5c640b5a

View File

@@ -59,8 +59,8 @@ public class EventCenterHttpRequest {
@Value("${hsay.event.systemsource:null}")
private String source;
@Value("${spring.profiles.active}")
private String env;
@Value("#{'${sms.whiteList:null}'.split(',')}")
private List<String> whiteList;
/**
* 创建单个事件
@@ -134,12 +134,9 @@ public class EventCenterHttpRequest {
@Async
public void sendSmsVariable(String phone, SMSMsgEnum smsMsgEnum, String... objects) throws ApiException {
//为避免对真实线索造成困扰和便于测试,测试环境暂不给线索发送会销相关短信
if (env.equals("pre")
&& (SMSMsgEnum.EXHIBITION_INFO_UPDATE.equals(smsMsgEnum)
|| SMSMsgEnum.EXHIBITION_CLOSE.equals(smsMsgEnum))) {
log.info("测试环境暂不给线索发送会销相关短信phone{}params{}", phone, objects);
return;
//为避免对真实线索造成困扰和便于测试,测试环境只给白名单手机号发短信
if (whiteList == null || !whiteList.contains(phone)) {
return;
}
//1. 组织消息参数,短信的消息参数为 手机号: 参数1, 参数2, 参数3, 参数4, 参数5需要填入的参数为模板中 ${} 中的参数