1;短信调试完成
This commit is contained in:
parent
3b7a5fc95e
commit
7af5b42aee
Binary file not shown.
|
@ -139,6 +139,10 @@ tencent:
|
|||
smsSdkAppId: 1400921153
|
||||
region: ap-beijing
|
||||
smsUrl: sms.tencentcloudapi.com
|
||||
bus:
|
||||
enterpriseId: 1049039
|
||||
appId: 10011721121033115
|
||||
appKey: c167746e38d64143a874cec3d5de014e
|
||||
|
||||
clientIP:
|
||||
proxyAddr: k136.kdltps.com
|
||||
|
|
|
@ -131,6 +131,19 @@
|
|||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/../lib/eleme-openapi-sdk-1.30.58.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lianlu</groupId>
|
||||
<artifactId>lianlu-sdk-java</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/../lib/lianlu-sdk-java-1.0.0.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.79</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
package com.ruoyi.common.config;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lianlu.common.Credential;
|
||||
import com.lianlu.models.SmsSend;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
public class BusTencentProperties {
|
||||
|
||||
@Value("${tencent.bus.enterpriseId}")
|
||||
private String enterpriseId;
|
||||
@Value("${tencent.bus.appId}")
|
||||
private String appId;
|
||||
@Value("${tencent.bus.appKey}")
|
||||
private String appKey;
|
||||
|
||||
private static String MchId = "1049039";
|
||||
private static String AppId = "10011721121033115";
|
||||
private static String AppKey = "c167746e38d64143a874cec3d5de014e";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// //使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true);
|
||||
Credential credential = new Credential(MchId, AppId, AppKey, true);
|
||||
|
||||
// NormalSend
|
||||
SmsSend s = new SmsSend();
|
||||
s.setPhoneNumberSet(new String[] {"17612400322"});
|
||||
s.setSignName("【签名内容】");
|
||||
s.setSessionContext("短信内容");
|
||||
JSONObject re = s.NormalSend(credential, s);
|
||||
System.out.println(re);
|
||||
|
||||
// PersonalSend
|
||||
// SmsSend s = new SmsSend();
|
||||
// s.setSignName("【xxx】");
|
||||
// s.setSessionContextSet("test{%1%}{%2%}");
|
||||
// s.setContextParamSet(new String[][] {new String[] {"xxx", "变量内容1","变量内容2"}, new String[] {"xxx", "变量内容1","变量内容2"}});
|
||||
// JSONObject re = s.PersonalSend(credential, s);
|
||||
//
|
||||
// System.out.println(re);
|
||||
// //使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true);
|
||||
// Credential credential = new Credential(MchId, AppId, AppKey);
|
||||
// SmsSend s = new SmsSend();
|
||||
//
|
||||
// TemplateSend
|
||||
// SmsSend s = new SmsSend();
|
||||
// s.setTemplateParamSet(new String[] {"", ""});
|
||||
// s.setPhoneNumberSet(new String[] {""});
|
||||
// s.setTemplateId("");
|
||||
// JSONObject re = s.TemplateSend(credential, s);
|
||||
// System.out.println(re);
|
||||
// // GetBalance
|
||||
// //使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true);
|
||||
// Credential credential = new Credential(MchId, AppId, AppKey);
|
||||
//
|
||||
// VoiceSend
|
||||
// VoiceSend s = new VoiceSend();
|
||||
// s.setPhoneNumberSet(new String[] {"15601862749"});
|
||||
// s.setTemplateId("70002708");
|
||||
// s.setTemplateParamSet(new String[] {"12121"});
|
||||
// JSONObject re = s.Send(credential, s);
|
||||
// System.out.println(re);
|
||||
|
||||
// RCSNormalSend
|
||||
// Credential credential = new Credential(MchId, AppId, AppKey);
|
||||
// SmsSend s = new SmsSend();
|
||||
// s.setTemplateId("10134");
|
||||
// s.setPhoneNumberSet(new String[] {"xxx", "xxx", "xxx"});
|
||||
// JSONObject re = s.RCSNormalSend(credential, s);
|
||||
|
||||
// RCSPersonalSend
|
||||
// Credential credential = new Credential(MchId, AppId, AppKey);
|
||||
// SmsSend s = new SmsSend();
|
||||
// s.setTemplateId("10134");
|
||||
// JSONObject j = new JSONObject();
|
||||
// j.put("phone", "");
|
||||
// JSONObject k = new JSONObject();
|
||||
// k.put("变量", "1");
|
||||
// j.put("params", k);
|
||||
// s.setRCSTemplateParamSet(new JSONObject[]{j});
|
||||
// JSONObject re = s.RCSPersonalSend(credential, s);
|
||||
// SmsSend s = new SmsSend();
|
||||
// // NormalSend
|
||||
// s.setSessionContext("");
|
||||
// s.setPhoneNumberSet(new String[] {"",""});
|
||||
// s.setSignName("【】");
|
||||
//
|
||||
// JSONObject re = s.NormalSend(credential, s);
|
||||
|
||||
// Product p = new Product();
|
||||
// JSONObject re = p.GetBalance(credential);
|
||||
//
|
||||
// ShortLink s = new ShortLink();
|
||||
// s.setShortName("111");
|
||||
// s.setUrl("https://www.baidu.com");
|
||||
// s.setDomain("3");
|
||||
// s.setAccessDeadline("0");
|
||||
// JSONObject re = s.create(credential, s);
|
||||
// System.out.println(re);
|
||||
// //使用http需给Credential添加true参数new Credential(MchId, AppId, AppKey, true);
|
||||
// Credential credential = new Credential(MchId, AppId, AppKey);
|
||||
// // createTemplate
|
||||
// int signId = 0;
|
||||
// Product p = new Product();
|
||||
// JSONObject re = p.CreateTemplate(credential, signId, "", "");
|
||||
// System.out.println(re);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue