与微信交互的参数一起打印

This commit is contained in:
Chopper 2021-09-30 10:24:15 +08:00
parent e2f5b6031a
commit 5181a19f29
2 changed files with 7 additions and 8 deletions

View File

@ -80,7 +80,7 @@ public class WechatMPMessageServiceImpl extends ServiceImpl<WechatMPMessageMappe
Map<String, Object> params = new HashMap<>(1); Map<String, Object> params = new HashMap<>(1);
params.put("priTmplId", templateId); params.put("priTmplId", templateId);
String message = WechatMessageUtil.wechatHandler(HttpUtil.post(delMsgTpl + accessToken, params)); String message = WechatMessageUtil.wechatHandler(HttpUtil.post(delMsgTpl + accessToken, params));
log.info("删除模版响应:{}", message); log.info("删除模版请求:{},删除模版响应:{}", params, message);
}); });
} }
@ -117,9 +117,8 @@ public class WechatMPMessageServiceImpl extends ServiceImpl<WechatMPMessageMappe
params.put("tid", tplData.getTid()); params.put("tid", tplData.getTid());
params.put("kidList", kids); params.put("kidList", kids);
params.put("sceneDesc", tplData.getSceneDesc()); params.put("sceneDesc", tplData.getSceneDesc());
log.info("添加模版参数:{}", JSONUtil.toJsonStr(params));
String content = HttpUtils.doPostWithJson(addTpl + accessToken, params); String content = HttpUtils.doPostWithJson(addTpl + accessToken, params);
log.info("添加模版响应:{}", content); log.info("添加模版参数:{},添加模版响应:{}", params, content);
JSONObject tplContent = new JSONObject(content); JSONObject tplContent = new JSONObject(content);
WechatMessageUtil.wechatHandler(tplContent); WechatMessageUtil.wechatHandler(tplContent);

View File

@ -75,7 +75,7 @@ public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, W
setIndustryParams.put("industry_id2", 5); setIndustryParams.put("industry_id2", 5);
String context = HttpUtils.doPostWithJson(setIndustry + accessToken, setIndustryParams); String context = HttpUtils.doPostWithJson(setIndustry + accessToken, setIndustryParams);
log.info("设置行业:{}", context); log.info("设置模版请求{},设置行业响应{}", setIndustryParams, context);
//获取已有模版删除 //获取已有模版删除
context = HttpUtil.get(allMsgTpl + accessToken); context = HttpUtil.get(allMsgTpl + accessToken);
JSONObject jsonObject = new JSONObject(context); JSONObject jsonObject = new JSONObject(context);
@ -94,7 +94,7 @@ public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, W
Map<String, Object> params = new HashMap<>(1); Map<String, Object> params = new HashMap<>(1);
params.put("template_id", templateId); params.put("template_id", templateId);
String message = WechatMessageUtil.wechatHandler(HttpUtil.post(delMsgTpl + accessToken, params)); String message = WechatMessageUtil.wechatHandler(HttpUtil.post(delMsgTpl + accessToken, params));
log.info("删除模版响应:{}", message); log.info("删除模版请求:{},删除模版响应:{}", params, message);
}); });
} }
@ -104,10 +104,10 @@ public class WechatMessageServiceImpl extends ServiceImpl<WechatMessageMapper, W
WechatMessage wechatMessage = new WechatMessage(); WechatMessage wechatMessage = new WechatMessage();
Map<String, Object> params = new HashMap<>(1); Map<String, Object> params = new HashMap<>(1);
params.put("template_id_short", tplData.getMsgId()); params.put("template_id_short", tplData.getMsgId());
String content = HttpUtils.doPostWithJson(addTpl + accessToken, params); String message = HttpUtils.doPostWithJson(addTpl + accessToken, params);
log.info("添加模版响应:{}", content); log.info("添加模版请求:{},添加模版响应:{}", params, message);
JSONObject tplContent = new JSONObject(content); JSONObject tplContent = new JSONObject(message);
WechatMessageUtil.wechatHandler(tplContent); WechatMessageUtil.wechatHandler(tplContent);
//如果包含模版id则进行操作否则抛出异常 //如果包含模版id则进行操作否则抛出异常