Commit 0180ca87 authored by 宋勇健's avatar 宋勇健

短信接口

parent f547629e
......@@ -29,9 +29,8 @@ public class HclcSmsController extends BaseController {
@ResponseBody
@RequestMapping("/api/public/send/sms")
public JSONObject sendSms(HttpServletRequest request, @RequestBody(required = true) JSONObject params) {
JSONObject json = new JSONObject();
IRequest iRequest = createRequestContext(request);
json = hclcSmsService.sendSms(iRequest, params);
JSONObject json = hclcSmsService.sendSms(iRequest, params);
return json;
}
}
......@@ -19,7 +19,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
......@@ -79,7 +78,7 @@ public class HclcSmsServiceImpl implements IHclcSmsService {
@Override
public JSONObject sendSms(IRequest iRequest, JSONObject params) {
logger.info("=============start setSms==================");
logger.info("=============start sendSms==================");
JSONObject result = new JSONObject();
//appId && secretKey 通过社内 传入,以后修改的时候 只需要修改 pkg 就可以 不用修改java代码重启
......@@ -131,17 +130,16 @@ public class HclcSmsServiceImpl implements IHclcSmsService {
logger.info("token url: {}", sendSmsApiUrl);
if (sendSmsApiUrl != null) {
String request = "appId=" + appId + "&timestamp=" + timestamp + "&sign=" + sign + "&mobiles" + params.get("mobiles").toString() + "&content=" + params.get("content").toString() + "&customSmsId=" + params.get("customSmsId").toString();
HlsWsRequests log = hclcSmsLogService.createLog(iRequest, "hclc_sms", sendSmsApiUrl, request, Long.parseLong(params.get("mobiles").toString()));
setSms(iRequest, appId, sign, timestamp, sendSmsApiUrl, params.get("content").toString(), params.get("mobiles").toString(), params.get("customSmsId").toString(), null, null, log);
result = setSms(iRequest, appId, sign, timestamp, sendSmsApiUrl, params.get("content").toString(), params.get("mobiles").toString(), params.get("customSmsId").toString(), null, null, log);
} else {
result.put(Constants.RESP_CODE, transFail);
result.put("respMsg", "接口平台URL未定义,请检查!");
return result;
}
logger.info("=============end sendSms==================");
return result;
}
......@@ -150,7 +148,7 @@ public class HclcSmsServiceImpl implements IHclcSmsService {
*/
private JSONObject setSms(IRequest iRequest, String appId, String sign, String timestamp, String sendSmsApiUrl, String content, String mobiles, String customSmsId, String extendedCode, String timerTime, HlsWsRequests log) {
JSONObject result = new JSONObject();
logger.info("============= setSms==================");
logger.info("=============start setSms==================");
Map<String, String> params = new HashMap<String, String>();
try {
params.put("appId", appId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment