当前位置: 首页>>代码示例>>Java>>正文


Java AlibabaAliqinFcSmsNumSendResponse类代码示例

本文整理汇总了Java中com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse的典型用法代码示例。如果您正苦于以下问题:Java AlibabaAliqinFcSmsNumSendResponse类的具体用法?Java AlibabaAliqinFcSmsNumSendResponse怎么用?Java AlibabaAliqinFcSmsNumSendResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AlibabaAliqinFcSmsNumSendResponse类属于com.taobao.api.response包,在下文中一共展示了AlibabaAliqinFcSmsNumSendResponse类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SendPhoneToCustom

import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse; //导入依赖的package包/类
@RequestMapping(path = "/phone/send", method = RequestMethod.POST)
public PhoneVo SendPhoneToCustom(@RequestBody PhoneVo vo) throws ApiException {
	System.err.println(vo.getPhone());
	vo.setCode(RandomStringUtils.randomNumeric(6));
	// 24619654
	String url = "https://eco.taobao.com/router/rest";
	String appkey = "";
	String secret = "a68a283919212762db0f58132e1c76bd";
	
	TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
	AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
	req.setExtend("123456");
	req.setSmsType("normal");
	req.setSmsFreeSignName("数盟");
	req.setSmsParamString("{\"code\":\"" + vo.getCode() + "\"}");
	req.setRecNum(vo.getPhone());
	req.setSmsTemplateCode("SMS_94715134");
	AlibabaAliqinFcSmsNumSendResponse rsp = client.execute(req);
	System.out.println(rsp.getBody());

	return vo;
}
 
开发者ID:514840279,项目名称:danyuan-application,代码行数:23,代码来源:SimapleMailRegist.java

示例2: send

import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse; //导入依赖的package包/类
/**
 * 发送短信
 */
public String send(String mobiles, String templateId, String jsonContent) throws Exception {
	TaobaoClient client = new DefaultTaobaoClient(url, appKey, appSecret);
	AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
	req.setSmsType("normal");
	req.setSmsFreeSignName(sign);
	req.setSmsParamString(jsonContent);
	req.setRecNum(mobiles);
	req.setSmsTemplateCode(templateId);
	AlibabaAliqinFcSmsNumSendResponse rsp = client.execute(req);
	if (!rsp.isSuccess()) {
		logger.error("send sms fail. return code: {}, value:{}. please check service return value!", rsp.getErrorCode(), rsp.getMsg());
		throw new Exception("send sms fail. res=" + rsp.getErrorCode());
	}
	return rsp.getMsg();
}
 
开发者ID:lemon-china,项目名称:lemon-dubbo-message,代码行数:19,代码来源:AlismsClient.java

示例3: verifyCode

import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse; //导入依赖的package包/类
public String verifyCode(User user) throws Exception {
        String url = "http://gw.api.taobao.com/router/rest";
        int code = VerifyCodeUtil.createVerifyCode();
        TaobaoClient client = new DefaultTaobaoClient(url,
                "23780335",
                "e158afdc661f0d72cf0855b05900f774");
        AlidayuSMS alidayuSMS = new AlidayuSMS();
        alidayuSMS.setCode(String.valueOf(code));
        alidayuSMS.setName(user.getUserName());
        ObjectMapper objectMapper = new ObjectMapper();
        String json = objectMapper.writeValueAsString(alidayuSMS);

        AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();

        //必须填写normal
        req.setSmsType("normal");
        //应用名称
        req.setSmsFreeSignName("WIFI探针管理平台");
        //电话号码
        req.setRecNum(user.getUserName());
        //模板
        req.setSmsTemplateCode("SMS_74350014");
        req.setExtend(user.getUserName());
        req.setSmsParamString(json);
        try {
            AlibabaAliqinFcSmsNumSendResponse rsp = client.execute(req);
            user.setVerifyCode(String.valueOf(code));
            user.setVerifyTime(String.valueOf(new Date()));
            System.out.println(rsp.getBody());
//            HttpSession session = request.getSession();
//            session.setAttribute("verifyCode", String.valueOf(code));
            //int res = userMapper.updateVerifyCode(user);
            int res = userMapper.updateVerifyCode(user);
            System.err.println("验证码" + code);
            return String.valueOf(code);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }
 
开发者ID:wanghan0501,项目名称:WiFiProbeAnalysis,代码行数:41,代码来源:LoginServiceImpl.java

示例4: send

import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse; //导入依赖的package包/类
/**
 * 发送短信
 */
public Map send(PageData pageData){
    Map<String,String> map=new HashMap<>();
	try {
    	String recNum=pageData.getString("recNum");
    	String msgCode=pageData.getString("msgCode");
        TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
        AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
        req.setExtend(pageData.getString("extend"));
        req.setSmsType("normal");
        req.setSmsFreeSignName(pageData.getString("smsFreeSignName"));
        req.setSmsParamString(pageData.getString("smdParam"));
        req.setRecNum(recNum);
        req.setSmsTemplateCode(pageData.getString("smsTemplateCode"));
        AlibabaAliqinFcSmsNumSendResponse rsp = client.execute(req);
        String res=rsp.getBody();
        PageData retData=JSON.parseObject(res, PageData.class);
        
        if(retData.containsKey("error_response")){
        	map.put("state", "0");
        	map.put("msg", res);
        	return map;
        }else{
        	map.put("state", "1");
        	map.put("msg", res);
        	return map;
        }
    }catch(Exception e){
    	map.put("state", "0");
    	map.put("msg", "程序错误");
    	return map;
    }
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:36,代码来源:SendMsgUtils.java

示例5: sentValidCodeSms

import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse; //导入依赖的package包/类
/**
 * 发送验证码
 * @param mobileNum 手机号
 * @param validCode 验证码内容
 * @param signName 短信签名
 * @param templateNum 模板号
 * @param opeateName 操作名称(日志用)
 * @return 发送是否成功
 */
private boolean sentValidCodeSms(String mobileNum, String validCode,String signName,String templateNum,String opeateName){
    AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
    req.setSmsType("normal");
    req.setSmsFreeSignName(signName);
    req.setSmsParamString("{\"code\":\"" + validCode + "\",\"product\":\" "+SMS_PRODUCT_NAME+" \"}");
    req.setRecNum(mobileNum);
    req.setSmsTemplateCode(templateNum);
    AlibabaAliqinFcSmsNumSendResponse rsp ;
    try {
        rsp = getSmsClient().execute(req);
        if (rsp==null){
            log.error("验证码-"+opeateName+"-失败:返回结果为null,mobile:{} validCode{}",mobileNum,validCode);
            return false;
        }else{
            if(!rsp.isSuccess()){
                log.error("验证码-"+opeateName+"-失败:返回结果失败:,mobile:{} code:{} response:{}",mobileNum,validCode, ReflectionToStringBuilder.toString(rsp, ToStringStyle.SIMPLE_STYLE));
                return false;
            }
        }
    } catch (ApiException e) {
        log.error("验证码-"+opeateName+"-失败:短信发送异常,mobile:"+mobileNum+" code:"+validCode, e);
    }

    log.info("验证码-"+opeateName+":发送成功,mobile:{} validCode:{}",mobileNum,validCode);
    return true;
}
 
开发者ID:yangshuai0711,项目名称:dingding-app-server,代码行数:36,代码来源:SmsServiceWrapImpl.java


注:本文中的com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。