mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-06-28 13:16:19 +08:00
#623 群发接口增加clientmsgid
This commit is contained in:
parent
c0938ffedb
commit
1b759ea93b
@ -41,6 +41,11 @@ public class WxMpMassOpenIdsMessage implements Serializable {
|
||||
*/
|
||||
private boolean sendIgnoreReprint = false;
|
||||
|
||||
/**
|
||||
* 开发者侧群发msgid,长度限制64字节,如不填,则后台默认以群发范围和群发内容的摘要值做为clientmsgid
|
||||
*/
|
||||
private String clientMsgId;
|
||||
|
||||
public WxMpMassOpenIdsMessage() {
|
||||
super();
|
||||
}
|
||||
|
@ -38,11 +38,17 @@ public class WxMpMassTagMessage implements Serializable {
|
||||
* 是否群发给所有用户
|
||||
*/
|
||||
private boolean isSendAll = false;
|
||||
|
||||
/**
|
||||
* 文章被判定为转载时,是否继续进行群发操作。
|
||||
*/
|
||||
private boolean sendIgnoreReprint = false;
|
||||
|
||||
/**
|
||||
* 开发者侧群发msgid,长度限制64字节,如不填,则后台默认以群发范围和群发内容的摘要值做为clientmsgid
|
||||
*/
|
||||
private String clientMsgId;
|
||||
|
||||
public WxMpMassTagMessage() {
|
||||
super();
|
||||
}
|
||||
|
@ -3,9 +3,13 @@ package me.chanjar.weixin.mp.util.json;
|
||||
import com.google.gson.*;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
* @author someone
|
||||
*/
|
||||
public class WxMpMassOpenIdsMessageGsonAdapter implements JsonSerializer<WxMpMassOpenIdsMessage> {
|
||||
|
||||
@Override
|
||||
@ -45,6 +49,11 @@ public class WxMpMassOpenIdsMessageGsonAdapter implements JsonSerializer<WxMpMas
|
||||
}
|
||||
messageJson.addProperty("msgtype", message.getMsgType());
|
||||
messageJson.addProperty("send_ignore_reprint", message.isSendIgnoreReprint() ? 0 : 1);
|
||||
|
||||
if(StringUtils.isNotEmpty(message.getClientMsgId())){
|
||||
messageJson.addProperty("clientmsgid", message.getClientMsgId());
|
||||
}
|
||||
|
||||
return messageJson;
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,13 @@ import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassTagMessage;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
* @author someone
|
||||
*/
|
||||
public class WxMpMassTagMessageGsonAdapter implements JsonSerializer<WxMpMassTagMessage> {
|
||||
|
||||
@Override
|
||||
@ -51,6 +55,11 @@ public class WxMpMassTagMessageGsonAdapter implements JsonSerializer<WxMpMassTag
|
||||
}
|
||||
messageJson.addProperty("msgtype", message.getMsgType());
|
||||
messageJson.addProperty("send_ignore_reprint", message.isSendIgnoreReprint() ? 0 : 1);
|
||||
|
||||
if (StringUtils.isNotEmpty(message.getClientMsgId())) {
|
||||
messageJson.addProperty("clientmsgid", message.getClientMsgId());
|
||||
}
|
||||
|
||||
return messageJson;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user