Search in sources :

Example 1 with AliClientException

use of com.wingice.msg.ali.exception.AliClientException in project knife-starter by 1120023921.

the class KnifeSmsAliSenderContextImpl method buildClient.

private Client buildClient(AliAccount aliAccount) throws AliClientException {
    final Config config = new Config().setAccessKeyId(aliAccount.getAccessKeyId()).setAccessKeySecret(aliAccount.getAccessSecret());
    // 访问的域名
    config.endpoint = "dysmsapi.aliyuncs.com";
    try {
        return new Client(config);
    } catch (Exception e) {
        throw new AliClientException("构造阿里云短信Client失败");
    }
}
Also used : AliClientException(com.wingice.msg.ali.exception.AliClientException) Config(com.aliyun.teaopenapi.models.Config) Client(com.aliyun.dysmsapi20170525.Client) AliAccountNotFoundException(com.wingice.msg.ali.exception.AliAccountNotFoundException) MultiAliAccountException(com.wingice.msg.ali.exception.MultiAliAccountException) AliClientException(com.wingice.msg.ali.exception.AliClientException)

Aggregations

Client (com.aliyun.dysmsapi20170525.Client)1 Config (com.aliyun.teaopenapi.models.Config)1 AliAccountNotFoundException (com.wingice.msg.ali.exception.AliAccountNotFoundException)1 AliClientException (com.wingice.msg.ali.exception.AliClientException)1 MultiAliAccountException (com.wingice.msg.ali.exception.MultiAliAccountException)1