/** |
* |
* @包名 :com.feel.common.util |
* @文件名 :SendMobileRand.java |
* TODO 类作用:发送手机验证码 |
* @系统名称 : 丰盛达商城 |
* @Author: 刘泽中 |
* @Date: 2015-9-8 下午2:41:08 |
* @版本号 :v0.0.01 |
*/ |
public class SendMobileRand { |
/** |
* |
* TODO 方法作用: 发送手机验证码 |
* @param mobile 手机号 |
* @param model 模板代码 |
* @param mobile_rand 验证码 |
* @param time 超时时间 |
* @return |
* @Author: 刘泽中 |
* @Date: 2015-8-26 上午8:51:21 |
*/ |
public synchronized Map<String, Object> sendTemplateSMS(String mobile,String model,String mobile_rand,String time) { |
HashMap<String, Object> result = new HashMap<String, Object>(); |
CCPRestSDK restAPI = new CCPRestSDK(); |
model = "34279" ; |
restAPI.init( "app.cloopen.com" , "8883" ); // 初始化服务器地址和端口,格式如下,服务器地址不需要写https:// |
restAPI.setAccount( "8a48b5514f4fc588014f5d385f0511a8" , "7ed66cb3a38d426a9a0cee83809d7ddd" ); // 初始化主帐号和主帐号TOKEN |
restAPI.setAppId( "8a48b5514f4fc588014f5d3a9edd11b4" ); // 应用ID |
try { |
result = restAPI.sendTemplateSMS(mobile,model , new String[]{mobile_rand,time}); |
} catch (Exception e){ |
result.put(shop_admin_userBean.statusCode, CodeConstant.CODE_0123); |
result.put(shop_admin_userBean.statusMsg, MessageConstant.CODE_0123); |
} |
// result.put("statusCode", "000000"); |
return result; |
} |
} |