java???????????sdk ????
???????????? ???????[ 2017/3/3 10:18:43 ] ??????????????????? Java
??????? ???????sdk??
????http://aliyundm.oss-cn-hangzhou.aliyuncs.com/example/aliyun-java-sdk-smsV1.zip ????
?????????????:getAcsResponse??doAction???????????????getAcsResponse??
????/**
????*
????* @param toPhone ?????????????
????* @param code ?????
????* @return
????*/
????public String getAcsResponse(String toPhone?? String code) {
????SingleSendSmsResponse httpResponse = new SingleSendSmsResponse();
????String result = "";
????try {
????IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou"??accessKey?? accessSecret);
????DefaultProfile.addEndpoint("cn-hangzhou"?? "cn-hangzhou"?? "Sms"??"sms.aliyuncs.com");
????IAcsClient client = new DefaultAcsClient(profile);
????SingleSendSmsRequest request = new SingleSendSmsRequest();
????request.setSignName(sign);// ??????????????????
????request.setTemplateCode(templateCode);// ??????????????CODE
????JSONObject jsonCode = new JSONObject();
????jsonCode.accumulate("code"?? code);
????request.setParamString(jsonCode.toString());
????request.setRecNum(toPhone);
????request.setAcceptFormat(FormatType.JSON); // ????json
????httpResponse = client.getAcsResponse(request);
????logger.info("send msgcode response: {} "?? httpResponse.toString());
????result = ConstUtils.ERROR_0;
????} catch (ClientException e) {
????e.printStackTrace();// //InvalidSignName.Malformed : The specified// sign name is wrongly formed.
????logger.error("send msgcode error :{}"?? e.getMessage());
????result = e.getErrCode();
????}
????return result;
????}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11