Authored by ping

update

... ... @@ -16,24 +16,22 @@ import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.core.rest.client.hystrix.AsyncFuture;
/**
* @author ping.huang
* 2016年6月2日
* @author ping.huang 2016年6月2日
*/
@Component
public class SendSMSHelper {
static Logger log = LoggerFactory.getLogger(SendSMSHelper.class);
@Resource
ServiceCaller serviceCaller;
private String aesKey = "yoho96461qaz2wsx";
private String smsUrl = "http://211.147.239.62:9050/cgi-bin/sendsms";
private String smsName = "yohoyx@yohoyx";
private String smsPwd = "EH+iuWSAfINJYwSdPgVqhA==";
public void sendNoticeSms(String mobile,String content){
public void sendNoticeSms(String mobile, String content) {
try {
String pwd = AES.decrypt(aesKey, smsPwd);
String text = URLEncoder.encode(content, "GBK");
... ... @@ -41,10 +39,10 @@ public class SendSMSHelper {
AsyncFuture<String> response = serviceCaller.get("sms.sendSMS", url, null, String.class, null);
String result = response.get();
log.info("sendSMS result is {}, mobile is {}", result, mobile);
}catch (Exception e) {
log.error("sendSMS error decrypt error with aesKey={}, smsPwd={}", aesKey, smsPwd, e);
return;
}
} catch (Exception e) {
log.error("sendSMS error decrypt error with aesKey={}, smsPwd={}", aesKey, smsPwd, e);
return;
}
}
}
... ...