测试环境暂时不发送会销相关短信
This commit is contained in:
@@ -59,6 +59,9 @@ public class EventCenterHttpRequest {
|
||||
@Value("${hsay.event.systemsource:null}")
|
||||
private String source;
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String env;
|
||||
|
||||
/**
|
||||
* 创建单个事件
|
||||
* @param request {@link com.cool.store.request.event.CreateSingleEventRequest}
|
||||
@@ -131,6 +134,15 @@ 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;
|
||||
}
|
||||
|
||||
//1. 组织消息参数,短信的消息参数为 手机号: 参数1, 参数2, 参数3, 参数4, 参数5,,需要填入的参数为模板中 ${} 中的参数
|
||||
HashMap<String, String> smsParams = new HashMap<>();
|
||||
String params = String.join(",", Arrays.asList(objects));
|
||||
|
||||
@@ -63,7 +63,7 @@ class EventRequestTest extends AbstractJUnit4SpringContextTests {
|
||||
|
||||
@Test
|
||||
void testSMSNotice() throws ApiException {
|
||||
String testPhone = "15735114608";
|
||||
String testPhone = "17612868414";
|
||||
String testDate = "2023-11-05 10:00:00";
|
||||
String randomStr = RandomUtil.randomString(12);
|
||||
String wxUrlPrefix = "https://wxaurl.cn/";
|
||||
@@ -90,6 +90,10 @@ class EventRequestTest extends AbstractJUnit4SpringContextTests {
|
||||
randomStr = RandomUtil.randomString(12);
|
||||
testWXUrl = wxUrlPrefix + randomStr;
|
||||
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.SMS_INVATE, testWXUrl);
|
||||
//7. 展会信息变更
|
||||
randomStr = RandomUtil.randomString(12);
|
||||
testWXUrl = wxUrlPrefix + randomStr;
|
||||
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.EXHIBITION_INFO_UPDATE, "测试", "2023-12-24", "1008611", testWXUrl);
|
||||
//8. 展会结束
|
||||
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.EXHIBITION_CLOSE, "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user