update 优化 增加工作流短信发送案例

This commit is contained in:
疯狂的狮子Li
2026-01-28 15:35:57 +08:00
parent 04436c7393
commit d569655e53
2 changed files with 10 additions and 1 deletions

View File

@@ -30,6 +30,8 @@ public class RemoteSmsServiceImpl implements RemoteSmsService {
* @return SmsBlend 实例,代表指定供应商类型
*/
private SmsBlend getSmsBlend() {
// 自动获取一个短信服务商
// return SmsFactory.getSmsBlend();
// 可自定义厂商配置获取规则 例如根据租户获取 或 负载均衡多个厂商等
return SmsFactory.getSmsBlend("config1");
}

View File

@@ -10,6 +10,7 @@ import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.resource.api.RemoteMailService;
import org.dromara.resource.api.RemoteMessageService;
import org.dromara.resource.api.RemoteSmsService;
import org.dromara.system.api.domain.vo.RemoteUserVo;
import org.dromara.warm.flow.core.FlowEngine;
import org.dromara.warm.flow.core.entity.Node;
@@ -22,6 +23,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
@@ -42,6 +44,8 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
private RemoteMessageService remoteMessageService;
@DubboReference
private RemoteMailService remoteMailService;
@DubboReference
private RemoteSmsService remoteSmsService;
/**
* 根据流程实例发送消息给当前处理人
@@ -101,7 +105,10 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
remoteMailService.send(emails, subject, message);
}
case SMS_MESSAGE -> {
// TODO: 补充短信发送逻辑
// LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
// // 根据具体短信服务商参数用法传参
// map.put("code", "1234");
// remoteSmsService.sendMessage(phones, templateId, map);
log.info("【短信发送 - TODO】用户数量={} 内容={}", userList.size(), message);
}
default -> log.warn("【消息发送】未处理的消息类型:{}", messageTypeEnum);