Commit 3290e610 authored by qinxunjia's avatar qinxunjia

日志记录

parent 03019183
......@@ -41,6 +41,7 @@ public class DmHubApi {
*/
@PostMapping("/sms/template")
public String template(@RequestBody DmHubTemplateRequest params, String appId, String timestamp, String signature) {
log.info("**********创建模板接口入参*******:{},\r\n appId:{},timestamp:{},signature:{}", JSONObject.toJSONString(params), appId, timestamp, signature);
try {
boolean checkResult = this.checkSignature(timestamp, signature);
......@@ -95,6 +96,7 @@ public class DmHubApi {
public DmHubResponse batch(@RequestBody DmHubBatchSendRequest request, String appId, String timestamp, String signature) {
log.info("**********批量发送入参*******:{},\r\n appId:{},timestamp:{},signature:{}", JSONObject.toJSONString(request), appId, timestamp, signature);
DmHubResponse response;
long start = System.currentTimeMillis();
try {
boolean checkResult = this.checkSignature(timestamp, signature);
if (!checkResult) {
......@@ -105,7 +107,9 @@ public class DmHubApi {
log.error("发送批量短信异常", e);
response = new DmHubResponse(ResponseCode.SYSTEM_ERROR);
}
long end = System.currentTimeMillis();
log.info("**********批量发送出参*******:{}", JSONObject.toJSONString(response));
log.info("**********批量发送耗时*******:{}ms", end - start);
return response;
}
......@@ -129,6 +133,7 @@ public class DmHubApi {
@RequestMapping("/sms/send")
public DmHubResponse send(@RequestBody DmHubSendRequest request, String appId, String timestamp, String signature) {
log.info("**********单条发送入参*******:{},\r\n appId:{},timestamp:{},signature:{}", JSONObject.toJSONString(request), appId, timestamp, signature);
long start = System.currentTimeMillis();
DmHubResponse response;
try {
boolean checkResult = this.checkSignature(timestamp, signature);
......@@ -140,7 +145,9 @@ public class DmHubApi {
log.error("发送单条短信异常", e);
response = new DmHubResponse(ResponseCode.SYSTEM_ERROR);
}
long end = System.currentTimeMillis();
log.info("**********单条发送出参*******:{}", JSONObject.toJSONString(response));
log.info("**********单条发送耗时*******:{}ms", end - start);
return response;
}
......
......@@ -61,6 +61,7 @@ public class BgySmsServiceImpl implements BgySmsService {
@Override
public CLBizResponse sendSms(String mobile, String content, String areaId, String subModule, String api) throws Exception {
log.info("进入碧桂园短信发送接口");
String appId = BgySMSConfig.appId;
String securityCode = BgySMSConfig.securityCode;
String url = BgySMSConfig.url;
......@@ -76,8 +77,11 @@ public class BgySmsServiceImpl implements BgySmsService {
requestParams.put("content", content);
requestParams.put("mobile", mobile);
log.info("碧桂园短信接口参数:{}", JSONObject.toJSONString(requestParams));
long start = System.currentTimeMillis();
String retStr = SendSmsUtil.sendSmsByPost(url, JSONObject.toJSONString(requestParams));
log.info("碧桂园短信接口返回信息:{}", retStr);
long end = System.currentTimeMillis();
log.info("**********碧桂园短信接口耗时*******:{}ms", end - start);
if (retStr == null) {
return new CLBizResponse(ResponseCode.UPSTREAM_BLANK);
}
......@@ -95,6 +99,11 @@ public class BgySmsServiceImpl implements BgySmsService {
}
}
public static void main(String[] args) {
String encrypt = Md5Util.encrypt("1023" + "f80a1c5c-8f90-401a-98a1-221af5db0a9b".toUpperCase());
System.out.println(encrypt);
}
@Override
public CLBizResponse sendBatchSms(List<JSONObject> data, String areaId, String subModule, String api, String templateId) throws Exception {
log.info("进入碧桂园短信发送接口");
......@@ -110,9 +119,12 @@ public class BgySmsServiceImpl implements BgySmsService {
requestParams.put("templateId", templateId);
requestParams.put("data", data);
log.info("碧桂园短信接口参数:{}", JSONObject.toJSONString(requestParams));
long start = System.currentTimeMillis();
String reqStr = JSONObject.toJSONString(requestParams);
String retStr = SendSmsUtil.sendSmsByPost(url, reqStr);
log.info("碧桂园短信接口返回信息:{}", retStr);
long end = System.currentTimeMillis();
log.info("**********碧桂园短信接口耗时*******:{}ms", end - start);
if (retStr == null) {
return new CLBizResponse(ResponseCode.UPSTREAM_BLANK);
}
......
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