mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
#256 企业微信发送消息增加文本卡片消息的支持
This commit is contained in:
@@ -43,6 +43,14 @@ public class WxCpMessageGsonAdapter implements JsonSerializer<WxCpMessage> {
|
||||
messageJson.add("text", text);
|
||||
}
|
||||
|
||||
if (WxConsts.CUSTOM_MSG_TEXTCARD.equals(message.getMsgType())) {
|
||||
JsonObject text = new JsonObject();
|
||||
text.addProperty("title", message.getTitle());
|
||||
text.addProperty("description", message.getDescription());
|
||||
text.addProperty("url", message.getUrl());
|
||||
messageJson.add("textcard", text);
|
||||
}
|
||||
|
||||
if (WxConsts.CUSTOM_MSG_IMAGE.equals(message.getMsgType())) {
|
||||
JsonObject image = new JsonObject();
|
||||
image.addProperty("media_id", message.getMediaId());
|
||||
|
||||
Reference in New Issue
Block a user