Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

liubing 3 years ago
parent
commit
b99b78fffc

+ 16 - 1
business/sms-service/pom.xml

@ -45,6 +45,21 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 end -->
        <!-- Redis  -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
        </dependency>
        <!-- Redis  -->
        <!-- 腾讯云短信  -->
        <dependency>
            <groupId>com.tencentcloudapi</groupId>
            <artifactId>tencentcloud-sdk-java</artifactId>
            <version>3.1.272</version>
        </dependency>
    </dependencies>
</project>

+ 118 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/service/TXYSmsService.java

@ -0,0 +1,118 @@
package com.yihu.jw.sms.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.sms.v20210111.SmsClient;
import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.sms.dao.HospitalSysDictDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/24
 * @Description:
 */
@Service
public class TXYSmsService {
    private Logger logger= LoggerFactory.getLogger(ZBSmsService.class);
    @Autowired
    private HospitalSysDictDao sysDictDao;
    @Autowired
    private StringRedisTemplate redisTemplate;
    private String SecretId;
    private String SecretKey;
    private String signName;
    private String smsSdkAppId;
    private String VerificationCode;
    /**
     * 初始化接口参数
     */
    private void init(){
        String key = "hz_yxyzh_wx_sms";
        if(redisTemplate.hasKey(key+ ":SecretId")){
            SecretId = redisTemplate.opsForValue().get(key + ":SecretId");
            SecretKey = redisTemplate.opsForValue().get(key + ":SecretKey");
            signName = redisTemplate.opsForValue().get(key + ":signName");
            smsSdkAppId = redisTemplate.opsForValue().get(key + ":smsSdkAppId");
            VerificationCode = redisTemplate.opsForValue().get(key + ":VerificationCode");
            return;
        }
        List<WlyyHospitalSysDictDO> dictDOList = sysDictDao.findByDictName("hz_yxyzh_wx_sms");
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:dictDOList){
            if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("SecretId")){
                SecretId=wlyyHospitalSysDictDO.getDictValue();
                redisTemplate.opsForValue().set(key + ":SecretId",SecretId);
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("SecretKey")){
                SecretKey=wlyyHospitalSysDictDO.getDictValue();
                redisTemplate.opsForValue().set(key + ":SecretKey",SecretKey);
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("signName")){
                signName=wlyyHospitalSysDictDO.getDictValue();
                redisTemplate.opsForValue().set(key + ":signName",signName);
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("smsSdkAppId")){
                smsSdkAppId=wlyyHospitalSysDictDO.getDictValue();
                redisTemplate.opsForValue().set(key + ":smsSdkAppId",smsSdkAppId);
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("VerificationCode")){
                VerificationCode=wlyyHospitalSysDictDO.getDictValue();
                redisTemplate.opsForValue().set(key + ":VerificationCode",VerificationCode);
            }
        }
    }
    public String sendMessage(String mobile,String code){
        try{
            init();
            Credential cred = new Credential(SecretId, SecretKey);
            HttpProfile httpProfile = new HttpProfile();
            httpProfile.setEndpoint("sms.tencentcloudapi.com");
            ClientProfile clientProfile = new ClientProfile();
            clientProfile.setHttpProfile(httpProfile);
            SmsClient client = new SmsClient(cred, "ap-nanjing", clientProfile);
            SendSmsRequest req = new SendSmsRequest();
            String[] phoneNumberSet1 = {"+86"+mobile};
            req.setPhoneNumberSet(phoneNumberSet1);
            req.setSmsSdkAppId(smsSdkAppId);
            req.setSignName(signName);
            req.setTemplateId(VerificationCode);
            String[] templateParamSet1 = {code};
            req.setTemplateParamSet(templateParamSet1);
            SendSmsResponse resp = client.SendSms(req);
            JSONObject json = JSON.parseObject(SendSmsResponse.toJsonString(resp));
            String res = json.getJSONArray("SendStatusSet").getJSONObject(0).getString("Code");
            if(!"Ok".equals(res)){
                logger.info("腾讯短信发送失败:"+SendSmsResponse.toJsonString(resp));
            }
            return res;
        } catch (TencentCloudSDKException e) {
            e.printStackTrace();
            logger.info("腾讯短信报错:"+e.toString());
        }
        return "error";
    }
}

+ 60 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -27,6 +27,7 @@ import com.yihu.jw.security.oauth2.provider.WlyyTokenGranter;
import com.yihu.jw.security.oauth2.provider.error.WlyyOAuth2ExceptionTranslator;
import com.yihu.jw.security.service.*;
import com.yihu.jw.security.utils.*;
import com.yihu.jw.sms.service.TXYSmsService;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.sms.service.ZBSmsService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
@ -131,6 +132,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @Autowired
    private ZBSmsService zbSmsService;
    @Autowired
    private TXYSmsService txySmsService;
    @Autowired
    private OauthCaConfigSerivce oauthCaConfigSerivce;
    @Autowired
    private OauthWjwConfigService oauthWjwConfigService;
@ -689,7 +692,62 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    }
    /**
     * 腾讯云短信接口
     * @param parameters
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/oauth/sendTXYCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendTXYCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String client_id = parameters.get("client_id");
        String username = parameters.get("username");
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id");
        }
        if (StringUtils.isEmpty(username)) {
            throw new InvalidRequestException("username");
        }
        if (username.length()>12){
            throw new InvalidRequestException("请输入正确的手机号!");
        }
        //验证请求间隔超时,防止频繁获取验证码
        if (!wlyyRedisVerifyCodeService.isIntervalTimeout(client_id, username)) {
            throw new IllegalAccessException("SMS request frequency is too fast");
        }
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedSMS");
        if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
            String captcha = wlyyHospitalSysDictDO.getDictValue();
            Captcha _captcha = new Captcha();
            _captcha.setCode(captcha);
            _captcha.setExpiresIn(300);
            wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
            Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("success", 200);
            HttpHeaders headers = new HttpHeaders();
            headers.set("Cache-Control", "no-store");
            headers.set("Pragma", "no-cache");
            return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
        }else {
            //发送短信获取验证码
            String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
            //
            String result =  txySmsService.sendMessage(username,captcha);
            if ("ok".equals(result)) {
                Captcha _captcha = new Captcha();
                _captcha.setCode(captcha);
                _captcha.setExpiresIn(300);
                wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
                Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200, null);
                HttpHeaders headers = new HttpHeaders();
                headers.set("Cache-Control", "no-store");
                headers.set("Pragma", "no-cache");
                return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
            }
        }
        throw new IllegalStateException("验证码发送失败!");
    }
    @RequestMapping(value = "/oauth/sendCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
@ -709,6 +767,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            return sendXZCaptcha(parameters);
        }else if ("sd_tnzyy_wx".equals(wxId)){
            return sendZBCaptcha(parameters);
        }else if("hz_yyyzh_wx".equals(wxId)){
            return sendTXYCaptcha(parameters);
        }
        throw new IllegalStateException("验证码发送失败");
    }

+ 0 - 6
svr/svr-cloud-care/pom.xml

@ -253,12 +253,6 @@
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.tencentcloudapi</groupId>
            <artifactId>tencentcloud-sdk-java</artifactId>
            <version>3.1.265</version><!-- 注:这里只是示例版本号,请获取并替换为 最新的版本号 -->
        </dependency>
        <!--oracle驱动-->
        <dependency>
            <groupId>com.oracle</groupId>

+ 6 - 0
svr/svr-cloud-care/sql/init.sql

@ -0,0 +1,6 @@
-- 短信配置
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('hz_yxyzh_wx_sms_SecretId', NULL, 'hz_yxyzh_wx_sms', 'SecretId', 'AKIDwhBPN5WgYAVaO2QXNwEF0UieJhpgGZbN', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('hz_yxyzh_wx_sms_SecretKey', NULL, 'hz_yxyzh_wx_sms', 'SecretKey', 'WliPpdBSXMuBBuNZU8VbQyFG0TfaEbhX', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('hz_yxyzh_wx_sms_signName', NULL, 'hz_yxyzh_wx_sms', 'signName', '朝晖云照护', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('hz_yxyzh_wx_sms_smsSdkAppId', NULL, 'hz_yxyzh_wx_sms', 'smsSdkAppId', '1400526119', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('hz_yxyzh_wx_sms_VerificationCode', NULL, 'hz_yxyzh_wx_sms', 'VerificationCode', '969545', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

+ 30 - 30
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/config/TencentSmsConfig.java

@ -1,30 +1,30 @@
package com.yihu.jw.care.config;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Handler;
/**
 * 腾讯云SMS配置
 * Created by Bing on 2021/5/19.
 */
public class TencentSmsConfig {
    public static final String SecretId= "AKIDjGXYIlyua080cy3rOfgRv96mBLDo8ByU";
    public static final String SecretKey= "GEwOZS5SYNvCCuLVO0LQFm21jAKCn7Bz";
    public static final String host = "sms.tencentcloudapi.com";//
    public static final Map<String,String> templateId= new HashMap<>();
    public static final Long overTime = 24L;
    {
        templateId.put("VerificationCode","验证码模板id");//验证码模板id
    }
    public static String getTemplateId(String key){
        return templateId.get(key);
    }
}
//package com.yihu.jw.care.config;
//
//import java.util.HashMap;
//import java.util.Map;
//import java.util.logging.Handler;
//
///**
// * 腾讯云SMS配置
// * Created by Bing on 2021/5/19.
// */
//public class TencentSmsConfig {
//
//    public static final String SecretId= "AKIDjGXYIlyua080cy3rOfgRv96mBLDo8ByU";
//    public static final String SecretKey= "GEwOZS5SYNvCCuLVO0LQFm21jAKCn7Bz";
//
//    public static final String host = "sms.tencentcloudapi.com";//
//
//    public static final Map<String,String> templateId= new HashMap<>();
//
//    public static final Long overTime = 24L;
//
//    {
//        templateId.put("VerificationCode","验证码模板id");//验证码模板id
//    }
//
//    public static String getTemplateId(String key){
//        return templateId.get(key);
//    }
//}
//

+ 142 - 142
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/TencentSmsUtil.java

@ -1,142 +1,142 @@
package com.yihu.jw.care.util;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.sms.v20190711.SmsClient;
import com.tencentcloudapi.sms.v20190711.models.SendSmsRequest;
import com.tencentcloudapi.sms.v20190711.models.SendSmsResponse;
import com.yihu.jw.care.config.TencentSmsConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
 * Created by Bing on 2021/5/19.
 */
@Component
public class TencentSmsUtil {
    @Autowired
    private StringRedisTemplate redisTemplate;
    private TencentSmsConfig tencentSmsConfig = new TencentSmsConfig();
    /**
     *  获取短信验证码
     * @param phoneNumberList 手机列表
     * @param templateParamList 参数列表
     * @param type 模板key VerificationCode:手机验证码
     * @return
     */
    public String SendSms(List<String> phoneNumberList, List<String> templateParamList,String type) {
        try {
            Iterator<String> iterator = phoneNumberList.iterator();
            if ("VerificationCode".equals(type)){//超过10次无法再发送短信验证码
                while (iterator.hasNext()) {
                    String phone = iterator.next();
                    if (redisTemplate.hasKey("tencentSmsVFCode-" + phone)) {//验证码每天上限10次
                        Integer count = Integer.valueOf(redisTemplate.opsForValue().get("tencentSmsVFCode-" + phone));
                        if (count > 10) {
                            iterator.remove();
                        }else {
                            count++;
                            Long expire = redisTemplate.boundHashOps("tencentSmsVFCode-" + phone).getExpire();
                            redisTemplate.opsForValue().set("tencentSmsVFCode-" + phone,count+"",expire, TimeUnit.SECONDS);
                        }
                    }
                    else {
                        int count =1;
                        redisTemplate.opsForValue().set("tencentSmsVFCode-" + phone,count+"",tencentSmsConfig.overTime, TimeUnit.HOURS);
                    }
                }
            }
            String[] phoneNumbers = phoneNumberList.toArray(new String[0]);
            String[] templateParams = templateParamList!=null?templateParamList.toArray(new String[0]):null;
            Credential cred = new Credential(tencentSmsConfig.SecretId, tencentSmsConfig.SecretKey);
            HttpProfile httpProfile = new HttpProfile();
            // 设置代理
//            httpProfile.setProxyHost("host");
//            httpProfile.setProxyPort(port);
            httpProfile.setReqMethod("POST");
            httpProfile.setConnTimeout(60);
            httpProfile.setEndpoint("sms.tencentcloudapi.com");
            ClientProfile clientProfile = new ClientProfile();
            /** SDK默认用TC3-HMAC-SHA256进行签名
             * 非必要请不要修改这个字段 */
            clientProfile.setSignMethod("HmacSHA256");
            clientProfile.setHttpProfile(httpProfile);
            /** 实例化要请求产品(以sms为例)的client对象
             * 第二个参数是地域信息,可以直接填写字符串ap-guangzhou,或者引用预设的常量 */
            SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
            SendSmsRequest req = new SendSmsRequest();
            /* 短信应用ID: 短信SdkAppid在 [短信控制台] 添加应用后生成的实际SdkAppid,示例如1400006666 */
            String appid = "1400009099";
            req.setSmsSdkAppid(appid);
            /* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名,签名信息可登录 [短信控制台] 查看 */
            String sign = "签名内容";
            req.setSign(sign);
            /* 模板 ID: 必须填写已审核通过的模板 ID。模板ID可登录 [短信控制台] 查看 */
            String templateID = tencentSmsConfig.getTemplateId(type);
            req.setTemplateID(templateID);
            /** 下发手机号码,采用 e.164 标准,+[国家或地区码][手机号]
             * 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号
             * */
            req.setPhoneNumberSet(phoneNumbers);
            /** 模板参数: 若无模板参数,则设置为空
             String[] templateParams = {"5678"};*/
            req.setTemplateParamSet(templateParams);
            /** 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的
             * 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */
            SendSmsResponse res = client.SendSms(req);
            // 输出json格式的字符串回包
            System.out.println(SendSmsResponse.toJsonString(res));
            // 也可以取出单个值,你可以通过官网接口文档或跳转到response对象的定义处查看返回字段的定义
            System.out.println(res.getRequestId());
            return SendSmsResponse.toJsonString(null);
        } catch (TencentCloudSDKException e) {
            e.printStackTrace();
            return null;
        }
    }
}
/**        返回值
 *{
 *   "Response": {
 *     "SendStatusSet": [
 *       {
 *         "SerialNo": "5000:1045710669157053657849499619", 发送流水号。
 *         "PhoneNumber": "+8618511122233",
 *         "Fee": 1, 计费条数,计费规则请查询
 *         "SessionContext": "test",
 *         "Code": "Ok", 短信请求状态码
 *         "Message": "send success",
 *         "IsoCode": "CN"
 *       },
 *       {
 *         "SerialNo": "5000:104571066915705365784949619",
 *         "PhoneNumber": "+8618511122266",
 *         "Fee": 1,
 *         "SessionContext": "test",
 *         "Code": "Ok",
 *         "Message": "send success",
 *         "IsoCode": "CN"
 *       }
 *     ],
 *     "RequestId": "a0aabda6-cf91-4f3e-a81f-9198114a2279"
 *   }
 * }
 */
//package com.yihu.jw.care.util;
//
//import com.tencentcloudapi.common.Credential;
//import com.tencentcloudapi.common.exception.TencentCloudSDKException;
//import com.tencentcloudapi.common.profile.ClientProfile;
//import com.tencentcloudapi.common.profile.HttpProfile;
//import com.tencentcloudapi.sms.v20190711.SmsClient;
//import com.tencentcloudapi.sms.v20190711.models.SendSmsRequest;
//import com.tencentcloudapi.sms.v20190711.models.SendSmsResponse;
//import com.yihu.jw.care.config.TencentSmsConfig;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.stereotype.Component;
//
//import java.util.Iterator;
//import java.util.List;
//import java.util.concurrent.TimeUnit;
//
///**
// * Created by Bing on 2021/5/19.
// */
//@Component
//public class TencentSmsUtil {
//
//    @Autowired
//    private StringRedisTemplate redisTemplate;
//    private TencentSmsConfig tencentSmsConfig = new TencentSmsConfig();
//
//    /**
//     *  获取短信验证码
//     * @param phoneNumberList 手机列表
//     * @param templateParamList 参数列表
//     * @param type 模板key VerificationCode:手机验证码
//     * @return
//     */
//    public String SendSms(List<String> phoneNumberList, List<String> templateParamList,String type) {
//        try {
//            Iterator<String> iterator = phoneNumberList.iterator();
//            if ("VerificationCode".equals(type)){//超过10次无法再发送短信验证码
//                while (iterator.hasNext()) {
//                    String phone = iterator.next();
//                    if (redisTemplate.hasKey("tencentSmsVFCode-" + phone)) {//验证码每天上限10次
//                        Integer count = Integer.valueOf(redisTemplate.opsForValue().get("tencentSmsVFCode-" + phone));
//                        if (count > 10) {
//                            iterator.remove();
//                        }else {
//                            count++;
//                            Long expire = redisTemplate.boundHashOps("tencentSmsVFCode-" + phone).getExpire();
//                            redisTemplate.opsForValue().set("tencentSmsVFCode-" + phone,count+"",expire, TimeUnit.SECONDS);
//                        }
//                    }
//                    else {
//                        int count =1;
//                        redisTemplate.opsForValue().set("tencentSmsVFCode-" + phone,count+"",tencentSmsConfig.overTime, TimeUnit.HOURS);
//                    }
//                }
//            }
//            String[] phoneNumbers = phoneNumberList.toArray(new String[0]);
//            String[] templateParams = templateParamList!=null?templateParamList.toArray(new String[0]):null;
//            Credential cred = new Credential(tencentSmsConfig.SecretId, tencentSmsConfig.SecretKey);
//            HttpProfile httpProfile = new HttpProfile();
//            // 设置代理
////            httpProfile.setProxyHost("host");
////            httpProfile.setProxyPort(port);
//            httpProfile.setReqMethod("POST");
//            httpProfile.setConnTimeout(60);
//            httpProfile.setEndpoint("sms.tencentcloudapi.com");
//            ClientProfile clientProfile = new ClientProfile();
//
//            /** SDK默认用TC3-HMAC-SHA256进行签名
//             * 非必要请不要修改这个字段 */
//            clientProfile.setSignMethod("HmacSHA256");
//            clientProfile.setHttpProfile(httpProfile);
//
//            /** 实例化要请求产品(以sms为例)的client对象
//             * 第二个参数是地域信息,可以直接填写字符串ap-guangzhou,或者引用预设的常量 */
//            SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
//            SendSmsRequest req = new SendSmsRequest();
//
//            /* 短信应用ID: 短信SdkAppid在 [短信控制台] 添加应用后生成的实际SdkAppid,示例如1400006666 */
//            String appid = "1400009099";
//            req.setSmsSdkAppid(appid);
//
//            /* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名,签名信息可登录 [短信控制台] 查看 */
//            String sign = "签名内容";
//            req.setSign(sign);
//
//            /* 模板 ID: 必须填写已审核通过的模板 ID。模板ID可登录 [短信控制台] 查看 */
//            String templateID = tencentSmsConfig.getTemplateId(type);
//            req.setTemplateID(templateID);
//
//            /** 下发手机号码,采用 e.164 标准,+[国家或地区码][手机号]
//             * 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号
//             * */
//            req.setPhoneNumberSet(phoneNumbers);
//
//            /** 模板参数: 若无模板参数,则设置为空
//             String[] templateParams = {"5678"};*/
//            req.setTemplateParamSet(templateParams);
//
//            /** 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的
//             * 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */
//            SendSmsResponse res = client.SendSms(req);
//
//            // 输出json格式的字符串回包
//            System.out.println(SendSmsResponse.toJsonString(res));
//            // 也可以取出单个值,你可以通过官网接口文档或跳转到response对象的定义处查看返回字段的定义
//            System.out.println(res.getRequestId());
//            return SendSmsResponse.toJsonString(null);
//        } catch (TencentCloudSDKException e) {
//            e.printStackTrace();
//            return null;
//        }
//    }
//}
///**        返回值
// *{
// *   "Response": {
// *     "SendStatusSet": [
// *       {
// *         "SerialNo": "5000:1045710669157053657849499619", 发送流水号。
// *         "PhoneNumber": "+8618511122233",
// *         "Fee": 1, 计费条数,计费规则请查询
// *         "SessionContext": "test",
// *         "Code": "Ok", 短信请求状态码
// *         "Message": "send success",
// *         "IsoCode": "CN"
// *       },
// *       {
// *         "SerialNo": "5000:104571066915705365784949619",
// *         "PhoneNumber": "+8618511122266",
// *         "Fee": 1,
// *         "SessionContext": "test",
// *         "Code": "Ok",
// *         "Message": "send success",
// *         "IsoCode": "CN"
// *       }
// *     ],
// *     "RequestId": "a0aabda6-cf91-4f3e-a81f-9198114a2279"
// *   }
// * }
// */