|
|
|
@@ -307,4 +307,28 @@ public class AliyunSMS implements SMSExcutor { |
|
|
|
return new DefaultAcsClient(profile); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", "LTAI4GKRhF2aSXuQi9FGPRGQ", "LD2Z12QI5ZOlhaFjatJipwFSb2dgjm"); |
|
|
|
try { |
|
|
|
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com"); |
|
|
|
} catch (ClientException e) { |
|
|
|
log.error("获取短信发送服务机发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", |
|
|
|
e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); |
|
|
|
} |
|
|
|
QuerySmsTemplateRequest request = new QuerySmsTemplateRequest(); |
|
|
|
request.setTemplateCode("SMS_239312983"); |
|
|
|
|
|
|
|
DefaultAcsClient acsClient = new DefaultAcsClient(profile); |
|
|
|
QuerySmsTemplateResponse response = null; |
|
|
|
try { |
|
|
|
response = acsClient.getAcsResponse(request); |
|
|
|
} catch (ClientException e) { |
|
|
|
log.error("查询模板发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", |
|
|
|
e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); |
|
|
|
} |
|
|
|
log.info(" 查询模板----" + response.getCode() + "----" + JSON.toJSONString(response)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |