package com.template.common.utils; import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.exception.TencentCloudSDKException; //导入可选配置类 import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.HttpProfile; // 导入对应SMS模块的client // 导入要请求接口对应的request response类 import com.template.config.smsConfig; import org.springframework.beans.factory.annotation.Autowired; /** * Tencent Cloud Sms Sendsms */ public class SendSms { @Autowired private static smsConfig smsConfig; //腾讯云上的签名 private static String secretID="AKIDDPo13qZCZqtgJsGQL7AyYu1wc7QVMyLl"; //腾讯云上的密钥 private static String secretKey="JPGrELFySiv0pOrKOPEwSnulOq9IPPDr"; //短信应用id private static String sdkAppid="1400813506"; //短信签名内容 private static String signName="华仁享学教育"; //模板Id private static String templateId="1770016"; //验证码有效时长 private static String smsMin="1"; public static void main(String[] args) throws TencentCloudSDKException{ //这里定义一个存储电话号码的数组 String tels="+8615779633758"; // 手机号前面记得带上国家区域编码 // SendStatus[] test = sendSms(tels); } }