mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-06 17:08:40 +08:00
fix: 增加短信前置签名编号配置项
This commit is contained in:
parent
f0e018b855
commit
d921679af4
@ -8,7 +8,7 @@ import org.dromara.sms4j.provider.config.BaseConfig;
|
||||
/**
|
||||
* <p>类名: YiXintongConfig
|
||||
* <p>说明:联通一信通平台配置类
|
||||
* <p>所用到配置项:spCode、f、accessKeyId(用户名)、accessKeySecret(接口密钥)、templateId、retryInterval、maxRetries
|
||||
* <p>所用到配置项:spCode、f、accessKeyId(用户名)、accessKeySecret(接口密钥)、signCode、templateId、retryInterval、maxRetries
|
||||
*
|
||||
* @author moat
|
||||
* @create 2024-07-30 16:50
|
||||
@ -27,6 +27,11 @@ public class YiXintongConfig extends BaseConfig {
|
||||
*/
|
||||
private String spCode;
|
||||
|
||||
/**
|
||||
* 签名编号
|
||||
*/
|
||||
private String signCode;
|
||||
|
||||
/**
|
||||
* 提交时检测方式
|
||||
* 1 --- 提交号码中有效的号码仍正常发出短信,无效的号码在返回参数faillist中列出
|
||||
|
||||
@ -92,6 +92,7 @@ public class YiXintongSmsImpl extends AbstractSmsBlend<YiXintongConfig> {
|
||||
forms.put("SerialNumber", serialNumber);
|
||||
forms.put("ScheduleTime", ""); // 立即发送
|
||||
forms.put("f", config.getF());
|
||||
forms.put("signCode", config.getSignCode());
|
||||
|
||||
SmsResponse smsResponse;
|
||||
try {
|
||||
|
||||
@ -161,6 +161,7 @@ sms:
|
||||
access-key-id: xxxxxx #(必填)用户名
|
||||
access-key-secret: 324gaxxxxxxxxxxxxxxxxx9sdf89 #(必填)接口密钥(正式帐户需要登陆平台,接口业务-接口申请右侧钥匙状图标查看或获取,接口密钥获取后十分钟生效)
|
||||
template-id: #(可选)模板编号(若配置此参数,则会默认使用该模板,以便提高服务方性能)
|
||||
sign-code: #(可选)短信前置签名编号(登陆平台-接口业务-我的签名查看)
|
||||
f: 1 #(可选)默认为1,提交时检测方式
|
||||
|
||||
sms-oa:
|
||||
|
||||
@ -547,7 +547,7 @@ public class Sms4jTest {
|
||||
Assert.isTrue(smsResponse1.isSuccess());
|
||||
|
||||
// 群发
|
||||
List<String> phones = CollectionUtil.toList("2222222222");
|
||||
List<String> phones = CollectionUtil.toList(PHONE);
|
||||
String message2 = StrUtil.format("你有一项编号为{}的事务需要处理。", SmsUtils.getRandomInt(6));
|
||||
SmsResponse smsResponse2 = SmsFactory.getBySupplier(SupplierConstant.YIXINTONG).massTexting(phones, message2);
|
||||
log.info(JSONUtil.toJsonStr(smsResponse2));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user