| @@ -16,6 +16,7 @@ public class WxMpMassTagMessage implements Serializable { | |||||
| private String msgType; | private String msgType; | ||||
| private String content; | private String content; | ||||
| private String mediaId; | private String mediaId; | ||||
| private boolean isSendAll = false; | |||||
| private boolean sendIgnoreReprint = false; | private boolean sendIgnoreReprint = false; | ||||
| public WxMpMassTagMessage() { | public WxMpMassTagMessage() { | ||||
| @@ -88,4 +89,18 @@ public class WxMpMassTagMessage implements Serializable { | |||||
| this.sendIgnoreReprint = sendIgnoreReprint; | this.sendIgnoreReprint = sendIgnoreReprint; | ||||
| } | } | ||||
| /** | |||||
| * 是否群发给所有用户 | |||||
| */ | |||||
| public boolean isSendAll() { | |||||
| return isSendAll; | |||||
| } | |||||
| public void setSendAll(boolean sendAll) { | |||||
| if(sendAll){ | |||||
| this.tagId = null; | |||||
| } | |||||
| isSendAll = sendAll; | |||||
| } | |||||
| } | } | ||||
| @@ -24,7 +24,7 @@ public class WxMpMassTagMessageGsonAdapter implements JsonSerializer<WxMpMassTag | |||||
| JsonObject messageJson = new JsonObject(); | JsonObject messageJson = new JsonObject(); | ||||
| JsonObject filter = new JsonObject(); | JsonObject filter = new JsonObject(); | ||||
| if (null == message.getTagId()) { | |||||
| if (message.isSendAll() || null == message.getTagId()) { | |||||
| filter.addProperty("is_to_all", true); | filter.addProperty("is_to_all", true); | ||||
| } else { | } else { | ||||
| filter.addProperty("is_to_all", false); | filter.addProperty("is_to_all", false); | ||||