This action will force synchronization from Rainy/DocSys, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
/*** @Title: SmsService.java* @Package com.DocSystem.commonService* @Description: TODO 发送短信服务* @author Rainy* @date 2017年8月29日*/package com.DocSystem.commonService;import java.io.IOException;import java.net.URLEncoder;import java.util.Map;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;import util.GsonUtils;import util.RegularUtil;import util.ReturnAjax;/*** ClassName: SmsService* @Description: TODO* @author zhanjp* @date 2016年5月31日*/@RequestMapping("SMS")@Controllerpublic class SmsService {/*** 测试可用,上面那个不能用 2016年7月29日 00:05:16* @param phone* @param tplId* @param session* @param msg* @return*/@SuppressWarnings("unchecked")@ResponseBody@RequestMapping("/sendSms")public boolean sendSms(ReturnAjax rt, String phone,String smsServer, String smsApikey, String smsTplid,String code, String type, String content){//手机号格式检查if(phone!=null && !"".equals(phone)){if(!RegularUtil.IsMobliePhone(phone)){rt.setError("您的手机号格式不对,请重新检查。");return false;}}else{rt.setError("手机号不能为空,请重新检查。");return false;}String rtJson;try {String tpl_value = "";if(code !=null && !"".equals(code)){tpl_value = "#code#=" + URLEncoder.encode(code,JavaSmsApi.ENCODING);}if(type!=null && !"".equals(type)){tpl_value += (tpl_value.length()>0?"&":"") + "#type#=" + type;}if(content!=null && !"".equals(content)){tpl_value += (tpl_value.length()>0?"&":"") + "#content#=" + content;}if(smsServer == null || smsServer.isEmpty()){rtJson = JavaSmsApi.tplSendSms(JavaSmsApi.apikey, smsTplid, tpl_value, phone);}else{rtJson = JavaSmsApi.tplSendSms(smsServer, smsApikey, smsTplid, tpl_value, phone);}System.out.println(rtJson);Map<String, Object> rtObj = GsonUtils.getObject(rtJson, Map.class);Double rtCode = (Double) rtObj.get("code");if(rtCode == null || rtCode < 0){rt.setError("发送短信失败!");}else{return true;}} catch (IOException e) {e.printStackTrace();rt.setError("发送短信失败!");}return false;}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。