@Override
public void sendMessage(String byName, String mobile, SceneType sceneType) {
Map<String, Object> valuesMap = new HashMap<String, Object>(4);
valuesMap.put(“code”, “1111”);
// valuesMap.put(“TemplateCode”,“SMS_171950567”);
valuesMap.put(“byName”, byName);
StrSubstitutor strSubstitutor = new StrSubstitutor(valuesMap);
String replace = strSubstitutor.replace(“您正在
b
y
N
a
m
e
,
验
证
码
是
:
{byName},验证码是:
byName,验证码是:{code}。”);
// 发送消息至mq
// SmsSendVO smsSendVO = new SmsSendVO();
// smsSendVO.setContext(replace);
// smsSendVO.setMobile(mobile);
// smsSendVO.setParms(valuesMap);
// rabbitTemplate.convertAndSend(AmqpExchange);
//缓存中记录短信验证码
cache.put(CachePrefix.CODE_PREFIX.getPrefix() + mobile, replace, 60);
//缓存中记录验证码
this.record(sceneType.name(), mobile, "1111");
}