public void sendMessage(String code,String phone,String... params){
try {
SmsSendViaTemplateParam param=new SmsSendViaTemplateParam();
param.addParams(Lists.newArrayList(params));
param.setReceiver(phone);
param.setTemplateCode(code);
notificationServiceClient.sendViaTemplate(param);
} catch (Exception e) {
logger.error("短信发送异常",e);
}
}
函数参数太多,嫌麻烦,又不想新建实体类,教你一招
最新推荐文章于 2023-08-22 14:37:17 发布