mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
添加对发送模板消息的单元测试
This commit is contained in:
@@ -257,9 +257,8 @@ public class WxMpServiceImpl implements WxMpService {
|
||||
@Override
|
||||
public String templateSend(WxMpTemplateMessage templateMessage) throws WxErrorException {
|
||||
String url = "https://api.weixin.qq.com/cgi-bin/message/template/send";
|
||||
String responseContent = execute(new SimplePostRequestExecutor(), url, templateMessage.toJson());
|
||||
JsonElement tmpJsonElement = JSON_PARSER.parse(responseContent);
|
||||
final JsonObject jsonObject = tmpJsonElement.getAsJsonObject();
|
||||
String responseContent = this.post(url, templateMessage.toJson());
|
||||
final JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObject();
|
||||
if (jsonObject.get("errcode").getAsInt() == 0){
|
||||
return jsonObject.get("msgid").getAsString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user